View previous topic :: View next topic |
Author |
Message |
J_GROUP
Joined: 25 Aug 2015 Posts: 18
|
WDT timer controlled by software |
Posted: Thu Aug 27, 2015 3:36 am |
|
|
Dear Friend,
Please help me code to define WDT controlled by software.
my code:
#fuses SWDTEN,PROTECT,NOLVP,MCLR,NOBROWNOUT
I was used function : setup_wdt(WDT_OFF); to turn off WDT. But WDT still running while I still not turn ON.
How to fix it? |
|
|
Ttelmah
Joined: 11 Mar 2010 Posts: 19552
|
|
Posted: Thu Aug 27, 2015 4:02 am |
|
|
Chip?.
Some don't even allow this. Most that do require you to select WDT_SW in the fuses. Also compiler version?. SWDTEN hasn't existed for many hundreds of compiler versions.... |
|
|
J_GROUP
Joined: 25 Aug 2015 Posts: 18
|
|
Posted: Thu Aug 27, 2015 10:20 am |
|
|
Thank for your reply. I am using 18F25K22 |
|
|
Ttelmah
Joined: 11 Mar 2010 Posts: 19552
|
|
Posted: Thu Aug 27, 2015 11:12 am |
|
|
As I said 'compiler version'?.
However any compiler that is new enough to support this chip will want WDT_SW. I'm surprised it compiles with SWDTEN.
You should also add NOXINST.
Get rid of protect, until you have finished development. Enabling this forces a full chip erase when anything is changed. Without this the programmer does not have to erase sections that haven't changed. Results in less 'life' being used up in the program memory. Only enable this once the code is finished. |
|
|
|