Watchdog functions

Showing results for 
Search instead for 
Did you mean: 

Watchdog functions

Contributor I
I m using CW V 3.1 for programmming and debug MC9s12DG128 microcontroller. When i use __RESER_WATCHDOG(); functions in main.c it gives an error that " C10011 : ' :' expected to delimit label". but all of helper application or example application uses it. Could you say me what is wrong?
And i m also using _FEED_COP. But there is no error if i use it.
the diffirences beetwen them is that __RESET_WATCHDOG(); function is defined in "mc9s12dg128.h" file whereas the _FEED_COP() function is defined in "hidef.h" file.
these are functions declarations;
#define __RESET_WATCHDOG() {asm sta COPCTL;} // in the mc9s12dg128.h
#define _FEED_COP()   ((*(volatile unsigned char*)_COP_RST_ADR)= 0x55,
(*(volatile unsigned char*)_COP_RST_ADR)= 0xAA)
and also i think that it is wrong to use __RESET_WATCHDOG(); function because you are not giving 0x55 and 0xAA value with in turn in which shape has been decleared in datasheet.
am i rigth to think that the _FEED_COP(); function  must be used to reset watchdog.?
best regards. 
Labels (1)
0 Kudos
1 Reply

NXP Employee
NXP Employee
Use the _FEED_COP, which works.
The implementation of __RESER_WATCHDOG is for a HC08, not for a HC12, so better do not use it. The actual error message you see is because it used the HC08 STA and not the HC12 STAA instruction in the macro.

>but all of helper application or example application uses it

Actually I did (fortunately) not find any use of __RESER_WATCHDOG in the HC12 V3.1 installation. Where did you see those usages? Maybe in HC08 code?

0 Kudos