Forum Discussion

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

Program reset

Hello!

I have the following problem. I created simple project by Quartus|| 4.1. And write primitive program in Nios || IDE:

int main()
{
 int i=0;
 while(1)
 {
   if (i==0) 
      IOWR_ALTERA_AVALON_PIO_DATA ( PIODIOD_BASE, 1);    
   else  if (i==10000) 
      IOWR_ALTERA_AVALON_PIO_DATA ( PIODIOD_BASE, 0);    
   i++;
   if (i==20000) i=0;    
 } 
 return 0;
}

Then I compiled all project and create *.sof file.

Then I download this *.sof file to real deivece and I saw the next picture: my program works during 13 s, then 13 s of reset and again. I didn't do the program reset.

How can I resolve this problem?

Thank you.

3 Replies

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

    Hi,

    What do you exactly mean with 'reset' ?

    How many pulses do you see on the led? (1 a few or many?)

    How do you detect this?

    Is it restarting automatically or do you have to download again?

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

    I don't think it's your code doing this because I see nothing wrong with it. You don't happen to have a watchdog in your system by any chance do you (then this would actually make sense).

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

    Check to see in Quartus if your cpu reset pin is connected preperly and that it has the correct pin assignement. Maybe you haven't put a pin asignement on the reset pin so the P&R has assigned the reset pin to a random pin that happens to toggle periodically.