Hi Gustavo, On 10/1/23, Gustavo Soares <gustavo.felipesoa...@hotmail.com> wrote: > Hello everyone! > > I have a PCF8575 IO expander with 16 channels wich I want to use 8 for write > (P10 to P17). The hardware is already configures and all LED's connected to > these ports are on. As you can see, NuttX sees the I2C device: > > [cid:ecafac4f-7e7e-4cb1-a090-ecdc0b0d942e] > > Also when I run the command to read it, it returns FF (255), meaning all > LEDs are on: > > [cid:03315e20-c94f-4166-922a-7512f6f6fb63] > > For some reason the command to write into the i2c device seems not to work: > > [cid:39e062d1-caf0-4128-9874-a6c2792db4fd] > > *I tested the i2c device and the LEDs with a simple counter program using > visuino (https://www.visuino.com/) and it worked. > *For NuttX, I followed the steps of this > video<https://www.youtube.com/watch?v=RzrDa4Sm1rU>. > > Is the i2c set command correct? Should I apply any adicional config? >
There is already a PCF8575 driver on NuttX. I suggest you to try using that driver instead of play with the chip from terminal. Probably the error is because you are reading 1 byte by time, the chip expects 16-bit reading. BR, Alan