AceOfHearts
New Member
Hi,
Basically, I am creating a remote control interface for my robot. I am trying to get the serial interrupt to work. In the code below, Keypad uC system (now simulated by PC) sends 0 in binary when the turn right key is pressed on the remote control, 9 is sent for turn left key.
The robot program should be haulted when a serial byte comes in, and checks to see what value it receives, and jumps to turn right, left etc. appropriately depending on what the received byte is.
Though my code compiles, it does not work when I download it onto the 8051 on my robot. When I run it for the first time on the 8051, upon the first byte input, the uC simply goes back to the top of the program and starts again (like I have reset it). Any subsequent presses on any key makes no affect on the robot, it just functions normally ignoring all serial data input.
Here is the code:
**broken link removed**
Note: comment reads 'interrupt service routine' next to ORG 23H at the beginning of the code. Thats obviously not the ISR, it's at the bottom (just not to confuse beginners reading). Also, 'now clear it' in comment next to CLR RI
Looking forward to any help anyone has to offer.
Thanks for reading.
Basically, I am creating a remote control interface for my robot. I am trying to get the serial interrupt to work. In the code below, Keypad uC system (now simulated by PC) sends 0 in binary when the turn right key is pressed on the remote control, 9 is sent for turn left key.
The robot program should be haulted when a serial byte comes in, and checks to see what value it receives, and jumps to turn right, left etc. appropriately depending on what the received byte is.
Though my code compiles, it does not work when I download it onto the 8051 on my robot. When I run it for the first time on the 8051, upon the first byte input, the uC simply goes back to the top of the program and starts again (like I have reset it). Any subsequent presses on any key makes no affect on the robot, it just functions normally ignoring all serial data input.
Here is the code:
**broken link removed**
Note: comment reads 'interrupt service routine' next to ORG 23H at the beginning of the code. Thats obviously not the ISR, it's at the bottom (just not to confuse beginners reading). Also, 'now clear it' in comment next to CLR RI
Looking forward to any help anyone has to offer.
Thanks for reading.
Last edited: