Hi everyone! I am a beginner with the Cyclone II board. Just got it last week. I tried to implement the DE1 Basic Computer project with the Altera Monitor Program and it works absolutely fine I wanted to implement the same with the Nios II SBT for Eclipse. The project builds and runs but only the Reset button, Red LEDs and the corresponding switches work. The 7 Segment Display and the Green LEDs do not work. On debugging I find that the "8 Second Timer" is never incremented. Is there something wrong with the interrupt and exception handling? Any suggestions?
Take a look at the Interval Timer Core Docs at the following link page 251.When you look at the registers there's the START and STOP bits, my guess is that you have to write the start bit, this way the timer will increment. http://www.altera.com/literature/ug/ug_embedded_ip.pdf
Well, if the code compiles you might have 2 things to look at:1. You don't have the code for the timer, and so you don't have the Interval Timer Core in Qsys 2. You have both but the interrupt is not working properly. Maybe I got what you want to do, you want to increment a seconds variable with the timer interrupt?
Yeah! I have both. The interval timer core is there and I also have a working code for the timer (I know this because it works absolutely fine with the Monitor Program).The interrupt I believe is not working properly. It never hits breakpoints inside the interrupt block when I debug. So how do I get this interrupt to work?
I think you can use this, change the defines for the ones you have on your system.halt_ic_isr_register(SYS_TIMER_IRQ_INTERRUPT_CONTROLLER_ID,SYS_TIMER_IRQ,ms_clock_isr, NULL, 0x0); alt_ic_irq_enable(SYS_TIMER_IRQ_INTERRUPT_CONTROLLER_ID,SYS_TIMER_IRQ); ms_clock_isr is the function that treat the interrupt. Don't forget you have to clean the interrupt flag when you finish.