cancel
Showing results for 
Search instead for 
Did you mean: 

ADC sampling rate

its
Associate II
Posted on January 17, 2013 at 10:19

I want to sample 1Mhz signal from stm32F4 discovery using ADC1 channel 7. I get 100Khz sample fine, but above it, sampling is not proper. how can I increase sampling rate or what can be the problem?

#ampling-rate #adc
7 REPLIES 7
raptorhal2
Lead
Posted on January 17, 2013 at 15:31

Two possibilities:

PA7 is also connected to the on board IC/SPI accelerometer interface, possibly causing a loading problem. The only truly free channels available are 1, 2, 3, 8, 9, 11, 12, 14, & 15.

The ADC clock is lower than the 36 MHZ possible.

If you want more than blind guesses, show code and a signal source diagram.

Cheers, Hal

its
Associate II
Posted on January 30, 2013 at 05:18

The original post was too long to process during our migration. Please click on the provided URL to read the original post. https://st--c.eu10.content.force.com/sfc/dist/version/download/?oid=00Db0000000YtG6&ids=0680X000006I6lO&d=%2Fa%2F0X0000000buq%2FUBLlUme0j.2sSpk37b2YOf9OCm2E6JO_ZiFxJz4afk0&asPdf=false
raptorhal2
Lead
Posted on January 30, 2013 at 18:19

what can be the problem? what i am missing here?

You apparently haven't read the F4 datasheet. Page 1 says max sampling rate is 2.4 million samples/second. When the signal is 1 MHz, there will be only a few samples per cycle, resulting in the ''distortion'' you see.

To get better results (7.2 million samples/second), use triple ADC mode on channel 1, 2, 3, 11, or 12.

Cheers, Hal

its
Associate II
frankmeyer9
Associate II
Posted on January 31, 2013 at 20:44

        while(1)

 

           {                                   

 

                gg[count++] =ADC_GetConversionValue(ADC1);

 

You are reading the ADC data in the main loop, with absolutely no synchronisation to the ADC. Your results are a mixture of the ADC sampling frequency and the main-loop-read-frequency. That is ok for potentiometers with a sub-hertz change rate, but not for you Msps rate.

I suggest to reorganize your code to use DMA, stop after DMA TC interrupt (i.e., when the buffer is full), and transfer this data.

raptorhal2
Lead
Posted on February 01, 2013 at 18:16

In triple interleaved mode, the data is interleaved in the 3 successive 32 bit words as explained in Section 11.9 of the Reference Manual. After following fm's advice about letting DMA fill the 1000 word buffer, resort the data into 16 bit words before sending it to MathLab.

Cheers, Hal

manishbaing2789
Associate II
Posted on November 18, 2013 at 08:40

Hello How do u Displayed singal..? i.e  which  u have terminal for displaying signal coming from STM32F4 Discovery.