87C51RA+ Trying to use P3.3/INT1 as an input. I set EX1 = 0; at the beginning of main(), which should disable INT1. EX1 is not referenced again, and remains =0. Whenever I pull the P3.3/INT1 pin low, the program slows down to a crawl . . . when I let the pin go high, the program picks back up to normal speed. Here is one place that I am seeing it happen: while (sec < MSEC_100 * 2) { kick_dog(); } void kick_dog() { EA = 0; CCAP4L = 0X00; CCAP4H = CH; EA = 1; } As you can see, global enable is used to toggle interrupts on and off. My impression is that the EX1=0; instruction should keep the INT1 disabled whether the EA global bit is subsequently toggled or not, but all that I can figure is that the interrupt IS active and causing the slowdown. EX1 and EA are defined in #include <reg51f.h> What am I missing here? Thanks, Scott Kelley
EX1 is not referenced again, and remains =0. I see no problem in what you describe. Is the above statement as seen in an emulator/simulator or the result of a global search for EX1 or "I know"? Create an ISR (just a dummy nop, nop, reti) and set a breakpoint there. Then pull p3.3 low before you start and hold it low. The breakpoint will occur immediately after the offending enable and single stepping will get you to the instruction following the enable. Eureka. Erik
Thanks for the help - everything kept coming up negative. Finally found it. Nothing to do with the interrupt. The port bit was assigned to two separate variables, and the second was being used in the clock initialization. So the clock was running in the wrong mode when this port pin was held low. Thanks for the help.