2014-01-09 04:20 AM
2014-01-13 07:24 PM
Ok so working the numbers
HSE 5.12 MHz PLL_M 4 PLL_N 160 PLL_P 2 PLL Comparison Frequency 1.28 MHz PLL Frequency 204.8 MHz CPU Frequency 102.4 MHz APB1 Frequency 25.6 MHz APB2 Frequency 51.2 MHz ADC Prescaler /2 (25.6 MHz) Sample Cycles 28 25.6 MHz / (28 + 12) = 640 KHz [1.5625 us] QED While it techically violates the PLL requirements you could perhaps use the 16 MHz HSI HSI 16.0 MHz PLL_M 25 PLL_N 320 PLL_P 2 PLL Comparison Frequency 640 KHz [should be 1-2 MHz range] PLL Frequency 204.8 MHz2014-01-13 08:11 PM
2014-01-13 10:49 PM
2014-01-14 12:00 AM
2014-01-14 06:43 AM
2014-01-14 07:59 AM
See Table 5 in the Discovery Reference Manual. Channel 10 is PC0 and is dedicated to the OTG USB. It has a 10K pullup to 3V. Channel 13 is PC4 and is connected to the audio sensor with some load not known to me. Change to two free channels for your ping detector.
Cheers, Hal2014-01-14 07:31 PM
2014-01-14 07:46 PM
Opps that should have been
ADC_InitStructure.ADC_NbrOfConversion = 4;
// Not 1
The DMA operates in a circular fashion, over and over, and generates an interrupt at the half full (HT) and full (TC) points. At HT you can use the first 4 samples, they will be valid while the next 4 fill up, and those with be available at TC. If wraps back to the beginning, with no delay or additional programming. You'll have to stop the ADC/DMA if you want it to halt.
I'm not sure what you're doing with the DAC, and how that should relate to the timing of the samples.
You'll need to own this, and overcome your own doubts by testing and experimenting.
2014-01-17 03:44 AM
2014-01-18 12:09 AM