Email: Password: Remember Me | Create Account (Free)

Back to Subject List

Old thread has been locked -- no new posts accepted in this thread
???
04/14/06 14:20
Read: times


 
#114303 - I need help
Responding to: ???'s previous message
Erik I am trying the WDT with the EMP900. My settings for in the "options for target" window are
"Enable LED Driver" and WDTE "Watchdog Timer Enable".
Every time the program executes until the first WDT_Feed(); it resets. If I "uncheck" WDTE "Watchdog Timer Enable" from the options for target box the WDT never underflows even if I do not feed it. So I think it is not working properly.
Erik could you test this code?
Thank you very much!
UCFG1 = 0xE3;
void Main(void)
{
	TRIM |= 0x80;
	P0 = 0x00;				
        P1 = 0x00;						
	P2 = 0x00;						
	P3 = 0x00;					
        init();							
	brkrst_init();						
	state = 0;
	

	c_counter();	// Timer
	//WDT_Light =1;
	Initialize_the_Puppy();
	WDT_Feed();  // resets when it gets here!!!			
	while(1)
	{
	state = 0x5A;	  
	if ((state+= 0x11) == 0x6B) 
		{	
			WDT_Feed();
			if (RSTSRC &= 0x04)
				{
				WDT_Light = 1;
				RSTSRC &= ~0x04;
				}
						
			state = 0x00;
		}
	}
}

void Initialize_the_Puppy(void)
{
EA = 0;
WDCON |= 0xE5; 	
WDL = 0xFF;
KICK_THE_PUPPY;
EA = 1;
}

void WDT_Feed (void)
{
EA = 0;
KICK_THE_PUPPY;
EA = 1;	
}




List of 6 messages in thread
TopicAuthorDate
Effective way to test WDT            01/01/70 00:00      
   more similar to a hardware reset, all SF            01/01/70 00:00      
      reset output            01/01/70 00:00      
         worth a look            01/01/70 00:00      
      I need help            01/01/70 00:00      
         no emulation of watchdog            01/01/70 00:00      

Back to Subject List