Sorry I realise I have just asked a question hundreds have asked before! I will search and think before I ask again!!
Storic
Joined: 03 Dec 2005 Posts: 182 Location: Australia SA
Posted: Sun Feb 19, 2006 5:16 pm
Here is a code I use for the WDT
Code:
#int_RTCC
RTCC_isr()
{
if (++CPUled > 240) { // Increment value of cnt on every interrupt
output_toggle(CPU_led);
CPUled = 0;
// restart_wdt(); // original location for WDT int fault
}
restart_wdt(); // new location
}
I reset my WDT in timer 0 interrupt with my CPU led, I use to reset with the CPU led toggle however I had intermitent WDT reset, for some reason after the led toggle it would not reset the WDT. It did not happen all the time, it was only with some boards, same program and same board layout. I now reset every Timer 0 interupt, not every CPU led toggle (240 T0int)
ANdrew _________________ What has been learnt if you make the same mistake?
All times are GMT - 6 Hours Goto page Previous1, 2, 3
Page 3 of 3
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum