Forum Discussion

Altera_Forum's avatar
Altera_Forum
Icon for Honored Contributor rankHonored Contributor
16 years ago

Interrupt handling

Hello guys, I got problems with my interrupt routines. One routine is for uart whitch means if a character comes in it'll be stored in a buffer array, the other one is for simple timer ticks.

I wrote following for enabling the interrupts:

alt_irq_enable (SYS_TIMER1_IRQ);

alt_irq_enable (UART_IRQ);

Next, I wrote the request routines:

alt_irq_register (SYS_TIMER1_IRQ, pWORKINGVAR, ServiceRoutineTIMER);

alt_irq_register (UART_IRQ, pWORKINGVAR, ServiceRoutineUART);

When I debug my code I be able to see the STATUS register whitch holds the value 0x1 (Interrupts enabled) and the IENABLE register whitch holds the value 0x6 (2 for uart and 1 for timer).

I think both are corrcet... Can you check my code about errors, do I need additional code for enabling interrupts ??? How can I proof that an interrupt occured ??? (register ect.)

Thank's for helping...

Maestro

11 Replies