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..
谢谢你,马克斯
Keywords:
Device:
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
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
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