esp-arduino-libs / ESP32_IO_Expander

Arduino library of driving IO expander chips for the ESP SoCs
Apache License 2.0
8 stars 9 forks source link

New Waveshare (b) devices use Different CH422G outputs #5

Closed bondango closed 1 month ago

bondango commented 1 month ago

The new Waveshare revision (B) devices for example esp 4.3(b) use the 8 directional i/o's and also the General purpose Output Pins of the CH422G. As per CH422G Datasheet :- The pins OC3-OC0 of CH422 are push-pull or open-drain output pins, and are push-pull output pins by default.

Waveshare schematic :- 1728054451643

Datasheet Layout:- 1728054329375

On the new revision boards OC0 and OC1 are used as digital Outputs to drive BC817-40's via PC817X3's

The current library has support for the 8 Directional I/Os but not the OCx Outputs.

Marty

Lzw655 commented 1 month ago

Hi @bondango, sorry for the late. I tried modifying the driver according to the CH422G manual so that it can control the OCx (pin number: 8-11) output level. However, since I don't have the hardware, could you please help me test it? Thank you very much!

bondango commented 1 month ago

Thank

Yes I will try and report hopefully this weekend

bondango commented 1 month ago

I did try a simple 1 second pause loop

expander - digitalWrite(8, HIGH); expander - digitalWrite(9, HIGH); delay(500); expander - digitalWrite(8, LOW); expander - digitalWrite(9, LOW); delay(500);

simple light test power gnd >>>output GND +12v >>> bulb blub >>> DI0

But nothing on the DO0 and D01 outputs inputs are working fine

Lzw655 commented 1 month ago

Thank you for the testing! Could you please provide your complete code and the serial output logs? It would also be best if you could add expander->printStatus(); in the loop.

bondango commented 1 month ago

the changes made by H-sw123 work fine my end