2013-01-17 01:19 AM
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 #adc2013-01-17 06:31 AM
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, Hal2013-01-29 08:18 PM
2013-01-30 09:19 AM
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, Hal2013-01-31 11:07 AM
hi
I have tried that, but no result. please have a look at it. I have attached the CODE and WAVEFORM. thanks. ________________ Attachments : 1mhz.jpg : https://st--c.eu10.content.force.com/sfc/dist/version/download/?oid=00Db0000000YtG6&ids=0680X000006I02V&d=%2Fa%2F0X0000000bTD%2FmpxcukxGmS6Jp8NpAowJCCr3ughnbCJFrjIdIKBlXjE&asPdf=falsemain.c : https://st--c.eu10.content.force.com/sfc/dist/version/download/?oid=00Db0000000YtG6&ids=0680X000006I02F&d=%2Fa%2F0X0000000bTB%2FKEBA2GKPN5wpu9WUa4RKgbpcVGM0IybW2bPNRU4gYLE&asPdf=false2013-01-31 11:44 AM
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.
2013-02-01 09:16 AM
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, Hal2013-11-17 11:40 PM