Shop OBEX P1 Docs P2 Docs Learn Events
PCF8574 Emulator — Parallax Forums

PCF8574 Emulator

localrogerlocalroger Posts: 3,452
edited 2011-06-21 06:48 in Propeller 1
Here is something a little different I needed for a job at work. There are plenty of I2C objects floating around, including drivers for the PCF8574 8-bit parallel I/O expander. But I needed a propeller to pretend to be a PCF8574 to fake out another I2C host. This turned out to be a bit tricky, since the host ran at pretty high speed and Spin wasn't fast enough. I figured it might be useful to someone else since it provides the backbone for emulating any other I2C slave device.

I'd put it in the obex along with a couple of other things I have waiting, except that I still can't login or reset my password.

Comments

  • JonnyMacJonnyMac Posts: 9,208
    edited 2011-06-20 07:56
    I've been wanting to experiment with I2C slave code -- you just saved me some time. Thank you!
  • localrogerlocalroger Posts: 3,452
    edited 2011-06-20 18:16
    Glad to be of help JonnyMac, I was thinking someone else might be able to use it. If you're emulating anything other than a PCF8574 you can drop the code that sets the interrupt flag and replace it with a WAITPEQ or PNE.
  • Bill HenningBill Henning Posts: 6,445
    edited 2011-06-21 06:48
    Very cool, and very useful!

    I wonder how long before there are many little I2C device emulations embedded in it?
    localroger wrote: »
    Here is something a little different I needed for a job at work. There are plenty of I2C objects floating around, including drivers for the PCF8574 8-bit parallel I/O expander. But I needed a propeller to pretend to be a PCF8574 to fake out another I2C host. This turned out to be a bit tricky, since the host ran at pretty high speed and Spin wasn't fast enough. I figured it might be useful to someone else since it provides the backbone for emulating any other I2C slave device.

    I'd put it in the obex along with a couple of other things I have waiting, except that I still can't login or reset my password.
Sign In or Register to comment.