I had an issue of watchdog timeout caused by time sending chars to RS232 exceeding 18mS with internal osc set to 4MHz
Was using prescaler with timer0, so could not assign to watchdog
I did get round problem by adding clear_wdt();
In PIC_RS232.c as follows:
Code: Select all
void RS232_Delay(char mode)
{
/*Macro_RS232_Delay_Start*/
unsigned int iterations;
unsigned int delay = %m_SW_BAUD;
if (mode)
delay = delay + 1;
clear_wdt();
for (iterations = 0; iterations < delay; iterations++);
/*Macro_RS232_Delay_End*/
}
Not able to test 9600 as that did not work too well without wd and without editing PIC_RS232.c
My suggestion is when auto Clear Watchdog is selected,
CLRWDT is automataly added to RS232 component maco same way as already added to Delay component macro.
Perhaps go one stage further and add to ADC component as well. That way the user does no need to add any clear_wdt(); within C boxes.