Assembly code for a PMS150C to read an incremental encoder using interrupts and a single timer to minimize processor load.
Go to file
2021-03-13 23:16:27 +13:00
.gitignore Shortened ISR for processing of encoder edge to under 25 cycles. 2021-03-13 23:16:27 +13:00
ASM snippets.txt Finished code to control change in encoder values and keep track of min/max, tested working. 2021-03-09 22:29:37 +13:00
Encoder defines.asm Fixed encoder push reads and interrupts from PA.0 2021-03-10 10:32:12 +13:00
Encoder Read ASM.asm Shortened ISR for processing of encoder edge to under 25 cycles. 2021-03-13 23:16:27 +13:00
Encoder Read ASM.PDK Shortened ISR for processing of encoder edge to under 25 cycles. 2021-03-13 23:16:27 +13:00
Encoder Read ASM.PRJ Shortened ISR for processing of encoder edge to under 25 cycles. 2021-03-13 23:16:27 +13:00
README.md Fixed encoder push reads and interrupts from PA.0 2021-03-10 10:32:12 +13:00

Program to read incremental quadrature encoder with Padauk PMS150C or similar.

The idea is to debounce the encoder and not miss any steps without being too intensive or blocking execution of other tasks.

Technique to read encoder outlined (badly) at Technoloblog.com Basically on edge triggered interrupt of a channel, i.e. A, the other channel, B, is used to set a variable, C. This makes the very safe assumption that by the time A changes B will be stable.

If this variable, C, changes then this is seen as the edge of A and used to count up or down.

If there is any bounce then C will not change as B will not yet have changed, in this way bouce will be ignored.

This should only take a few cycles inside the ISR and leave the processor free to do other tasks such as tracking button presses, setting interrupt line, sending/receiving I2C etc.

Desired features: 16 bit signed count - Done Count min and max - Done Track number of button presses Output PWM on one pin as set by I2C - For testing use low bits of counter?