You have limited time to work with the hardware and you don't have time to even compile the code to see if there are any syntax errors and you want us to check for it you. Is that it? OK, here are a couple of things I noticed:
CounterCC is declared as a BYTE but you're trying to squeeze a value of 500 into it.
There are no colons after LABELS.
There are no % signs where your expressing your numbers in binary.
You're reading the state of the IO pins into NewVAL but you're using CurVal in the BRANCH statement.
Provided the decoding logic is correct (which I haven't checked) it's not going to keep up with a turning encoder since all the SEROUT statements will take tens or even hundreds of ms each time - that may not matter, I don't know - just pointing it out.
When posting code in the forum, please use code-tags.
/Henrik.
Bookmarks