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 CCS Technical Support

#serialize question, start address

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



Joined: 02 Jun 2009
Posts: 123
Location: The Netherlands

View user's profile Send private message

#serialize question, start address
PostPosted: Mon Jan 30, 2017 2:38 am     Reply with quote

I'm using a #serialize function to program a serial number in the program memory. But now I must specify the address in CCSload before programming, in my case it is address FFE to FFF (PIC16F1824). As I've read in the CCS manual it is possible to set an start address for #serialize for the EEPROM, but is this also possible for the program memory?
Ttelmah



Joined: 11 Mar 2010
Posts: 19545

View user's profile Send private message

PostPosted: Mon Jan 30, 2017 4:54 am     Reply with quote

You need a couple more addresses. 0xFFC, 0xFFF

You just use an #org to locate the const 'variable' you are going to use, then pass this to the serialise operation. However the value stored will be a tiny program to return the constant (so two RETLW instructions:

Code:

#ORG 0x0FFC, 0x0FFF
const int16 rom_ID=0;
#serialize(ID=rom_ID,next="200",prompt="Enter the serial number")



The serialise will modify the value stored in 'rom_ID'.
Code:

*
0FFC:  BRW
0FFD:  RETLW  00
0FFE:  RETLW  00
....................


It is the contents of the two RETLW instructions that gets changed.

If you want to access it in your code, you just read rom_ID.
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