2014-06-09 03:33 PM
Can you use a single timer to make a quadrature divider? What I mean by this is can you take in a quadrature signal, have the timer increase its CNT register and then toggle channels 3 & 4 based upon a particular CNT value?
This would require channels 1&2 acting as quadrature inputs and channels 3&4 acting as toggling outputs. If this is not possible, can you tell me why? My initial attempts at this failed, so I am trying to figure out if there is something about the peripheral that causes this to not be possible.Thanks in advance, #stm32f4 #toggling #quadrature #qei2014-06-09 03:50 PM
I would think that output compare and toggle modes would be viable on Ch 3 and 4, but honestly not something I've had cause to try.
2014-06-10 06:59 AM
In encoder mode the counter runs in both directions, depending on quadrature phase. Then there's the edge jitter problem where the low bit of the counter oscillates if the encoder stops on an edge. I imagine the output of a divider would have a strange waveform.
I can see where an encoder clock divider could be used as some form of tachometer output. I use channel 3 on an encoder timer to capture the index pulse so no particular reason why you can't configure the extra channels for output. Jack Peacock2014-06-11 09:42 AM
Assuming a perfect input, I have tested that this does work.
A jittery input would indeed cause problems with this method. Any ideas on how to deal with this?