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.
I am using one of the 8051 external capture ports to generate an interrupt. My code enters and returns from the ISR just fine until I add a line to toggle an unused external port pin. For some reason, it just stops working when that line is in, but when I comment it out, it works fine. Anybody ever encounter similar problems, or have any ideas?
Make sure your code contains a read-modify-write instruction (CPL Px.y,CLR Px.y, SETB Px.y, ANL, ORL, XRL) to toggle your port bit. These instructions read the port latch rather than the logic level of the pin. Other instructions could cause the controller to switch your interrupt input to be an output which would than be stuck at 0. HHK