cancel
Showing results for 
Search instead for 
Did you mean: 

Reading ADC after exactly 1.56 us

sanjib
Associate III
Posted on January 09, 2014 at 13:20

The original post was too long to process during our migration. Please click on the attachment to read the original post.
21 REPLIES 21
Posted on January 14, 2014 at 04:24

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 MHz

Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..
sanjib
Associate III
Posted on January 14, 2014 at 05:11

sanjib
Associate III
Posted on January 14, 2014 at 07:49

sanjib
Associate III
Posted on January 14, 2014 at 09:00

Posted on January 14, 2014 at 15:43

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=0680X000006I6ZS&d=%2Fa%2F0X0000000bqw%2FwRNsjSkMeN_x4TodhxSnEGE.9981yBSc295kqhq6vXg&asPdf=false
Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..
raptorhal2
Lead
Posted on January 14, 2014 at 16:59

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, Hal

sanjib
Associate III
Posted on January 15, 2014 at 04:31

Posted on January 15, 2014 at 04:46

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.
Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..
sanjib
Associate III
Posted on January 17, 2014 at 12:44

sanjib
Associate III
Posted on January 18, 2014 at 09:09