Forum Discussion
Altera_Forum
Honored Contributor
13 years agothank you jacklsw86 for your hint!
in general I have to use interrupts in my code, but here are my observations first: - when I disable all interrupts (via the PIE bit in the ctl0 register), my program executes - when I mask IRQ 2 via the ctl3 register, my program executes - when I check for pending==0 in the interrupt handler, my program executes IRQ2 is assigned to one of my timers. The timer creates interrupts via IRQ2 and as such, the pending register has to hold the value 4. This happens a few times and the interrupt handler finishes its execution as expected. But after a while (< 1s), the interrupt handler is called again and pending register holds the value 0 (this only happens, if IRQ2 is unmasked). How can a value of 0 be possible for the pending register? Why does disabling the timer IRQ solve my problem (as it executes fine a few times with pending set to 4)?