Watchdog functions

キャンセル
次の結果を表示 
表示  限定  | 次の代わりに検索 
もしかして: 

Watchdog functions

4,568件の閲覧回数
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,010件の閲覧回数
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 件の賞賛
返信