- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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?
Link Copied
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Maybe you have to set a start bit on the timer register
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I have no idea what that means! Is there like something that I can read?
If it works with the monitor program, why does it not work with the SBT?- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Cool. So this means I need to add the Interval Timer core through Qsys, without which the timers in the code won't work?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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?- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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?- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
MrPsyclus...Do you know what I should look into for the interrupts to work??
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I think you can use this, change the defines for the ones you have on your system.h
alt_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.
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page