Example code for PCA9674PW IO expander

キャンセル
次の結果を表示 
表示  限定  | 次の代わりに検索 
もしかして: 

Example code for PCA9674PW IO expander

1,027件の閲覧回数
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?

タグ(1)
0 件の賞賛
返信
1 返信

1,003件の閲覧回数
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 件の賞賛
返信