Forum Discussion

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

Using 2 timers ?

We are trying to use 2 interval timer (200ms and 500ms) on a nios 2 processor. One is configure as a system clock timer and its work fine., but the second don’t work.

The declaration on the nios is (for the two interval timer) :

alt_irq_enable(TIMER_500M_IRQ

IOWR(TIMER_500M_IRQ, 1, 3);

alt_irq_register( TIMER_500M_IRQ, null, TIMER500M_IRQ);

The interrupt function look like that :

static void TIMER500M_IRQ(void* context, alt_u32 id)

{

IOWR(TIMER_500M_BASE, 0, 0);

//code

}

Does anyone have a solution a this problem ?

Thanks in advance.

12 Replies