esp-arduino-libs / ESP32_IO_Expander

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

USB disconnects when using monitor to view log messages. #8

Open AdVirMachina opened 2 days ago

AdVirMachina commented 2 days ago

I have installed this and am using it against a Waveshare s3-4.3LCD board. I created a simple loop which turns off the backlight, waits 1 second, and turns it back on, waits 1 second and then loops. This particular board is using the CH422G to also manage which USB port is active (the board sports two). I am receiving USB disconnects when monitoring the application as it transitions the backlight from off to on. I suspect this has to do with the code assuming the initial state of the pins and not reading it into the "cache". I'm trying to instrument the code to validate this.

TBH, I don't understand where the register values have come from. The PDFs of the datasheet I've found don't mention them. In fact, they don't really outline an I2C interface but rather some unusual two wire interactions. Can someone help me source the I2C interface information? I can't find the example program cited in the datasheet either.

bondango commented 2 days ago

yes it uses the CH422G EXIO5 for USB_SEL(LOW) and USB_SEL(HIGH), though if your not recalling the .init or .begin again, the digitalWrite (BACKLIGHT, LOW or HIGH) should not effect pin 5 i would have imagined