PCA9502 SPI not working

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

PCA9502 SPI not working

737 Views
henry_wusa
Contributor I

Hello,

I am using PCA9502 and want to use its SPI interface to read 8 GPIO pins.

First, I hardware reset PCA9502 and configure it by writing the values into internal registers.

 

RegisterRegisters AddressValue
IODir0x0A0x00
IOIntEna0x0C0x00
IOControl0x0E0x08

 

截圖 2022-06-23 11.12.21.png

Using the SPI interface, the actual MOSI address needs to be shifted 3 digits and they will be like:

RegisterAddressValue
IODir0x500x00
IOIntEna0x600x00
IOControl0x700x08

 

Then I read the GPIO pins by reading the internal register 0x0B and the actual MOSI address will be 0xD8. However, after I send 0xD8 into PCA9502, the logic analyzer shows that PCA9502 output is always High no matter what the GIPO pins are (as below).

PCA_SPI.png

Tags (2)
0 Kudos
Reply
2 Replies

721 Views
guoweisun
NXP TechSupport
NXP TechSupport

Except this internal registers write/read abnormal, can other registers write/read normally?

0 Kudos
Reply

713 Views
henry_wusa
Contributor I

Hi,

There are only five registers in PCA9502:

截圖 2022-06-23 16.08.36.png

I write "0x00" into these registers, and always read out with the same value "0xFF".

Additionally, I think my problem is similar to this.

0 Kudos
Reply