AnsweredAssumed Answered

Data transfer using SPI in K53 tower MuC

Question asked by Samyukta Ramnath on May 22, 2015
Latest reply on May 26, 2015 by Samyukta Ramnath

I am using SPI to send data from an analog front end to a microcontroller and would like to be able to receive the data. Before receiving the data, I send data to the AFE to set certain registers in the AFE and would like to read the received data on the SIn pin on the microcontroller. I am using a Kinetis K53 tower microcontroller and an ADAS1000sdz Analog Devices Front End.


I have to send command words to the AFE to set control registers in it that tell me what data is to be sent and at what rate. To do this, I am pushing the command words into the TX FIFO. I can see that there is data in the TX FIFO consistent with what I have sent. I can see the TCR counter incrementing. Every control bit is 32 bits, including the address of the control register in the AFE. I have set the frame size to 8 bits- which means, that to send one control word, I must send 8 bits at a time. This corresponds to 4 SPI0_PUSHR commands for one control register. At every PUSHR, I am also doing POPR, to check what data is getting received.


However at no point during the setting of the 4 control registers in the AFE, am I ever receiving any data in the RX FIFO.


Also, I understand that only after setting the control registers in the AFE, will I be able to get the sampled data from the AFE to the microcontroller. So after setting four control registers, which corresponds to 16 PUSHR commands in total, I should read the relevant received data from the AFE. However, the RX FIFO is again read byte-by-byte; so how would I read the received data?


If the data is streaming continuously, how would I know where one frame of data begins and one frame ends? I have set the incoming sampling rate at the time of setting the control registers present in the AFE.


Edit : I am setting in the ADAS1000SDZ, a FRAMES register to issue the command to read the data. According to the datasheet, writing to the frame header register issues the read command to start putting the converted data out on the SDO pin.

I tried the example given in the ADAS1000SDZ datasheet, which is to generate a 150Hz sine tone, and still didn't receive any data in the RX FIFO registers after the write.

How do I read the registers that are read-only? How do I access the data there?


Message was edited by: Samyukta Ramnath