Join our technical discussions about Freescale Microcontrollers: M68HC12. (Freescale Semiconductor is a Subsidiary of Motorola).
HCS12 Watchdog...Reset - folg...@yahoo.com - Jan 14 8:21:30 2009
Hello,
I need for my programm a reset-function. I want to call a function ResetApplication().
Then I want to use the watchdog to reset the application.
I do not know how to use the watchdog exactly.
After the reset the programm should start at the beginning.
If the following code complete or have I to do something else. To reset I only have to
start the watchdog!?
void ResetApplicatio(void)
{
COPCTL= 0x01;
}
Best regards
------------------------------------

(You need to be a member of 68hc12 -- send a blank email to 68hc12-subscribe@yahoogroups.com )
Re: HCS12 Watchdog...Reset - Rob Milne - Jan 14 8:52:20 2009
That'll work though you may want to prevent further processing while
waiting:
void ResetApplication( void)
{
asm("sei");
COPCTL=0x01;
while(1);
}
-rob
f...@yahoo.com wrote:
> Hello,
>
> I need for my programm a reset-function. I want to call a function
> ResetApplication( ). Then I want to use the watchdog to reset the
> application.
> I do not know how to use the watchdog exactly.
> After the reset the programm should start at the beginning.
>
> If the following code complete or have I to do something else. To reset
> I only have to start the watchdog!?
>
> void ResetApplicatio( void)
> {
> COPCTL= 0x01;
> }
>
> Best regards
------------------------------------

(You need to be a member of 68hc12 -- send a blank email to 68hc12-subscribe@yahoogroups.com )