micro_debugger
Joined: 08 Oct 2009 Posts: 73
|
PIC18LF46J50 setup_wdt(WDT_ON) not working |
Posted: Fri Jul 20, 2012 12:03 pm |
|
|
Hi,
I'm using the PIC18LF46J50 and the setup_wdt(WDT_ON) and the restart_wdt(); within the loop is not working. I propably have something wrong in the fuses. Could you please help me. Second pair of eyes could help. Here below is my listing of fuses:
Code: |
#include <18LF46J50.h>
#IFNDEF BL
#device ICD=TRUE
#ENDIF
#OPT 10
#device adc=8
#device *=16
#DEVICE(WRITE_EEPROM=ASYNC)
#device HIGH_INTS=TRUE
#device NESTED_INTERRUPTS
#device PASS_STRINGS = IN_RAM
#define FASTER_BUT_MORE_ROM
#priority rtcc
#ZERO_RAM
#IFDEF BL
#define LOADER_SIZE (0x0FFF) ///
#define LOADER_START (0) ////
#define LOADER_END (LOADER_SIZE) ////
#ENDIF
#define SAVING_AREA_START (getenv("PROGRAM_MEMORY")-getenv("FLASH_ERASE_SIZE")+8)
#IFDEF BL
#define APPLICATION_START (LOADER_SIZE+1)////
#build( reset=0x1000, interrupt=0x1008 ) ////
#org 0, LOADER_END {} ////
#org default////
#ENDIF
#USE STANDARD_IO(B)
#FUSES HSPLL //High Speed Crystal/Resonator with PLL enabled
#FUSES PLL3
#FUSES NOCPUDIV
#FUSES FCMEN //Fail-safe clock monitor enabled
#FUSES IESO //Internal External Switch Over mode enabled
#FUSES WDT //Watch Dog Timer Enabled
#FUSES WDT16 //Watch Dog Timer setup
#FUSES NODEBUG //No Debug mode for ICD
#FUSES NOXINST //Extended set extension and Indexed Addressing mode disabled (Legacy mode)
#FUSES STVREN //Stack full/underflow will cause reset
#FUSES NOPROTECT //Code not protected from reading
#FUSES IOL1WAY //Allows only one reconfiguration of peripheral pins
#FUSES NOWPCFG
#FUSES WPEND
#FUSES WPDIS
#FUSES LPT1OSC //Timer1 configured for low-power operation
#FUSES T1DIG
#FUSES MSSPMSK7
#FUSES DSWDT2
#FUSES DSWDTOSC_INT
#FUSES DSBOR
#FUSES RTCOSC_T1
#FUSES WPFP
#use delay(clock=48000000, crystal=12000000, RESTART_WDT)
#use rs232(uart1, baud=9600, parity=N, xmit=PIN_C6, rcv=PIN_C7, bits=8, ERRORS, STREAM=GSM)
//#PIN_SELECT U2TX=PIN_D4
//#use rs232(uart2, baud=9600, parity=N, xmit=PIN_D4, bits=8, ERRORS, STREAM=RS_2, RESTART_WDT)
#use i2c(Master,Fast, sda=PIN_B5, scl=PIN_B4, SMBUS, force_hw, RESTART_WDT) |
Thank you so much for your help !!!!!!!
Best regards
micro_debugger |
|