Why the encoder counting down?
Posted: Thu Jun 02, 2022 3:12 am
After referring to @dhylands 'example at https://github.com/dhylands/upy-example ... ncoder2.py, I found the prescaler setting does matter and prescaler=0 won't work whatsoever whereas prescaler=1 really works. Why is that?
Additionally, although prescaler=1 makes the encoder mode work, it indeed counts in opposite direction.
For example, if period set to 10000, the counting follows 0->10000->9999->9998 ... ->0->10000->9999, etc.
After trying out all the tweaks that I can imagine, the counting behavior does not change at all?
Is it a bug or something I obviously overlooked?
P.S. I use MicroPython v1.18 on 2022-01-17; PYBv1.1 with STM32F405RG
Additionally, although prescaler=1 makes the encoder mode work, it indeed counts in opposite direction.
For example, if period set to 10000, the counting follows 0->10000->9999->9998 ... ->0->10000->9999, etc.
After trying out all the tweaks that I can imagine, the counting behavior does not change at all?
Is it a bug or something I obviously overlooked?
P.S. I use MicroPython v1.18 on 2022-01-17; PYBv1.1 with STM32F405RG