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.

tms320f2812 SPI configuration

Other Parts Discussed in Thread: ADS1274

I am using the 2812 to get data from an ADC using SPI. The ADC sends a data ready (an interrupt for the 2812) and the 2812 responds with a few dummy writes to receive the data from the ADC. The questions are: I'm actually using only 2 pins of the SPI to receive my data: the clock and SOMI . Is it possible to keep the SPISIMO and SPISTEA  as a general purpose I/O's? Do I need to configure the Direction Register in the case of the CLK (out) and the SOMI (in) or just configuring the MUX register for those two pins does the trick?

Regards

  • Carlos,

    Yes, you technically can avoid configuring the SPISTE and SPISIMO pins and operate with just SPISOMI and SPICLK. I don't recommend skimping on the SPISTE though. You are hardwiring the ADC Chip select pin to always be active. Be careful with your SPICLK and ensure that you do not have any noise. It is possible that if noise appears on the SPICLK line, the ADC will interepret that as a valid clock and send a single bit, after that, you are out of sync and will have to re-sync at some point.

    Regarding the GPIO MUX, it is not necessary to configure the GPxDIR register if you have selected the proper GPxMUX option. I would make sure that the GPxQSEL is configured to Asynchronous though.

    Regards,
    Mark
  • In my case the SPI communicates with an ADS1274. This converter produces a Data Ready signal when conversion is over, and it is the responsability of the uController to read all the data before the next conversion finishes. I can't see how I can take advantage of SPISTE in this application.
    I have another question on interrupts. Studying the example on cpuTimer0 and how to setup the PIE, I noticed that the example doesn't try to clear the TIF flag when the interrupt shows up. It seems as if interrupts go directly to the PIE if TIE is enabled and the TIF will stay on all the time. Is this correct? It seems that every time a Timer interrupt happens, a kind of transition is created within the Timer that sets the PIE IF. Is this correct. What is the role of the TIF, other than saying ... Yes there was a Timer interrupt. Some processors would not generate another interrupt until the Timer Flag is clear.