AnsweredAssumed Answered

Data rates in K53 Kinetis for SPI

Question asked by Samyukta Ramnath on May 23, 2015
Latest reply on May 25, 2015 by xiangjun.rong

Hello all,

As I had mentioned earlier, I am trying to get an ADAS1000SDZ Analog Front End and a K53 microcontroller to talk to each other.

I managed to find out that the reason I wasn't getting any data into the RX FIFO register was that the SCLK I was giving from the microcontroller (master) was too high for the ADAS1000(slave), which was outputting data at 2kHz. SCLK was at 12.5 MHz.

When I keep the SCLK around 800kHz rate, I get some data (sometimes, at other times it still gives zero always). When I run the code in debug mode, after sending the read command to the slave from the master, it does return some data, byte by byte. In debug mode I get a final 32 bit hex value as the data outputted. (I have still not verified that this data is a sine wave, as it is supposed to be).  However when I run the program normally, all I get is a long stream of zeros.

I understand that the speed at which the microcontroller is looking in to the FIFO is much higher at normal run time than in debug mode. This suggests that I should reduce the SCLK given by the microcontroller. It would also seem that I should match the two speeds, giving a 2kHz output SCLK. However, in the datasheet for the ADAS1000, it says that the minimum SCLK for 2kHz output is around 800kHz.  (Reference to Unable to get data out on ADAS1000 SPI pin | EngineerZone  )

What could be the reason that I sometimes get a long stream of zeros no matter what data rate I put, (even in debug mode), sometimes I get legitimate data in debug mode but not in run time, and sometimes in normal run time, I get a long stream of zeros followed by a short burst of clusters of 32 bit data followed by another long stream of zeros?