Example code for PCA9674PW IO expander

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Example code for PCA9674PW IO expander

615 Views
Nolan_Maverick
Contributor I

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?

Tags (1)
0 Kudos
1 Reply

591 Views
diazmarin09
NXP TechSupport
NXP TechSupport

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:

diazmarin09_0-1672168415437.png

 

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

0 Kudos