- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I have added a component CAN controller into SOPC builder, and it work well. I can send and receive data correctly. But i can't register the interrupt(IRQ) send out from the controller. I checked anything i know....
Here is my code, it can be compiled and no errors, but just die in the alt_irq_register function. Anybody have experience to use CAN controller in SOPC builder can tell me where is the problem? static void handle_CAN2_interrupts(void* context, alt_u32 id) { int q; q =IORD(CAN2_BASE, 0x4); printf(" interupt = %d \n",q); } int main() { printf("Hello from Nios II!\n"); alt_irq_register(CAN2_IRQ,NULL, handle_CAN2_interrupts ); tx_basic_frame(); } i use quartus 8.0 and NIOS ii 7.2 to do thisLink Copied
3 Replies
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
also i test to use the timer interrupt, and it worked fine. i can't figure why me controller can't even register irq...
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I don't know your CAN controller, but I guess you probably need to clear the irq inside the handler function, otherwise the irq would continuously retrigger just after you have serviced it.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
--- Quote Start --- I don't know your CAN controller, but I guess you probably need to clear the irq inside the handler function, otherwise the irq would continuously retrigger just after you have serviced it. --- Quote End --- Thanks for your advise, i find my controller send a unexpected interrupt after reset, and it cause the retrigger problem you said.

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