|
||
---|---|---|
.gitignore | ||
ASM snippets.txt | ||
Encoder defines.asm | ||
Encoder Read ASM.asm | ||
Encoder Read ASM.PDK | ||
Encoder Read ASM.PRJ | ||
README.md |
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?