View previous topic :: View next topic |
Author |
Message |
JackK
Joined: 16 Oct 2020 Posts: 5
|
Long WDT times |
Posted: Wed Jan 13, 2021 9:09 am |
|
|
I am using an 18F67K90. Reading the data sheet, it says that the device is capable of up to 70 minutes for the WDT. However, the 18F67K90.h file defines the settings allowed and it only goes to 128 seconds. Is it possible to increase the WDT time?
Also, reading about the delay_ms, I see that CCS puts a restart WDT each time. Are these necessary? |
|
|
Ttelmah
Joined: 11 Mar 2010 Posts: 19552
|
|
Posted: Wed Jan 13, 2021 9:27 am |
|
|
They don't put a restart_wdt, unless you have specified restart_wdt in
the #use delay settings....
The watchdog postscaler high values, are only configurable in the fuses,
not in the setup_wdt function. If you want a super long watchdog, you have
to set it up with WDT1048576 in the fuses. They only write the low 4 bits
of the value in the offered options (the idea that somebody would want to
configure a time longer than this in the software settings is possibly
a bit alien!...
However you may find it'll work with:
#define WDT_4194S 0x6100
Depends how they code the actual write. |
|
|
JackK
Joined: 16 Oct 2020 Posts: 5
|
Long WDT times |
Posted: Wed Jan 13, 2021 10:38 am |
|
|
The application connects through a cell tower and reports to a server. On a good connection, it takes approximately 120 seconds to complete. On a bad connection, twice that.
Do you have a recommendation? |
|
|
Ttelmah
Joined: 11 Mar 2010 Posts: 19552
|
|
Posted: Wed Jan 13, 2021 11:48 am |
|
|
Just set it up in the fuses.
At such a long interval keeping it triggered when you are not doing this
connection should be easy.
However why use a watchdog for this?. Just use a timer, and if the
connection does not make in a sensible interval retry. |
|
|
temtronic
Joined: 01 Jul 2010 Posts: 9246 Location: Greensville,Ontario
|
|
Posted: Wed Jan 13, 2021 3:27 pm |
|
|
Possible alternative....
From the compiler manuals, Q&A or FAQ section....
Scroll down to this...
How do I get getc() to timeout after a specified time?
Possible problem with using WDT is that it 'reboots' the PIC.... starts from 'scratch' so data could be lost ?? I don't know if there's a WDT option to save RAM/register data.... |
|
|
|