throbscottle
Well-Known Member
First off, Merry Almost-Christmas everybody!
I've got a 16F57 (dinosaur, I know) to accept numbers and functions from a keypad and also read a rotary encoder. It displays the value on a VFD. Mostly works very nicely, but I get this strange behaviour that I can't cause in the simulator.
It has functions to increment or decrement individual digits) or the whole value or display brightness using the arrow keys. The rotary encoder can hijack these functions to perform the same function, only really quickly. A function key sets/clears a flag bit to enable or disable the encoder.
What actually happens is that if the rotary encoder is set to any output other than 00, the program goes into an uncontrolled countdown. When I had it so it wasn't doing this it was madly zipping the cursor across the screen.
It doesn't appear to be related to any noise being picked up, bouncing contacts or anything like that. It looks as if the code is going to an incorrect address, or picking up the wrong variable, but only doing it in the physical PIC, not the simulator. All the bank and page bits are being set correctly as far as I can see.
Anyone seen something like this before? Suggestions (not "get a newer PIC" please!) Please!
Thanks in advance
I've got a 16F57 (dinosaur, I know) to accept numbers and functions from a keypad and also read a rotary encoder. It displays the value on a VFD. Mostly works very nicely, but I get this strange behaviour that I can't cause in the simulator.
It has functions to increment or decrement individual digits) or the whole value or display brightness using the arrow keys. The rotary encoder can hijack these functions to perform the same function, only really quickly. A function key sets/clears a flag bit to enable or disable the encoder.
What actually happens is that if the rotary encoder is set to any output other than 00, the program goes into an uncontrolled countdown. When I had it so it wasn't doing this it was madly zipping the cursor across the screen.
It doesn't appear to be related to any noise being picked up, bouncing contacts or anything like that. It looks as if the code is going to an incorrect address, or picking up the wrong variable, but only doing it in the physical PIC, not the simulator. All the bank and page bits are being set correctly as far as I can see.
Anyone seen something like this before? Suggestions (not "get a newer PIC" please!) Please!
Thanks in advance