clr_wdt compiler error

For Flowcode users to discuss projects, flowcharts, and any other issues related to Flowcode 5.
To post in this forum you must have a registered copy of Flowcode 5 or higher.

Moderator: Benj

Post Reply
Rabbit
Posts: 28
Joined: Wed Apr 04, 2012 1:33 pm
Has thanked: 3 times
Been thanked: 3 times
Contact:

clr_wdt compiler error

Post by Rabbit »

Hello experts,
I use:
- PIC16F877A
- Flowcode V5.5.2.1
- Compiler Version 7.04
- C-code-icon line: clr_wdt();

The C-compiler generates an error: error: unknown identifier 'clr_wdt()'
I don't know why.

I would be pleased about your help.

Rabbit

medelec35
Matrix Staff
Posts: 9520
Joined: Sat May 05, 2007 2:27 pm
Location: Northamptonshire, UK
Has thanked: 2585 times
Been thanked: 3815 times
Contact:

Re: clr_wdt compiler error

Post by medelec35 »

Hi Rabbit,
By far the best way to clear the watchdog timer is with:
MX_CLEAR_WATCHDOG;

Within a C code block.
Using that will mean it will work with both boostC and Ht-Tec compilers with no issues.

Martin
Martin

Rabbit
Posts: 28
Joined: Wed Apr 04, 2012 1:33 pm
Has thanked: 3 times
Been thanked: 3 times
Contact:

Re: clr_wdt compiler error

Post by Rabbit »

Hello Martin,
I tested your command and all is well.
Have many thanks
Rabbit

medelec35
Matrix Staff
Posts: 9520
Joined: Sat May 05, 2007 2:27 pm
Location: Northamptonshire, UK
Has thanked: 2585 times
Been thanked: 3815 times
Contact:

Re: clr_wdt compiler error

Post by medelec35 »

Hi Rabbit,
Glad it works for you.

Thanks for letting us know.

Martin
Martin

Rabbit
Posts: 28
Joined: Wed Apr 04, 2012 1:33 pm
Has thanked: 3 times
Been thanked: 3 times
Contact:

Re: clr_wdt compiler error

Post by Rabbit »

Hello everybody,
Please note: for correct working with the WatchDogTimer the OPTION_REG Register use 4 bit,
bit 2-0 (prescaler rate select bit) and
bit 3 (1 = presclaer is assigned to the WDT; 0 = presclaer is assigned to the Timer0 module)

The table is showing the bit assignments with the devision rates and the time for the WDT to time out including bit 3:

-Bit----Hex ----Rate---WDT-Time[ms]
1000---0x08----1:1-------18
1001---0x09----1:2-------36
1010---0x0A----1:4-------72
1011---0x0B----1:8------144
1100---0x0C----1:16----288
1101---0x0D----1:32----576
1110---0x0E----1:64----1100
1111---0x0F----1:128---2300

Remember these times are irrespective of the external clock frequency.
The C-Code for 1.1sec time out is e.g.
option_reg=0x0E

Rabbit

Post Reply