PropBasic I2C Routines for PCA9554 or PCA9555
G McMurry
Posts: 134
I am neck deep in a new project where I want to use 4 PCA9554 IO expanders on the SCL and SDA lines of a Spinneret. I am trying to debug the boards I made but am up against the wall with PropBasic use of I2CREAD and I2CWRITE.
The PropBasic syntex manual I have is quite brief and I have been pouring over the PCA9554 Data sheet(s) with little success.
Does anyone have any PropBasic code for setting up, reading and writing to the PCA9554 (or PCA9555) that they would share with me?
This is my first Propeller project having just cut over from PBasic. My programming skills are not as good as my hardware ability.
Greg
The PropBasic syntex manual I have is quite brief and I have been pouring over the PCA9554 Data sheet(s) with little success.
Does anyone have any PropBasic code for setting up, reading and writing to the PCA9554 (or PCA9555) that they would share with me?
This is my first Propeller project having just cut over from PBasic. My programming skills are not as good as my hardware ability.
Greg
Comments
To communicate with the IC's you need to perform 2 writes if you send a BYTE at a time. One for Port-0, and another for Port-1. As far as I have read, both ports need to be written/read to/from in sequence even if you do not want to alter the one not used. Or you can read/write a single time using WORD data.