Ok, this works for me. I'm using microcode stuidios 18f4550 20mhz hex bootloader file, and change the speed to 48mhz on the fly using Darrel's RTconfig.inc file.
Will post code tonight for a 18f4520
Code:DEFINE OSC 48 ' Lets work at 48 MHz with our 20mhz bootloader! define LOADER_USED 1 @ #include "RTconfig.inc" ;Darrel's write to configs while running inc tempbyte var byte redled var PORTD.1 ;----Change back to low speed for bootloader at reset @ ReadConfig?CB _CONFIG1L, _tempbyte ; Read CONFIG1L tempbyte.0=1 tempbyte.1=1 @ WriteConfig?CB _CONFIG1L, _tempbyte ; Write CONFIG1L @ ReadConfig?CB _CONFIG1H, _tempbyte ; Read CONFIG1H tempbyte.1=0 @ WriteConfig?CB _CONFIG1H, _tempbyte ; Write CONFIG1H pause 1000 ; Give bootloader time to do it's thing ;----Accelerate up to 48mhz for your code @ ReadConfig?CB _CONFIG1L, _tempbyte ; Read CONFIG1L tempbyte.0=0 tempbyte.1=0 @ WriteConfig?CB _CONFIG1L, _tempbyte ; Write CONFIG1L @ ReadConfig?CB _CONFIG1H, _tempbyte ; Read CONFIG1H tempbyte.1=1 @ WriteConfig?CB _CONFIG1H, _tempbyte main: pause 500 high redled pause 500 low redled goto main end


So I think I did it correctly other than my check sum was no longer good, but hopefully it is OK.


Bookmarks