Help to use SPI Receivce Only Slave correctly with an ADC
Hi
I have a project were i should communicate with an AD7768 ADC from my Nucleo-H743ZI2. The AD7768 is setup as SPI master and the stm32H743 is setup in SPI Receive slave only mode.
There is three connections between the two devices, a clock signal, a data line and a data ready signal. The AD7768 is just sending data as soon as it is started, so the clock signal is always running and data arrives every time the ready signal is making a pulse. The data is always 32 bytes long and start from the first clock cycle after the ready signal i going low.
The ready signal i called every 1 ms.
How would you recommend this to be implemented?
I tried with a "one shoot"SPI read, were the ready signal is connected to a gpio interrupt and when it is called i read 32 bytes from the SPI. The result here was that the value read from the SPI was always three clock cycle late, so i didin´t get the first three bit. Here i was using the HAL_SPI_Reveive function, i then tried optimizing this function and then i was only missing the first two clock cycles.
I have been think of a function were i start the SPI receive and it just continue reading and then when the ready signal is calling the gpio interrupt, then is should ready the next 32 bytes. Could this maybe solve the problem? If so can anyone maybe give me an idea how to make the SPI continues reading functions.
I hope someone will guide me in the right direction :smiling_face_with_smiling_eyes: