38 Like 0 Dislike
I used STM32F103C8T6 blue pill board for test ADC. Here I used 3 channel of ADC1 to read analogue value. *Target is to set ADC channel 0 and channel 1 frequency of conversion to 176k and 142k samples/second respectively. Fsrate1 = 176k Fsrate2 = 142k Ts = sampling time in cycles Fadc= 12Mhz as configured in clock settings(Max 14Mhz) Ttotalrate = total conversion time in ADC clock cycles Tconv = constant equal to 12.5 cycles channel 0 : Ts = (Fadc / Fsrate1) - 12 Ts = (12M / 176k) -12 = 55.68181818 nearest possible value = 55.5 channel 1: Ts = (Fadc / Fsrate2) - 12 Ts = (12M / 142k) -12 = 72.00704225 nearest possible value 71.5 As you want to use large sampling frequency go with less sampling cycles. example of Dual slow interleaved mode ADC is given as refere page no 12 http://www.st.com/content/ccc/resource/technical/document/application_note/c4/63/a9/f4/ae/f2/48/5d/CD00258017.pdf/files/CD00258017.pdf/jcr:content/translations/en.CD00258017.pdf
This tutorial shows how to implement ADC single conversion mode using three different programming levels: 1. CubeMX + HAL libraries [0 to 6 mins]. 2. HAL libraries only [6 to 19 mins]. 3. Register level programming [19 to 25 mins].
This video shows how to implement ADC in Continuous mode using CubeMX.
In this video, I have demonstrated how to create a simple project in CubeMX for an ADC application with multiple input channels, both internal and external one. First, we're gonna measure the chip temperature using internal temperature sensor of the STM32F0 chip. We also use the Vdd voltage that we got from previous video for our calculation. Then, an analog signal from a potential meter is measured using an ADC external input channel. The conversion result was more than I expected although there was no filtering algorithm applied. The detailed explanation will be updated at: https://letanphuc.net/2016/07/stm32f0-adc/
This video shows you how to implement ADC with a Timer Trigger:
1. Using CubeMX.
2. HAL Libraries (No Cube).