|
|
View previous topic :: View next topic |
Author |
Message |
Tressie
Joined: 07 Apr 2012 Posts: 12
|
WDT setup on 24FV32KA304? |
Posted: Sun Jul 29, 2012 10:26 pm |
|
|
I seem to be having inordinate difficulty making the WDT work on a 24FV32KA304, and was wondering if anyone might be able to assist?
I enable the WDT early in main() with setup_wdt(WDT_ON);
My fuses are as follows:
Code: |
#fuses NOWRTB, NOBSS, WPOSTS13, WDT32, WDT, WINDIS, NOBROWNOUT, NOLVR, NOPUT
#fuses NOALTI2C, BORV_LOW, MCLR, ICSP1, DSWDT32, NODSBOR, NODSWDT, NOWRT
#fuses PR, SOSC_DIGITAL, LPRCLOW, NOIESO, XT, OSCIO, POSCFREQ_M, SOSC_LOW
#fuses NOCKSFSM
#ifdef ENABLE_DEBUG
#fuses DEBUG, NOPROTECT
#else
#fuses NODEBUG, PROTECT
#endif
|
Any suggestions, anyone? I'm happy to provide any further information upon request.
Regards,
T. |
|
|
Tressie
Joined: 07 Apr 2012 Posts: 12
|
...or more specifically |
Posted: Mon Jul 30, 2012 6:45 am |
|
|
Okay, after some searching of the forum, I think the question might be better put:
MPLAB seemed to be indicating that my WDT configuration bits, as set in software (listed fuses), were such that both the WDT and SWDTEN bit are disabled - ie. FWDTEN<1:0> in FWDT WDT configuration register = 0b00.
My question then is, what CCS fuse configuration setting might be required to obtain a FWDTEN<1:0> WDT config bit setting of 0b10 - ie.
"WDT is controlled with the SWDTEN bit setting"?
Any tips greatly appreciated.
T.
ps. Thanks to the welcoming admin at credit, for the generous tidy up of my previous query. |
|
|
Ttelmah
Joined: 11 Mar 2010 Posts: 19498
|
|
Posted: Mon Jul 30, 2012 7:22 am |
|
|
Before going any further, check how MPLAB is configured. If you are compiling through this, it in some releases, defaults to 'debug' mode, and _will force off the watchdog_.....
This is not switched by selecting/deselecting the DEBUG fuse, but has to be changed in the MPLAB settings:
<http://www.ccsinfo.com/forum/viewtopic.php?t=46950&start=6>
Might be the cause of the problem.
Best Wishes |
|
|
Tressie
Joined: 07 Apr 2012 Posts: 12
|
WDT all fixed. |
Posted: Tue Jul 31, 2012 3:04 am |
|
|
Hi Ttelmah,
Thanks for that. You've hit the nail squarely on the head, as it was indeed MPLAB, or maybe more precisely the ICD3 degugger that I'm using, that seems to have been the cause for WDT settings being overriden in debug mode.
In my case, it turns out to be a simple matter of switching in or out the ICD's '#device' and possibly other configurations, with just a simple debug/release type conditional compilation directive.
Yep, seems like there's lots of handy tips available on this issue in the forum, so I anticipate being on the hunt much earlier next time.
Thanks, Guy's.
T. |
|
|
|
|
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
|