Email: Password: Remember Me | Create Account (Free)

Back to Subject List

Old thread has been locked -- no new posts accepted in this thread
???
11/20/14 04:39
Read: times


 
#190378 - How to init a variable in ROM
Dear All,
I am using AT89S52.

The program Length is about 1k.
I need to program the ID of the product.

This ID is to be displayed by the product after Power ON.

I want to give the freedom to my customer to program this ID, But I do NOT want to give the source code. Instead, I will be giving him the HEX file. My customer knows how to download the HEX file into the CPU. I will give him the address of the unused location such as 0xff0, and tell him to program this location with the ID when downloading the program into the CPU.

I have used the following: to read memory location 0xff0:
unsigned char code *Ptr=0xFF0;

ID=*Ptr;

 


This is working fine, no problem.

The problem is:
Whenever I compile the code, this location is initialized to 0xff. I need to initialize this memory location (with a default ID) whenever I compile the source code.

How to initialize an unused ROM location in C?

List of 8 messages in thread
TopicAuthorDate
How to init a variable in ROM            01/01/70 00:00      
   You can NOT write to ROM            01/01/70 00:00      
   Hex file            01/01/70 00:00      
   Initialize code            01/01/70 00:00      
   toolchain?            01/01/70 00:00      
   Using SDCC...            01/01/70 00:00      
   that chip does not have any ROM            01/01/70 00:00      
   Here is the solution I was looking for            01/01/70 00:00      

Back to Subject List