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

Program loader...

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







Program loader...
PostPosted: Mon Nov 26, 2001 2:03 pm     Reply with quote

I'm using the 16F877, It will interact with a PC, (with code I write for the PC). One of the options I would like to include is the ability to replace the program code. I can see that it do-able, just not exactly sure how to get it done...I don't think this is the same as a boot loader... (correct me if I'm wrong.)

A second feature I want is the ability to replace/update only a portion (or a function) of the code. For this part I realize that this function must always start at the same address. (so the non-replaced code can find it.) and the registers the functions calls must also always have the same addresses. It is very likely that the full program gets modified and replaced but the function is still the same. This function will be created by a user(via the PC program) and therefore does not have access to the my source code or the compiler.

How do I 'anchor' registers now, so that in the future as I add/delete variables the variables critical to this function stay put? And like wise for function location?

Joe Heinrich
___________________________
This message was ported from CCS's old forum
Original Post ID: 1326
PCM programmer



Joined: 06 Sep 2003
Posts: 21708

View user's profile Send private message

Re: Program loader...
PostPosted: Mon Nov 26, 2001 2:22 pm     Reply with quote

:=I'm using the 16F877, It will interact with a PC, (with code I write for the PC). One of the options I would like to include is the ability to replace the program code. I can see that it do-able, just not exactly sure how to get it done...I don't think this is the same as a boot loader... (correct me if I'm wrong.)

You should look at the #org and #locate statements in the manual
and in the example files. Also look at the C and ASM source
code for a bootloader, found here:
<a href="http://www.workingtex.com/htpic/PIC_bootloader.htm" TARGET="_blank">http://www.workingtex.com/htpic/PIC_bootloader.htm</a>
___________________________
This message was ported from CCS's old forum
Original Post ID: 1327
Shane Rowell
Guest







Re: Program loader...
PostPosted: Mon Nov 26, 2001 4:55 pm     Reply with quote

I have used the bootloader available at the included link with the ccs compiler. It works great and saves a lot of time.
-Shane

:=I'm using the 16F877, It will interact with a PC, (with code I write for the PC). One of the options I would like to include is the ability to replace the program code. I can see that it do-able, just not exactly sure how to get it done...I don't think this is the same as a boot loader... (correct me if I'm wrong.)
:=
:=A second feature I want is the ability to replace/update only a portion (or a function) of the code. For this part I realize that this function must always start at the same address. (so the non-replaced code can find it.) and the registers the functions calls must also always have the same addresses. It is very likely that the full program gets modified and replaced but the function is still the same. This function will be created by a user(via the PC program) and therefore does not have access to the my source code or the compiler.
:=
:=How do I 'anchor' registers now, so that in the future as I add/delete variables the variables critical to this function stay put? And like wise for function location?
:=
:=Joe Heinrich
___________________________
This message was ported from CCS's old forum
Original Post ID: 1331
Steve Sawtelle
Guest







Re: Program loader...
PostPosted: Tue Nov 27, 2001 9:40 am     Reply with quote

:=I'm using the 16F877, It will interact with a PC, (with code I write for the PC). One of the options I would like to include is the ability to replace the program code. I can see that it do-able, just not exactly sure how to get it done...I don't think this is the same as a boot loader... (correct me if I'm wrong.)

-- The boot loader allows loading of new software (except the bootloader part of course) over the serial port, so I believe it is what you want. There are several types out there - look thru the achives as thsi comes up pretty often.

:=
:=A second feature I want is the ability to replace/update only a portion (or a function) of the code. For this part I realize that this function must always start at the same address. (so the non-replaced code can find it.) and the registers the functions calls must also always have the same addresses. It is very likely that the full program gets modified and replaced but the function is still the same. This function will be created by a user(via the PC program) and therefore does not have access to the my source code or the compiler.
:=

--- The same idea can be used here, except now your 'bootloader' code is actually the whole program (minus the user loaded part)



:=How do I 'anchor' registers now, so that in the future as I add/delete variables the variables critical to this function stay put? And like wise for function location?


-- As indicated by other responses (ORG and LOCATE)


:=
:=Joe Heinrich
___________________________
This message was ported from CCS's old forum
Original Post ID: 1339
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