Hi Foggy
If you still want a USB bootloader that works with PBP then try this one.
If I can get it to work then you should also. Get it here:-
http://digital-diy.com/pic-micrcontr...otloaders.html
Example program - **** DO NOT INCLUDE the line 'DEFINE LOADER USED 1' ****
DEFINE OSC 48
DEFINE RESET_ORG 0F00h 'Load code at 0F00h
RED_LED VAR PORTC.0
YELLOW_LED VAR PORTC.1
GREEN_LED VAR PORTC.2
START:
HIGH RED_LED
PAUSE 500
LOW RED_LED
HIGH YELLOW_LED
PAUSE 500
LOW YELLOW_LED
HIGH GREEN_LED
PAUSE 500
LOW GREEN_LED
GOTO START:
Compile and then load the hex file produced into the PIC with the bootloader.
Reset the PIC by taking MCLR pin low and the LEDs should blink
Reset the PIC again by taking MCLR low and you should be back in bootloader mode. No need to hold PORTB.4 low as with the Microchip bootloader. Don't forget pull-up on MCLR.
A few conclusions reached mainly by trial and error.
1 - DEFINE LOADER_USED 1
This is not required. As far as I can tell all it does is tell the compiler to load the hex file using Microcode Loader when "Compile/Program" is clicked and puts a jump to where the Microcode loader is in the PIC memory which we do not want.
2 - DEFINE RESET_ORG 0F00h
This IS required as it sets the memory address where the program will be loaded.
3 - The bootloader software is best flashed to a BLANK PIC. It may take 2 or 3 erase cycles before the PIC is blank.
4 - When flashing the PIC with PICKit programmer, click on "Tools" then "Enable code protect". This seems (so far) to prevent the bootloader from being accidentally over written.
5 - Tested with Windows XP, PBP 2.6, PIC 18F2550 20mHz Xtal
I have no other suitable PICs to test at the moment.
I have tried it with a few short programs and so far it has worked 100%
Phil
Bookmarks