PDA

View Full Version : The Screamer bootloader and LCDout



ice
- 22nd February 2005, 12:12
Hello,
I am able to run simple programs like blink an LED using the
DEFINE LOADER_USED 1

and the Screamer bootloader http://www.sparkfun.com/tutorial/Bloader/bloader.htm

The bootloadr states thatthe initial line has to be
org 0x0004, which the DEFINE LOADER_USED 1 seems to do

However the moment i put a line such as LCDout in my program,
the screamer REFUSES to load it into the pic

My other programs[which are in asm] run smoothly with the bootloader,even my serial routines.

any idea whats going on here

I also tried the microchipc bootmloader.The problem is,the loader downloads it to the chip,but the program doesnt start at all

Help me out here please.
-ice

mister_e
- 22nd February 2005, 18:18
do you load the bootloader .Hex file into your PIC before?

If so, i can't help BUT i'll really recommend you the MicroCode Studio Bootloader comming with the full version... that will solve all your problems.

ice
- 23rd February 2005, 04:22
yes i did,
The serial test routines that are bundled with the loader also work well

-ice

Bruce
- 23rd February 2005, 06:33
PBP always inserts a goto INIT at location 0. Normally this is all PBP will
insert from locations 0 - 3 if you use DEFINE LOADER_USED 1 to force the ORG 4.

Here's an example of what happens with DEFINE LOADER_USED 1

ORG 0 ; Reset vector at 0
goto INIT ; Finish initialization <-- a PBP thing for initialization
ORG 4 ; Make sure no library code in first 4 loc

When you use the LCDOUT command with PBP, it inserts clrf FLAGS before goto INIT.

Here's what it looks like.

ORG 0 ; Reset vector at 0
clrf FLAGS ; Clear all flags on reset
goto INIT ; Finish initialization
ORG 4 ; Make sure no library code in first 4 loc

FLAGS is a system variable used by PBP, and it only gets inserted before goto INIT when using the LCDOUT command.

Here's what you can do to fix it to work with the Bloader software.

Open the PBPPIC14.LIB file and look for this section. Comment out clrf FLAGS as shown below. Save the library file.


;******************************************
;* Startup Code *
;* *
;* Input : None *
;* Output : None *
;* *
;* Notes : Must be first library routine. *
;******************************************

; <<other stuff snipped out here>>

LIST
ORG 0 ; Reset vector at 0
NOLIST
ifdef ICD_USED
LIST
nop ; Skip first location for ICD
NOLIST
endif

ifdef FLAGS_USED
LIST
; clrf FLAGS ; Clear all flags on reset <----- COMMENT OUT
NOLIST
endif

If you use the LCDOUT command then clear FLAGS in the begining of your PBP code. This instruction should be the first code executed.

FLAGS=0

That's it. The clrf FLAGS will not be automatically inserted at location 0, and your PBP programs will work with the Bloader software as-is.

ice
- 24th February 2005, 05:51
Thanks alot Bruce,
your reply for explantory,ill try tht tday

BTW,i reloaded the microchip Bootloader V9 and all my PBP programs work well with it including LCDOUT
i was working on the V2 of the loader.

Thank you once again.
-ice

bartleph
- 25th March 2005, 19:14
Hi,
I wonder if anyone can help please:-
I'm trying to use the PicLoader Bootloader. I have PICBASIC PRO Ver 2.30.
How do I stop my Program from writing over the BootLoader vector...I've seen Bruce's reply further up where he says to modify the PBPPIC14.LIB file to stop the LCD clrf Flags from causing a problem, and I've done that. Should I be using DEFINE ONINT_USED 1 or
DEFINE LOADER_USED 1 with this version of PicBasic Pro?

Any help appreciated....Thanks Paul

Bruce
- 26th March 2005, 14:59
Hi,
I wonder if anyone can help please:-
I'm trying to use the PicLoader Bootloader. I have PICBASIC PRO Ver 2.30.
How do I stop my Program from writing over the BootLoader vector...I've seen Bruce's reply further up where he says to modify the PBPPIC14.LIB file to stop the LCD clrf Flags from causing a problem, and I've done that. Should I be using DEFINE ONINT_USED 1 or
DEFINE LOADER_USED 1 with this version of PicBasic Pro?

Any help appreciated....Thanks Paul
Yes. DEFINE ONINT_USED 1 was used for PBP versions prior to 2.33. Later versions use DEFINE LOADER_USED 1.