Forum Discussion

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

Generate IRQ by Level

Hi all,

I have the following configuration with the following problem. In Qsys i have a 1 bit Input (INPUTPIO) which should generate an Interrupt by Level.

This is my C code:

static void isr_signal(void *context) {
alt_u8 *temp= (alt_u8 *) context;
*temp= IORD_ALTERA_AVALON_PIO_DATA(INPUTPIO_BASE);}
alt_ic_isr_register(INPUTPIO_IRQ_INTERRUPT_CONTROLLER_ID,INPUTPIO_IRQ,isr_signal,(void *)&adress, 0x0);
IOWR_ALTERA_AVALON_PIO_IRQ_MASK(INPUTPIO_BASE, 0x1);

With this code I get stuck and the Debugger goes into alt_irq_entry() alt_exception_entry and thats all. I am grateful for any help.

1 Reply

  • Altera_Forum's avatar
    Altera_Forum
    Icon for Honored Contributor rankHonored Contributor

    Your irq handler, I mean isr_signal(), must provide some mean of resetting the interrupt signal level, otherwise the irq would keep on retriggering.

    Then, your program would get stuck into isr_signal function as long as the PIO input is asserted.

    Moreover, check if 'adress' is a valid pointer.