CCS C Software and Maintenance Offers
FAQFAQ   FAQForum Help   FAQOfficial CCS Support   SearchSearch  RegisterRegister 

ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

CCS does not monitor this forum on a regular basis.

Please do not post bug reports on this forum. Send them to support@ccsinfo.com

bootloader command

 
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion
View previous topic :: View next topic  
Author Message
BOB_SANTANA



Joined: 16 Oct 2006
Posts: 110
Location: HOVE, EAST SUSSEX

View user's profile Send private message

bootloader command
PostPosted: Wed Oct 18, 2006 4:09 pm     Reply with quote

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 Smile
PCM programmer



Joined: 06 Sep 2003
Posts: 21708

View user's profile Send private message

PostPosted: Thu Oct 19, 2006 12:39 pm     Reply with quote

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

View user's profile Send private message

PostPosted: Thu Oct 19, 2006 5:54 pm     Reply with quote

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 Smile
PCM programmer



Joined: 06 Sep 2003
Posts: 21708

View user's profile Send private message

PostPosted: Thu Oct 19, 2006 6:03 pm     Reply with quote

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








PostPosted: Fri Oct 20, 2006 5:39 pm     Reply with quote

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 Very Happy my program

You have being a Great help
dvtruongson



Joined: 09 Nov 2006
Posts: 1

View user's profile Send private message Yahoo Messenger

877 bootloader
PostPosted: Sun Nov 19, 2006 8:22 pm     Reply with quote

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 Sad
Display posts from previous:   
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion All times are GMT - 6 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group