cancel
Showing results for 
Search instead for 
Did you mean: 

Encoder mode - Prescaler or external trigger filter

maxime2
Associate
Posted on August 21, 2014 at 14:46

Hi everyone,

I've been working on the STM32F4 and I would like to count pulses from some odometer.

There are two types of odometer, the ones that output two signal in quadrature and the other that output pulse on a signal and a level for the direction (high for forward & low for backward).

I would like to process these 2 types of odometers the same way and that would be possible if the encoder mode of the timers would let me count only on one type of edge (either rising or falling). But it seems that encoder mode always counts rising & falling.

So I tried to use IC-prescaler and had no chance with it.

And even External Trigger Filter does not seem to work. That would have been perfect according to the documentation ''The digital filter is made of an event counter in which N events are needed to validate a transition on the output'', requiring 2 events to count 1.

Does anyone have an idea ? Otherwise, I would be forced to use interrupts to count pulses and that would take to much CPU time.
1 REPLY 1
Posted on August 21, 2014 at 19:11

Pretty sure there are Encoder Modes which don't trigger on both rising/falling edges.

The Input Prescaler is going to be useless, as it has no inferred direction.
Tips, buy me a coffee, or three.. PayPal Venmo Up vote any posts that you find helpful, it shows what's working..