> even doing this doesnt work i can only get it to run if
> explicitly turn off the wdt fuse in the epicwin programmer.
This is my fault. If you select FILE...OPEN, then browse the 'Library' folder for 'system.bas'. Open it in the IDE.
Double click on the 'lock' icon to enable editing.
about halfway down the page you will see
Code: Select all
{
****************************************************************************
* Name : ClrWDT *
* Purpose : Clear the watch dog timer *
****************************************************************************
}
#option WDT = true //false
As you can see, I accidently left the default behaviour to TRUE when debugging. Just change to
Save the file, then close it. Your EPIC screen will now default to WDT = OFF, unless
(a) You use the #option WDT = true in your program
or
(b) You use config WDT = ON in your program
Let me know if the above fixes the default behaviour problem.
> It still seems to reset.
With #option WDT = true, the libraries here get built correctly with the ClrWDT mnemonic. It can only be one of two things
(a) One of the swordfish libraries is missing a call
(b) You program is causing the problem, by taking too long to execute some code without resetting the WDT.
Remember, you are responsible for periodically clearing the WDT in you main code. For example, if you have a looping construct that performs some computationally expensive task (floating point, strings) you will need to reset the watchdog. To do this, just include "system.bas" in your main program and call ClrWDT(). For example,
Code: Select all
device = 18f458
clock = 20
include "system.bas"
while true
// some code here...
ClrWDT // prevent reset
wend
If you still belive it is a swordfish problem, please post some code to demonstrate and we will take a look...