With the MeLabs USB programmer, if you have "Reread File Before Programming" and "Update Configuration From File" selected under the Options menu, then it will reload & program whatever config fuse settings are embedded in your .hex file each time.
With the MeLabs USB programmer, if you have "Reread File Before Programming" and "Update Configuration From File" selected under the Options menu, then it will reload & program whatever config fuse settings are embedded in your .hex file each time.
I struggled with this for quite a while; the 18xxxx series works a little different. You can't use the __CONFIG command, and I could never get it to work embedding the @ CONFIG command in the source code (because the include code has some __CONFIG lines in it already, and you CAN'T MIX the two types of config methods, according to the compiler).
In your program, put this line at the top (according to your processor type!)
@ #INCLUDE <18F4550.INC>
Then, edit that include so that it looks like this (customize according to your needs):
NOLIST
ifdef PM_USED
LIST
"Error: PM does not support this device. Use MPASM."
NOLIST
else
LIST
LIST p = 18F4550, r = dec, w = -311, f = inhx32
INCLUDE "P18F4550.INC" ; MPASM Header
; NOTE: these are the lines you will add, according to your needs and
; the device spec sheet
; If there are any __CONFIG lines, delete them!
CONFIG PLLDIV = 5
CONFIG CPUDIV = OSC3_PLL4
CONFIG USBDIV = 2
CONFIG FOSC = HSPLL_HS
CONFIG FCMEM = ON
CONFIG PWRT = ON
CONFIG BOR = ON
CONFIG BORV = 43
CONFIG VREGEN = ON
CONFIG WDT = OFF
CONFIG WDTPS = 1024
CONFIG MCLRE = ON
CONFIG PBADEN = OFF
NOLIST
endif
LIST
... (the rest of the include code)
I keep each project in it's own folder, then copy the includes needed into that folder.
Best wishes!
Bookmarks