AnsweredAssumed Answered

Data rate question in SPI with ADAS1000 and kinetis microcontroller

Question asked by samyukta on May 23, 2015
Latest reply on Dec 14, 2015 by Hasan2015

Hello all,

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?

Edit : I tried pushing the command 0x07000000 to try and read the PACEAMPTH register, as it gives a default of 0x242424 to see if things were going correctly. It still gave zero.

Edit 2 : The results even vary with the number of breakpoints I give. If I give a breakpoint at every push and pop, it does give me some values and I am able to print. However if I give one breakpoint per 32 bit word, it often gives just 0 or sticks to one value such as 0x40000000.


The image shows the debug run at a luckily appropriate speed.




The image shows the run with no breakpoints.


Message was edited by: Samyukta Ramnath


Message was edited by: Samyukta Ramnath


Message was edited by: Samyukta Ramnath