Quadrature Decoder as pulse counter?

⚠️
Hi there.. thanks for coming to the forums. Exciting news! we’re now in the process of moving to our new forum platform that will offer better functionality and is contained within the main Dialog website. All posts and accounts have been migrated. We’re now accepting traffic on the new forum only - please POST any new threads at//www.wsdof.com/support. We’ll be fixing bugs / optimising the searching and tagging over the coming days.
4 posts / 0 new
Last post
Max44
Offline
Last seen:9 months 3 weeks ago
加入:2016-02-0815:58
Quadrature Decoder as pulse counter?

Hello Dialog Support,

I have an application that needs to implement a pulse counter on an input from a sensor. I saw that the question of possibly using the quadrature decoder for this came up in the forum a while ago but it wasn't answered. Could the quadrature decoder be used to count low frequency pulses? The plan would be to poll periodically to calculate event rates reported by the sensor.

If this is possible, are the quadrature decoder counters running in extended sleep mode? We'd like to perform this function without a GPIO interrupt for each pulse that would require the system to be awake to count pulses..

谢谢你,马克斯

Device:
MT_dialog
Offline
Last seen:2 months 3 weeks ago
工作人员
加入:2015-06-08 11:34
Hi Max44,

Hi Max44,

This kind of usage is never tried or tested, but theoretically yes, with the quadrature decoder you can measure external pulses, if you provide only one line with a pulse to the module and ignore the quad counter itself, you can use the interrupt that will be triggered in each transition of the signal and count the pulses via incrementing a variable (counter), so the pulses that you will get will be the value of the counter divided by 2.

Thanks MT_dialog

Max44
Offline
Last seen:9 months 3 weeks ago
加入:2016-02-0815:58
Thanks MT,

Thanks MT,

I was hoping to used the quad counters somehow,. Looking at the transitions doesn't sound much more useful than a GPIO interrupt. I might experiment with the quadrature decoder if time permits and see if I can use the quad counters, but it doesn't look very promising.

Max

MT_dialog
Offline
Last seen:2 months 3 weeks ago
工作人员
加入:2015-06-08 11:34
Hi Max,

Hi Max,

As mentioned the quad decoder isn't designed for that use case, and as far as i can tell only the interrupt will be in some use in order to drive one channel of the decoder, if you would like to experiment with the module itself and actually use the decoder counter you will have to provide two pulses on each channel with 90 degrees phase shift in order for the quad to count as it should.

Thanks MT_dialog