We are running a survey to help us improve the experience for all of our members. If you see the survey appear, please take the time to tell us about your experience if you can.
Hi. I'm doing my thesis on 8051 and i'm programming interrupt routines in Keil C and simulate them. But I can't use variables inside interrupt routines because they generate unpredictable effects on simulations. Does anybody can help me please?
Now I have also noticed that only Port 1 can be used in the interrupt routine. The other three ports generate several problems. The simulation doesn't represent the program.
Uhhh, are you using an 8051 with an external data/address bus that is driven by P0 and P2? If so, you can't use P0 and P2 for general purpose I/O. Since the serial port and RD/WR pins are provided on P3, you can't modify P3 the way you modify P1. Since I don't really have details of the device or hardware you are using and since I really don't know what a Modeltech is, it's impossible for me to help you. If you're using the Keil tools, tho, why don't you use the simulator in uVision2? Jon
This could be an exmplanation for ports but what is strange is that also register as Accumulator and so on cannot be used inside an interrupt routine: using them make simulation non corresponding to reality. Beside of this I can't use variables inside interrupt routines. Can you help me please?
Sounds like it's time to contact technical support. The things you are having trouble with are very basic. And, no one else seems to have trouble with them. Jon
Have you tried it in the Keil uVision simulator?