I dun quite understand this. I have a PIC18F25550 UBS Bit Wacker from SparkFun. They have a UBW bootloader. If I want to retain the bootloader in the PIC and still be able to add program into the PIC ( like if I push a button, I will jump to my program. Else, it will be in the bootloader default program ).
How do I achieve this functionality.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
I am using a bootloader that jumps to 0x800 I think ...
so how do I change the start location in assembly it might be ORG in my GCB code?
so how do i tell it go their
Your code template should look like this:
'blink led test
#chip 16F877a, 10
#option bootloader
goto main
asm org 0x0800
'start of main loop
main:
' your code
goto main
Compile this and look at the assembly code. You will see
#include <P16F877A.inc>
__CONFIG _HS_OSC & _WDT_OFF & _LVP_OFF
;********************************************************************************
;Jump to initialisation code when PIC is reset
ORG 0
clrf PCLATH
goto SystemInitialise
;********************************************************************************
;Interrupt vector
ORG 4
retfie
;********************************************************************************
;Various initialisation routines, automatically called by GCBASIC
SystemInitialise
call INITSYS
;********************************************************************************
;Start of the main program
goto MAIN
ORG 0X0800
MAIN
goto MAIN
BASPROGRAMEND
sleep
goto $
Do not forget the "goto main" before the "asm org 0x0800"
Question: What bootloader are you using? I would like to take a look at it.
I dun quite understand this. I have a PIC18F25550 UBS Bit Wacker from SparkFun. They have a UBW bootloader. If I want to retain the bootloader in the PIC and still be able to add program into the PIC ( like if I push a button, I will jump to my program. Else, it will be in the bootloader default program ).
How do I achieve this functionality.