SPI read is getting right shifted 1 bit of every byte in STM32L476ZGT6 at 20MHZ SPI CLK(SCLK)?
- June 26, 2020
- 3 replies
- 1486 views
I am working on STM32L476ZGT6 EVAL-Board for transferring data on the SPI to one of the audio codec which is SPI slave. I am trying to read the data from codec at 20 MHz SCLK. I am seeing that the data is getting right shifed 1 bit for of every byte. I have tried with Saleae Logic analyzer to see whether slave is responding properly, the data on the MISO line is proper but when reading the data from data register master side giving right shifed data. So the data on the bus is correct but in the DR register it is getting shifed. So something is happening in the shift register.
This is what my understanding. Anyone please explain what could be the issue.
My PCLK2 is at 80 MHz and baudrate control is fpclk/4 i.e SPI clock is at 20 MHz.
I tried at 10 MHz also and both write and reads working properly but with 20 MHz write is happening properly read is getting right shifted.
The wave forms captured in saleae logic analyzer of both 10 MHz and 20 MHz reads seems to be same. Attaching the same for reference.