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.