would like to ask a question relating to the following communication setup:
STM32 -- Arduino Pro Mini -- ADNS3080 sensor
The interface between STM32 -- Arduino is I2C and the interface between Arduino Pro Mini--ADNS3080 is SPI.
I have tested the communication between (STM32 -- Arduino Pro Mini) and between (Arduino Pro Mini -- ADNS3080 sensor). Both of them work fine; I can successfully send and receive data in both cases.
Now, I want to read the register of ADNS3080 using STM32. First, I start an I2C communication between STM32 -- Arduino Pro Mini, then, I send the register address of ADNS3080 to Arduino Pro Mini. Arduino Pro Mini reads the register address and in the same function starts a communication, using SPI, with ADNS3080 sensor.
But, I receive I2C errors in STM32 and I want to ask you is it possible to use I2C and SPI at the same time? Do, I have to introduce delays between the I2C and SPI commands?
Regards, Ali