I have an application connecting an Arduino and a Raspberry Pi via i2c. The Arduino is running a timer interrupt and the communication needs to occur after the timer interrupt has happened. The timer interrupt is running at 500Hz. It seems that setting up a Raspberry Pi as an i2c slave is not simple. What I am doing right now is having the Pi poll the Arduino over i2c. The Arduino returns a 0 if it is not ready. This works ok but requires many i2c interrupts per time period. I have also tried using pigpio to have the Arduino generate a square wave in its timer ISR whose edges triggers the Pi. But this seems to take 50ms per trigger and I am aiming at 2ms.

Is it possible for the Arduino to somehow communicate that it isn't ready yet by holding the clock pin low or something so that the Pi will recognize the issue and gracefully wait? Whatever the Arduino were to do, the Pi would need to respond very quickly (<0.5ms) when the ready signal comes.

  • 1
    The standard Linux driver on the Pi does not support working as a slave. The Pi hardware has limited support for slave working but no one has made it work (as far as I know). Could you explain what you are trying to achieve? Presumably you are trying to get data from the Arduino to the Pi. Why not just use the Pi in master mode to request the data at regular intervals or have the Arduino signal via a GPIO when data is available? – joan Nov 27 '15 at 8:51

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.