This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

CCS/RM48L952: Attempting to get data from external ADC with SPI1

Part Number: RM48L952
Other Parts Discussed in Thread: HALCOGEN, ADS8922B

Tool/software: Code Composer Studio

Hello, 

I am currently working on a project, and I have currently run into an issue that has halted my progress.

Context: I tried posting this earlier and got some weird error so here goes attempt #3.

First, some details which may help in troubleshooting:

>Relevant system components:

--> CCSv7

--> HALCoGen v4.07

--> RM48

--> ADS8922B

>Basic overview of what I am trying to accomplish:

--> Acquire ADC conversions from the daisy-chain configuration with the RM48

--> Store the conversions onto a microSD card

 

>Current Setup/Configuration:

--> MIBSPI1/SPI1 module is connected to the ADC daisy-chain (this will be the module I use to send data to/receive data from the ADCs)

-----> The daisy-chain topology that I am using is straight from the ADS892xB data sheet; and has been validated

--> The baud rate for the SPI module is set to 400 kHz

--> nCS[3] is configured as GIO for bit banging (remaining SPI pins are SPI functional)

--> MIBSPI1/SPI1 module pin map:

         RM48 pin            ->   ADC pin  ->  Brief Detail

-----> MIBSPI1NCS_3  ->  nCS          ->  nCS lines of all 3 ADCs are tied together as per the data sheet

-----> MIBSPI1SIMO    ->  SDI           ->  SIMO line is connected to SDI pin of the first ADC (x-axis) in the daisy-chain

-----> MIBSPI1SOMI    ->  SDO-0      ->  SOMI line is connected to SDO-0 pin of the last ADC (z-axis) in the daisy-chain

-----> MIBSPI1CLK      ->  SCLK        ->  SCLK lines of all 3 ADCs are tied together as per the data sheet

-----> GIOA_5              ->  CONVST  ->  CONVST lines of all 3 ADCs are tied together as per the data sheet

-----> Each nRST & RVS pin for every ADC is connected to a GPIO

The Problem: 

I have been using a saleae logic analyzer to observe communications across the relevant SPI lines. I am currently able to view and verify the data that I am sending. I am also consistently getting some sort of junk data response from the daisy-chain ("junk" meaning that I am currently not feeding a signal into the ADC for it to convert, so the responses I am getting are random values). All I am trying to do as of now is successfully store the "junk" I am getting into a buffer. I am using the spiTransmitAndReceive() function to send/receive data. **The source buffer data is being sent and has been validated, but the destination buffer ends up with all 1s (which typically indicates no connection) rather than what the saleae is seeing on the MISO line**.

Questions:

> Is the code in the while(1) loop expected to result in a single conversion for every iteration of the loop? (timing may be an issue?)

> After completing a single conversion, how do I store that data into the receive buffer (rxBuff)?

> Is an interrupt required when trying to receive data from an external device? Or can I just use the polling function spiTransmitAndReceiveData() in order to successfully receive data?

In summary:

> I am going to use the default ADC configurations (as of now, may change if necessary)

> I have verified the data being sent is what I expect

> I am getting some type of response from the daisy-chain (as observed by the saleae). However, this data has not been validated and I have not successfully stored the data into the receive buffer

I am not really sure what I am missing as of right now. My intuition is telling me that talking to an external ADC is the same concept as setting up two SPI modules as master and slave, and sending data between the 2 modules (an external loopback). Either my intuition is wrong, or my attempt at executing my idea is incorrect - just not sure at the moment.

As always, thank you for your time and consideration!