Altera_Forum
Honored Contributor
19 years agoLevel Triggered Interrupt Crash
Hi all,
I've run into a strange problem as of late regarding my ISRs. I am using level triggered interrupts to determine when an incremental encoder reaches it's zero index mark. Edge triggered interrupts don't work because they give erratic results (effectively noise - which is strange in itself). Now, here is my problem: When I run my code, everything works fine until the 'zero-index' interrupt is triggered; at which point my software crashes and I need to re-download my code. After some troubleshooting, I have established that the ISR is never entered and the crash happens when the interrupt is triggered. Here is the strange part: When I make a superficial (add arbitrary variable assignment or anything) change in my ISR routine and download the newly compiled code, the ISR is entered correctly and my code works perfectly ONCE. If I try to re-download the same code, the original crashing sequence occurs. This cycle happens independant of whether I have reset the CPU or not. And the worst part is that the zero index interrupt did work in the past (so I am initializing it correctly). As far as the work being done in the ISR, all I really do is set a flag and then set that interrupt-mask to 0 (the only way I know how to reset the level triggered interrupt). All my edge triggered interrupts are working fine and I have very little experience with the level triggered, so I would appreciate any help I could get... And question me if my explanation seems convoluted. Thanks.