'How to set up Raspberry Pi 4B as a I2C slave
I'm trying to set up a RPi 4B to work as an I2C slave with PSoC (4.4) - CY8C5888LTI-LP097. Below is my code to set up the slave address on the Pi.
import pigpio
pi = None
slave_addr = 0x13
def i2cInterrupt():
global pi
global slave_addr
status, bytes_read, data = pi.bsc_i2c(slave_addr)
if bytes_read:
print(data)
pi = pigpio.pi()
int_handler = pi.event_callback(pigpio.EVENT_BSC, i2cInterrupt)
pi.bsc_i2c(slave_addr)
I have followed this example: http://abyz.me.uk/rpi/pigpio/python.html#bsc_i2c however, not detecting anything when I run
$ i2cdetect -y 1
Solution 1:[1]
Make sure that you loopback any i2c master GPIOs to the slave GPIOs. On RPi4 you'll have to jumper GPIO 2-3 to GPIO 10-11, respectively.
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
Solution | Source |
---|---|
Solution 1 | Adrian Mole |