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 support@ccsinfo.com

WDT setup on 24FV32KA304?

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



Joined: 07 Apr 2012
Posts: 12

View user's profile Send private message

WDT setup on 24FV32KA304?
PostPosted: Sun Jul 29, 2012 10:26 pm     Reply with quote

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

View user's profile Send private message

...or more specifically
PostPosted: Mon Jul 30, 2012 6:45 am     Reply with quote

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. Very Happy

ps. Thanks to the welcoming admin at credit, for the generous tidy up of my previous query.
Ttelmah



Joined: 11 Mar 2010
Posts: 19358

View user's profile Send private message

PostPosted: Mon Jul 30, 2012 7:22 am     Reply with quote

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

View user's profile Send private message

WDT all fixed.
PostPosted: Tue Jul 31, 2012 3:04 am     Reply with quote

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. Embarassed

Thanks, Guy's.

T.
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