|
|
View previous topic :: View next topic |
Author |
Message |
mvanvliet
Joined: 02 Jun 2009 Posts: 123 Location: The Netherlands
|
#serialize question, start address |
Posted: Mon Jan 30, 2017 2:38 am |
|
|
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
|
|
Posted: Mon Jan 30, 2017 4:54 am |
|
|
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. |
|
|
|
|
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
|