Hello, I have a very simple program to see how interrupts function. I load the timer 6, when it expires the program jumps to vector 98h where the address of the ISR of timer 6 is and then jumps to the interruption routine, as I understand the interruption must function. But I observe that the ISR is executed two times instead of one. When I use the debugger and the Interrupt System windows, I observe the following scheme: 1) the interruption for timer 6 is enabled 2) when the timer expires, the program jumps to the vector 98h, at this moment the request of interruption for timer 6 is at 0. Then the program jumps to the address of the timer 6 ISR. In this jump, the request is put to 1. 3) the ISR is executed and the timer is stopped. But as the request of interruption is at 1, the program jumps again to 98h and this is when the request is cleared. But obviously the program jumps again to the ISR. Is this the normal way for executing an interruption? I understand that normally when the timer expires, the request pass to 1 and when the program jumps to the interruption vector is when the request is cleared, and then the ISR is executed only one time. What happens? why I need two loops to clear the interruption. If someone could help me, it would be great. Thanks Carmen PS: I am using the evaluation board EASY UTAH with uVision 2.36
That explains everything, doesn't it? The timer counts down, reaches 0, generates an interrupt, gets reloaded with 1, reaches 0 again in less that a microsecond and so on. The interrupt is triggered far too frequently than you expected. - mike