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

write to ROM

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







write to ROM
PostPosted: Mon Sep 10, 2007 3:14 am     Reply with quote

Is there a way for me to place/write a string at the end of program memory without the need to change the string's start address whenever i update my firmware?

currently, i check my firmware size and use the last memory address filled as a reference before entering a 'string of words' at the end of my firmware using #rom 0xXXXX = {"xxxxx....."}
PCM programmer



Joined: 06 Sep 2003
Posts: 21708

View user's profile Send private message

PostPosted: Mon Sep 10, 2007 12:21 pm     Reply with quote

Do something like this:
Code:

#include <16F877.H>
#fuses HS, NOWDT, NOPROTECT, BROWNOUT, PUT, NOLVP
#use delay(clock = 20000000)
#use rs232(baud=9600, xmit=PIN_C6, rcv=PIN_C7, ERRORS)


#rom 0x1FF0  = {"End of ROM"}

//===================================
void main()
{


while(1);
}
ckielstra



Joined: 18 Mar 2004
Posts: 3680
Location: The Netherlands

View user's profile Send private message

PostPosted: Mon Sep 10, 2007 2:22 pm     Reply with quote

Guestplanet,
Why is it important to your application to have the data directly after the code memory? Like in PCM's example, why bother, just place your data at a fixed location at the program's end.

Or if the location of the data is not important you can declare the data as 'const' and then use the function label_address() to retrieve the address.

Also read the CCS manual chapter 'Using Program Memory for Data' for the v4 compiler supporting some new (and non standard C) methods for storing data in ROM.
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