cancel
Showing results for 
Search instead for 
Did you mean: 

STM32 SPI/I2S and TI ADS7951 ADC

electronics
Associate II
Posted on July 16, 2012 at 17:09

Hello everybody,

I'm evaluating the STM32F207IG and I need to acquire samples from an ADC from Texas Instruments (ADS7951), which is a 12bit 1MS/s serial ADC.

The ADC interface is a sort of SPI, with MISO, clock and a CS line. The CS line should be pulled low to activate the device, should stay low for the whole transfer (>16 clock cycles) and then rise again.

The needed waveforms are shown at page 23 of this

http://www.ti.com/lit/gpn/ads7951

.

I have to acquire at about 350kS/s with DMA support.

I've read the STM32F207IG reference manual, and at page 660/661 of its 

http://www.st.com/internet/com/TECHNICAL_RESOURCES/TECHNICAL_LITERATURE/REFERENCE_MANUAL/CD00225773.pdf

 is described an SPI TI mode that seems similar to the one needed to drive my ADC.

Since I'm in the evaluation phase, I do not have devices and boards to hook up an ADC and try, could anyone with hands-on experience with STM32 SPI in TI mode tell me if that interface is compatible with the one needed by that ADC?

Regards,

Francesco
14 REPLIES 14
electronics
Associate II
Posted on July 18, 2012 at 16:54

Unfortunately the other board is not under my control, it is bought directly by the customer and has that ADC on board. We'll see if we can find a different solution.

emalund
Associate III
Posted on July 18, 2012 at 17:24

Unfortunately the other board is not under my control, it is bought directly by the customer and has that ADC on board. We'll see if we can find a different solution

 

 

The SILabs '51 100MHz derivatives are waaay fast enough and have all the flexible interfacing you will need.  consider sticking one of those between your Cortex and the ADC. You can evaluate yourself if you can use a cheaper (non-100MHz) derivative.

In hefty I/O processing cases I am a great fan of multi-processor (as opposed to multi-processing)

Erik
frankmeyer9
Associate II
Posted on July 18, 2012 at 17:25

Unfortunately ...

 

As said, I don't know your project, so I can hardly judge it. However, your wording shows you are not totally happy with that ...

At least you should investigate the required performance, and compare with the available one as defined by the choice of controller. If going to tight here, you might get in trouble later on.

Posted on July 18, 2012 at 20:20

Per Erik, an 8051 might be cheaper than a CPLD, to transcode.

Does the ADC presume a continuous clock signal?

Perhaps you could use timers to generate CLK and CS signals, and pretend to be a slave.

What is expected of the STM32 in this design?

Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..
electronics
Associate II
Posted on July 20, 2012 at 18:11

Here are some updates:

I get a development board and tried to generate the CS signal using the timer3.

Timer3 channel1 is used as output compare, I set the timer in order to count from 0 to 23 and set a compare value of 16. I also set the timer to count using the channel2 as input clock, which is connected to the SPI clock. In this way the timer generates a signal which goes high after 16 spi clock and goes down at 24th bit. Seems ok at low speeds, but if I run the SPI clock ad the needed speed (6MHz) the latency in CS signal generation is too much (~80ns).

So I checked the SPI/I2S datasheet and I found that the I2S mode can be configured in ''PCM standard''. If I set a datalen of 16 bits and a channel lenght of 32 bits using a short PCMSYNC, I get exactly the signal needed by the ADC: data tranfers are 16bit wide, bit 17 to 32 are ignored during transfer and the CS signal goes high during the last bit (the 32bit) and goes down on the first. Also, the I2S mode has a separate PLL which is very useful to generate the correct sample frequency needed.

I have not attached the actual ADC to the signals, but from the scope they look OK.