cancel
Showing results for 
Search instead for 
Did you mean: 

timer adc

bendkhilarwa
Associate III
Posted on March 10, 2016 at 23:11

hello, please I need some help.

I want to measure the frequency of a continuous current motor. then to do this I use an infrared sensor. this sensor is linked to the ADC of the STM. each time the sensor makes a round , the infrared sensor sends a signal to the microcontrollers. so I want to measure the time between two signals arriving at the adc. so how can I use the timer to count this time . 

3 REPLIES 3
Posted on March 11, 2016 at 01:09

Set a timer in maximal mode, and use the Input Capture mode or PWM Input mode to timestamp or time the interval?

Both method have been covered here before.

You don't measure a frequency, but if you configure the timer to count at 1 MHz, you will be able time intervals to 1 microsecond.

You should probably be more specific about what part you are talking about, ST makes hundreds of different parts.

Tips, buy me a coffee, or three.. PayPal Venmo Up vote any posts that you find helpful, it shows what's working..
Posted on March 11, 2016 at 01:11

If you have to read the ADC sample to threshold the signal, you could still use a free running maximal timer to pull time stamps for the ADC EOC, or TIM Trigger of the ADC

Tips, buy me a coffee, or three.. PayPal Venmo Up vote any posts that you find helpful, it shows what's working..
bendkhilarwa
Associate III
Posted on March 11, 2016 at 02:04

my problem is exactly that, I want to measure the time separing two input signals. for example, if I'm using the push button as a signal input, so I want to know the time between the first push and the second one. 

I have done some research about timer, I think that the capture mode, measure the width of the signal