Shop OBEX P1 Docs P2 Docs Learn Events
I2c slave — Parallax Forums

I2c slave

Can the P1 be used as an i2c slave? I’d like to attach it to the i2c port on a Raspberry Pi and also use 4 instances of JonnyMac’s 1-wire object to act as sort of an 1-wire expander plus a little logic. I seem to recall that being a SPI slave was difficult and wondered if i2c had similar problems.

Comments

  • JonnyMacJonnyMac Posts: 9,156

    If you're writing the code for both sides, maybe serial is an easier way to go. I haven't used the RPi in a while, but doesn't it have a secondary serial port on the IO pin? This would let you receive a command, process the command, then send [tagged] results back. With I2C or SPI you're a slave to the RPi's clock, which may be tricky.

  • David BetzDavid Betz Posts: 14,516
    edited 2024-07-26 09:43

    @JonnyMac said:
    If you're writing the code for both sides, maybe serial is an easier way to go. I haven't used the RPi in a while, but doesn't it have a secondary serial port on the IO pin? This would let you receive a command, process the command, then send [tagged] results back. With I2C or SPI you're a slave to the RPi's clock, which may be tricky.

    Probably a good idea but I’m already using 5 UARTs on the Pi. I think it has 6 though so it might work.

Sign In or Register to comment.