Page 1 of 1

Watch dog timer reset V9

Posted: Thu May 07, 2026 1:11 pm
by jollybv
Hi Guys

I'm using this in a C code WDTClear() to reset the watchdog timer but when i compile it gives me this error. I've also tried CLRWDT(); and
#asm CLRWDT #endasm they all failing what code would you recommend?

28055: #warning "This interrupt has previously been enabled, so the macro <Getkey> may never get called."
^ (162) #warning: "This interrupt has previously been enabled, so the macro <Getkey> may never get called." (warning)
E-P_U6_V-4-6-2_W_ON_04-05-26_For-A7682E_AI_repair1.c: main()
14611: WDTClear()
^ (361) function declared implicit int (warning)
14612: ----------------------------------------
^ (202) only lvalues can be assigned to or modified
^ (202) only lvalues can be assigned to or modified
^ (202) only lvalues can be assigned to or modified
^ (202) only lvalues can be assigned to or modified
^ (202) only lvalues can be assigned to or modified
^ (202) only lvalues can be assigned to or modified
^ (202) only lvalues can be assigned to or modified
^ (202) only lvalues can be assigned to or modified
^ (202) only lvalues can be assigned to or modified
^ (202) only lvalues can be assigned to or modified
^ (202) only lvalues can be assigned to or modified
^ (202) only lvalues can be assigned to or modified
^ (202) only lvalues can be assigned to or modified
^ (202) only lvalues can be assigned to or modified
^ (202) only lvalues can be assigned to or modified
^ (202) only lvalues can be assigned to or modified
^ (202) only lvalues can be assigned to or modified
^ (202) only lvalues can be assigned to or modified
^ (202) only lvalues can be assigned to or modified
14615: }
^ (202) only lvalues can be assigned to or modified
E-P_U6_V-4-6-2_W_ON_04-05-26_For-A7682E_AI_repair1.c: 14615: too many errors (21)
(908) exit status = 1
(908) exit status = 1

Error returned from [xc8.exe]

C:\ProgramData\MatrixTSL\FlowcodeV9\FCD\PIC\batch\pic_xc8_comp.bat reported error code 0x1

Autoclose turned off


FINISHED

Re: Watch dog timer reset V9

Posted: Thu May 07, 2026 3:11 pm
by medelec35
Hi Brian, I use

Code: Select all

MX_CLEAR_WATCHDOG;
within a c code block.
Don't forget to enable Auto clear watchdog within project options.
For c code you will require a semicolon when calling a function.
E.g. you shown WDTClear().
As its a function it should have a semicolon on the end, but it's still the wrong code to use.

Re: Watch dog timer reset V9

Posted: Thu May 07, 2026 5:14 pm
by jollybv
Thanks Martin what i found betwene me and Ai that i needed to change all the WDTClear() to
#asm
CLRWDT
#endasm

Then it compiled so all good for now just some other small issues to sort