Forum Discussion

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

DE1 Basic Computer on Nios II SBT

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?

8 Replies

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

    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?
  • Altera_Forum's avatar
    Altera_Forum
    Icon for Honored Contributor rankHonored Contributor

    Cool. So this means I need to add the Interval Timer core through Qsys, without which the timers in the code won't work?

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

    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?
  • Altera_Forum's avatar
    Altera_Forum
    Icon for Honored Contributor rankHonored Contributor

    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?
  • Altera_Forum's avatar
    Altera_Forum
    Icon for Honored Contributor rankHonored Contributor

    MrPsyclus...Do you know what I should look into for the interrupts to work??

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

    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.