View previous topic :: View next topic |
Author |
Message |
BOB_SANTANA
Joined: 16 Oct 2006 Posts: 110 Location: HOVE, EAST SUSSEX
|
bootloader command |
Posted: Wed Oct 18, 2006 4:09 pm |
|
|
Hello everyone
Please i do need your help as i am new the C programming.
i have just moved from picbasic pro to Picc (At Last)
but i still have my Melab Project board and i want to know what command i need to add to my programme to be able to use the bootloader of the Pic 16F877.
In picbasic i used to add this line at the beginning of my program?
DEFINE LOADER_USED 1 ' uses a bootloader
What is it in CCS?
Regards _________________ BOB_Santana |
|
|
PCM programmer
Joined: 06 Sep 2003 Posts: 21708
|
|
Posted: Thu Oct 19, 2006 12:39 pm |
|
|
There's a bootloader here for the 16F877 and related PICs.
http://www.microchipc.com/PIC16bootload/
To make it work with CCS, you need to put in an #org statement
to reserve the top 256 ROM words for the bootloader. He gives
examples of how to do that here:
http://www.microchipc.com/PIC16bootload/PIC_bootloader_FAQ.htm#reserve256_CCS_C
He has HEX files pre-compiled for various crystal frequencies and
baud rates. You might be able to use one of those. If not, you can
compile the ASM source in MPLAB and configure for your requirements.
In the source (and presumably the HEX files), he has LVP mode enabled.
I don't know why. So when you program the bootloader into your PIC,
you should change the config bits to disable LVP mode. I don't know
what your programmer is, but in MPLAB there's a window which allows
you to select the Config Bits settings before you program the PIC. |
|
|
BOB_SANTANA
Joined: 16 Oct 2006 Posts: 110 Location: HOVE, EAST SUSSEX
|
|
Posted: Thu Oct 19, 2006 5:54 pm |
|
|
Thanks you very much for your help.
I am using pic16f877 and i have already got the bootloader hex file
that i have being using while i was programming in picbasicpro.
Would i be able to use the same bootloader with CCS V3.18
I use picstart plus to program the hex to the pic
and i still have my picbasic project board
so if i put the following on top of my program would it work with my old loader
#pragma chip PIC16F877, core 14, code 0x1F00, ram 32 : 0xFF /0 /3
#pragma cdata[0] = 0x0180 + 0x0A #pragma cdata[1] = 0 // NOP
#pragma cdata[2] = 0 // NOP
#pragma resetVector 3 // start address for user program
Best Regard _________________ BOB_Santana |
|
|
PCM programmer
Joined: 06 Sep 2003 Posts: 21708
|
|
Posted: Thu Oct 19, 2006 6:03 pm |
|
|
The CCS compiler has no knowledge of all the directives that
you're putting in the #pragmas. It will just give tons of error
messages.
My advice is to use either PBP or CCS. Don't try to mix the two. |
|
|
Guest
|
|
Posted: Fri Oct 20, 2006 5:39 pm |
|
|
Thanks for the help.
i did download the loader on the link you sent me and got it working now
for my 16f877 by including the following statement
#ORG 0x1F00,0x1FFF {}
At the beginning of my program
You have being a Great help |
|
|
dvtruongson
Joined: 09 Nov 2006 Posts: 1
|
877 bootloader |
Posted: Sun Nov 19, 2006 8:22 pm |
|
|
Hi everybody,
I tried to do the same thing with bootloader for 877 in microchipc.com, but won't be able to make it. Anyone have any ideas about this? I used current CCS Mach X compiler, 20MHz |
|
|
|