PCA9502 SPI not working

取消
显示结果 
显示  仅  | 搜索替代 
您的意思是: 

PCA9502 SPI not working

528 次查看
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

标记 (2)
0 项奖励
2 回复数

512 次查看
guoweisun
NXP TechSupport
NXP TechSupport

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

0 项奖励

504 次查看
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 项奖励