Author Topic: STM32 ADC Time Conversion  (Read 10598 times)

Offline waldillo

  • Newbie
  • *
  • Posts: 1
    • View Profile
STM32 ADC Time Conversion
« on: September 17, 2010, 09:00:15 AM »
Hello guys:

I´m programming the STM32f103ve, and I´m trying to achive the following target:

1.- Configure the ADC to be triggered every 50uS (20Khz) by TIM1. The code hasn´t need to enter in TIM1 IRQ to do it.
2.- Convert its channel voltage.
3.- Enter in the ADC IRQ to get the measured value digital.

I´ve achived it correctly. Then I tried to get the TIME CONVERSION. It´s so important to me to measure this time. I´ve configured the ADC to work with an 1uS time conversion.

ADC:14MHz ---> 12,5 cycles(succesives aproximations)+1,5cycles(Stabilization time) =14 cycles*1/14MHz= 1uS
Sysclk= 56MHz
TIM1 trigger = 20KHz

The only thing I´ve to do is enter in the ADC IRQ to get the converted value(ok), but to achive my target(see the ADC time conversion [1uS]), I´ve think to use the TIM1 IRQ to toggle a pin in it. I think when it overflows, the ADC starts, so if I toggle a pin in it, and toggle again in the ADC i would get TIME conversion 1uS but I´ve got 1,3uS.

1.- ¿What am i doing wrong?
2.- Somebody told me to use systick timer but I don´t know how must it help me. Anyone know something about it?