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.
Register | Registers Address | Value |
IODir | 0x0A | 0x00 |
IOIntEna | 0x0C | 0x00 |
IOControl | 0x0E | 0x08 |
Using the SPI interface, the actual MOSI address needs to be shifted 3 digits and they will be like:
Register | Address | Value |
IODir | 0x50 | 0x00 |
IOIntEna | 0x60 | 0x00 |
IOControl | 0x70 | 0x08 |
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).
Except this internal registers write/read abnormal, can other registers write/read normally?
Hi,
There are only five registers in PCA9502:
I write "0x00" into these registers, and always read out with the same value "0xFF".
Additionally, I think my problem is similar to this.