I am thinking over an autonomous rover.
One of the features/components of the rover will be ability to know how fast is the rover moving and what distance did it travel. I would like to use dedicated attiny85 chip for that. The chip will use rotary encoder and interrupts to detect motion. It will be connected throught I2C/SPI (do not know yet) with the main controller. Main controller will ask the attiny85 on speed and distance if needed.
The problem is, I guess, that rotary encoder will use interrupts and so the I2C or SPI may not work properly. I could disable interrupts while communicating but:
- Motion sensing won't be precise, as I will loose some motion data.
- When attiny85 will be on receiving side, it wont know soon enough that it should disable the interrupts.
- There is a chance that SPI/I2C uses the interrupts as well, not sure, have to check.
Am I right? What would you advise?