0
votes

I want to interface raspberrp pi and Mbed microcontroller through I2c bus. Both operate at 3.3v, I have connected Rpi SCL ----> mbed SCL, RPI SDA------> mbed SDA, RPI gnd -----> mbed gnd. After connecting all these things I run sudo i2cdetect -y 1 command its does not shows any more address connected to Rpi . Both the modules have internal pull up resistor ...

1

1 Answers

0
votes

I²C is a master-slave protocol. That means one devices takes over the role of the master, and one (or multiple) devices connected to the I²C bus act as an I²C device.

In your case it seems like the raspberry pi is working as the master. To put the mbed device into I²C slave mode you have to instantiate one I2CSlave class.

Documentation and a tiny example is on the official site:

https://developer.mbed.org/users/mbed_official/code/mbed/docs/tip/classmbed_1_1I2CSlave.html