Watchdog functions

取消
显示结果 
显示  仅  | 搜索替代 
您的意思是: 

Watchdog functions

4,569 次查看
desponia_
Contributor I
Hello
 
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. 
标签 (1)
0 项奖励
回复
1 回复

1,011 次查看
CompilerGuru
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?

Daniel
0 项奖励
回复