AnsweredAssumed Answered

S08RN4 reset after 9.18 msec why?

Question asked by Robin S on Nov 5, 2013
Latest reply on Nov 5, 2013 by iansmusical

Hello,

 

I am switching On and OFF LED'S with Delay's.i am not getting why my controller is reseeting after every 9.18 msec.

 

here is my code

 

i am using Default internal clock and WDT is switched OFF

 

   void main(void)

   

{
  

 

      WDOG_CNT = 0xC520;    // write the 1st unlock word
      WDOG_CNT = 0xD928;
      WDOG_CS1 = 0x00;    // Disable WDT Timer    
 
     
       PORT_PTAOE =   0x0F; // Define PortA all Pin As output 
       PORT_PTBOE =   0xFF;
     
       PORT_PTAD =  0x00;  // Initialise the PORTA
       PORT_PTBD =  0x00;    // Initialise The PORTB
     

 

 
       while(1){
       

 

  
      PORT_PTAD =  0x0F;     //  Initialise the PORTA
      PORT_PTBD  = 0xFF;
      Delay();
   
      PORT_PTAD  = 0x00;     //  Initialise the PORTA
      PORT_PTBD  = 0x00;
      Delay();
     
       }
  }

 

void Delay ()

 

           {

 

          unsigned int i;
          for (i=0;i<2500;i++)
         
          {
          ;
          }
         
         
          

Outcomes