- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hello,
My question is with regard to using NIOS II Interrupts on a Cyclone IV E board. The NIOS II was designed using the QSYS module within quartus and a VIC was added in order to allow for external hardware interrupts. I then register the interrupt in C-code using the enhanced API. The function then returns a success (0 on success) yet the program does not hand over functionality to the ISR. Here's my registration function: int check = alt_ic_isr_register(ENCODER_INPUT_A_IRQ_INTERRUPT_CONTROLLER_ID , // Encoder A ID from System.h
ENCODER_INPUT_A_IRQ, // Encoder A macro from System.h
nios_isr, // Programmer defined Interrupt service routine (seeabove)
base, // Optional, unused, only concerned about a single hardware interrupt
NULL); // Flag -- Reserved
and my ISR looks like this: void nios_isr(void* context) {
count++;
}
Any suggestions? (Note: base is declared as null.)
Link Copied
2 Replies
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Are you sure the interrupt is actually triggered? The IRQ signal must stay high until the CPU sees it and runs the ISR. Then it should be the ISR that writes something to the component to say it can deassert the IRQ signal again.
Is your count variable defined as volatile? You should do that to prevent the compiler from running some optimisations that could hide the update done by the isr routine.- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Just a question: Is the interrupt signal hanging? You may need to clear the irq source before you leave the isr.
Reply
Topic Options
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page