Nios® V/II Embedded Design Suite (EDS)
Support for Embedded Development Tools, Processors (SoCs and Nios® V/II processor), Embedded Development Suites (EDSs), Boot and Configuration, Operating Systems, C and C++
Announcements
FPGA community forums and blogs on community.intel.com are migrating to the new Altera Community and are read-only. For urgent support needs during this transition, please visit the FPGA Design Resources page or contact an Altera Authorized Distributor.
12748 Discussions

NIOS II Problem with Interrupt Timer

Altera_Forum
Honored Contributor II
2,156 Views

I'm using the Cyclone II Development Kit. Using SOPC builder I added a timer to the NIOS2 in "standard" project. I configured the timer to be an Interrupt timer with a period of 500 microseconds. I assigned the it an IRQ of 7 and a slave address immediately following the periphal address of the previous element (0x022208C0). I generated a new processor and then compiled it in Quartus II. In the software I wrote and interrupt function, installed it, and enabled it. I read the status and control registers of the timer and confirmed that the timer is running, it times out, and the interrupt enable bit is high; but alas the interrupt code never gets called. What am I doing wrong?? Any hints or comments would be greatly appreciated.

0 Kudos
3 Replies
Altera_Forum
Honored Contributor II
1,222 Views

I used something like  

 

 /* set to free running mode */  IOWR_ALTERA_AVALON_TIMER_CONTROL (HIGH_RES_TIMER_BASE,            ALTERA_AVALON_TIMER_CONTROL_ITO_MSK  |            ALTERA_AVALON_TIMER_CONTROL_CONT_MSK |            ALTERA_AVALON_TIMER_CONTROL_START_MSK);  /* register the interrupt handler, and enable the interrupt */      alt_irq_register (HIGH_RES_TIMER_IRQ, NULL, handle_timer_interrupt);     

 

to program the highres timer in the standard example... It worked for me. 

 

Paolo
0 Kudos
Altera_Forum
Honored Contributor II
1,222 Views

 

--- Quote Start ---  

originally posted by paolo.gai@Mar 20 2006, 11:47 AM 

i used something like  

 

 /* set to free running mode */  iowr_altera_avalon_timer_control (high_res_timer_base,            altera_avalon_timer_control_ito_msk  |            altera_avalon_timer_control_cont_msk |            altera_avalon_timer_control_start_msk);  /* register the interrupt handler, and enable the interrupt */      alt_irq_register (high_res_timer_irq, null, handle_timer_interrupt);     

 

to program the highres timer in the standard example... it worked for me. 

 

paolo 

<div align='right'><{post_snapback}> (index.php?act=findpost&pid=13611)</div> 

--- Quote End ---  

0 Kudos
Altera_Forum
Honored Contributor II
1,222 Views

 

--- Quote Start ---  

originally posted by dough1a+mar 20 2006, 01:38 pm--><div class='quotetop'>quote (dough1a @ mar 20 2006, 01:38 pm)</div> 

--- quote start ---  

<!--quotebegin-paolo.gai@Mar 20 2006, 11:47 AM 

i used something like  

 

 /* set to free running mode */  iowr_altera_avalon_timer_control (high_res_timer_base,            altera_avalon_timer_control_ito_msk  |            altera_avalon_timer_control_cont_msk |            altera_avalon_timer_control_start_msk);  /* register the interrupt handler, and enable the interrupt */      alt_irq_register (high_res_timer_irq, null, handle_timer_interrupt);     

 

to program the highres timer in the standard example... it worked for me. 

 

paolo 

<div align='right'><{post_snapback}> (index.php?act=findpost&pid=13611)</div> 

--- Quote End ---  

 

<div align='right'><{post_snapback}> (index.php?act=findpost&pid=13614)</div> 

[/b] 

--- Quote End ---  

 

 

Thanks. I used the same code for the highres timer and it worked fine; but when I add an additional timer with the same attributes as the highres timer I can&#39;t seem to get the interrupt to be generated. 

 

Doug
0 Kudos
Reply