This sections covers some Swordfish Freqently Asked Questions (FAQ)...
You need to add a special compiler directive at the beginning of your main program before any include files. For example,
device = 18F452 clock = 20 #option WDT = true // <- add before any includes... include "usart.bas" ...
Just using the standard config directive 'WDT = ON' will only set the MCUs fuse. For example,
config OSC = HSPLL, BOR = ON, WDT = ON include "usart.bas" ...
However, many Swordfish library calls are blocking or they may take quite some time to execute. To stop the WDT resetting the MCU, you have to 'tickle' it. By default, Swordfish libraries will not do this as it adds a little extra code overhead. However, including the directive
#option WDT = true
will do two things