Shop OBEX P1 Docs P2 Docs Learn Events
PropBasic I2C Routines for PCA9554 or PCA9555 — Parallax Forums

PropBasic I2C Routines for PCA9554 or PCA9555

G McMurryG McMurry Posts: 134
edited 2011-12-06 17:58 in Propeller 1
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

Comments

  • Jorge PJorge P Posts: 385
    edited 2011-12-06 17:58
    It's not PropBasic, but I am using multiple PCA9555's with spin in this project Also, if you don't need the full brunt of the code so far, you can download earlier versions of that code from my website. It is by no means difficult, I am fairly new to spin and a bit surprised as to how easy it really is.

    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.
Sign In or Register to comment.