Anderson_87
New Member
Hi,
I would like to know about the watchdog Timer.
I am working on CCS compiler and i want to know at what time the reset occurs. My code is
#include <16F877A.h>
#fuses WDT,XT
int8 i,j;
void main()
{
TRISA=0x00;
TRISB=0x00;
TRISC=0x00;
TRISD=0x00;
TRISE=0x00;
PORTA=0x00;
PORTB=0x00;
PORTC=0x00;
PORTD=0x00;
PORTE=0x00;
OPTION_REG=0X88;
INTCON=0XE0;
T0IE=1;
switch(restart_cause())
{
case WDT_TIMEOUT:
lcd_putc("\fwatch timeout");
break;
case NORMAL_POWER_UP:
lcd_putc("\fnormal time out");
break;
}
setup_wdt(WDT_2304MS);
while(true)
{
lcd_putc("\fnormal operation");
while(1);
}
}
I would like to know about the watchdog Timer.
I am working on CCS compiler and i want to know at what time the reset occurs. My code is
#include <16F877A.h>
#fuses WDT,XT
int8 i,j;
void main()
{
TRISA=0x00;
TRISB=0x00;
TRISC=0x00;
TRISD=0x00;
TRISE=0x00;
PORTA=0x00;
PORTB=0x00;
PORTC=0x00;
PORTD=0x00;
PORTE=0x00;
OPTION_REG=0X88;
INTCON=0XE0;
T0IE=1;
switch(restart_cause())
{
case WDT_TIMEOUT:
lcd_putc("\fwatch timeout");
break;
case NORMAL_POWER_UP:
lcd_putc("\fnormal time out");
break;
}
setup_wdt(WDT_2304MS);
while(true)
{
lcd_putc("\fnormal operation");
while(1);
}
}