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

How can I reserve a specific memory location?

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



Joined: 29 Dec 2003
Posts: 81

View user's profile Send private message

How can I reserve a specific memory location?
PostPosted: Thu Mar 18, 2004 5:13 pm     Reply with quote

Hi,

Anybody has an idea of how can I reserver a specific location of the on-chip program memory?

Does CCS has a built-in function for reading/writing the on-chip program memory?

Any comments and suggestions?

Thank you.
Haplo



Joined: 06 Sep 2003
Posts: 659
Location: Sydney, Australia

View user's profile Send private message

PostPosted: Thu Mar 18, 2004 5:49 pm     Reply with quote

To reserve location you can use #org. Quoting from the manual: Follow the ORG with a {} to only reserve the area with nothing inserted by the compiler. You may want to take a look at #ROM too.

To read/write the on-chip program memory you can use the read_program_eeprom()/write_program_eeprom () functions.
Guest








PostPosted: Thu Mar 18, 2004 10:31 pm     Reply with quote

Haplo wrote:
To reserve location you can use #org. Quoting from the manual: Follow the ORG with a {} to only reserve the area with nothing inserted by the compiler. You may want to take a look at #ROM too.

To read/write the on-chip program memory you can use the read_program_eeprom()/write_program_eeprom () functions.


How many clock cycles does it takes for a read_program_eeprom() and write_program_eeprom()?
Haplo



Joined: 06 Sep 2003
Posts: 659
Location: Sydney, Australia

View user's profile Send private message

PostPosted: Fri Mar 19, 2004 12:10 am     Reply with quote

Judging by the code generated in the .LST file, on a PIC16F87x read_program_eeprom() takes around 20 instruction cycles and write_program_eeprom() takes around 40 instruction cycles to finish.
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