Hello everyone,
I'm trying to interface PCA9674PW with IMX board, but still I'm unable to control the GPIO pins, can anyone provide me example code to control this PCA9674PW IO expander?
This is the sequence I followed to control output GPIO pins.
1. configure GPIO pins as output, by sending 0xFF to 0x04
Reg: 0x04
value: 0xFF
2. Then written 0xFF to Reg 0x05 to set all pins HIGH
Reg: 0x05
value: 0xFF
is there any problem with above sequence?
Hello Nolan,
I hope all is great with you. Thank you for using the NXP communities.
Unfortunately we do not have any example code for such device.
Are you able to address the device? I mean, what is the I2C address selected?
Note that there is only one register to control four possibilities of the port pin: Input HIGH, input LOW, output HIGH, or output LOW. The writing sequence is shown below:
Therefore, in order to configure the pins as outputs HIGH, you should send the following sequence:
<S> <slave address + 0> <0xFF> <P>
I hope this information helps.
Regards,
David