lets have a word var count and a word var pos
count is the one used in your isr , pos will be the " current " position outside the isr
we have a sub to get pos
getpos:
@ INT_DISABLE INT_INT
POS= COUNT
@ INT_ENABLE INT_INT
RETURN
now whenever you wish to use pos just call getpos first to "refresh" its value
some more thoughts
1 are your encoders mechanically switched ( ie contact bounce could be an issue)
2 isr's should be kept as short a possible , lcd routines in isr may cause unexpected issues
3 have you tesed with only one encoder is connected ?
4 have you a schematic of your setup and a link to the positioner encoder data sheet
Bookmarks