CCS C Software and Maintenance Offers
FAQFAQ   FAQForum Help   FAQOfficial CCS Support   SearchSearch  RegisterRegister 

ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

CCS does not monitor this forum on a regular basis.

Please do not post bug reports on this forum. Send them to CCS Technical Support

Long WDT times

 
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion
View previous topic :: View next topic  
Author Message
JackK



Joined: 16 Oct 2020
Posts: 5

View user's profile Send private message

Long WDT times
PostPosted: Wed Jan 13, 2021 9:09 am     Reply with quote

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

View user's profile Send private message

PostPosted: Wed Jan 13, 2021 9:27 am     Reply with quote

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

View user's profile Send private message

Long WDT times
PostPosted: Wed Jan 13, 2021 10:38 am     Reply with quote

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

View user's profile Send private message

PostPosted: Wed Jan 13, 2021 11:48 am     Reply with quote

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

View user's profile Send private message

PostPosted: Wed Jan 13, 2021 3:27 pm     Reply with quote

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....
Display posts from previous:   
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion All times are GMT - 6 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group