[SOLVED] How to save some Data in Code Memory of PIC16F877A

Status
Not open for further replies.

xpress_embedo

Advanced Member level 4
Joined
Jul 5, 2011
Messages
1,154
Helped
161
Reputation
396
Reaction score
189
Trophy points
1,353
Location
India
Activity points
10,591
Hello i have declared a variable in Hi-Tech for Storing 180 bytes of unsigned char variables.

But it is not working as my compiler gives error of 180 bytes not available..

can anyone tell me how to save data in code memory of PIC16F877A.

unsigned char wave[180] = {//180 values are written here};

i want to save these values in rom i.e code memory can anyone tell me how to do so..

I am using Hi-Tech C Compiler along with MPLAB IDE.


Regards
Arun Sharma'
 

You can't store 'variables' in any kind of ROM.
If it's a table of data that never changes, it's a constant array so try declaring it as "const unsigned char wave[180] = ...". Which should telll the compiler it can safely be stored in permanent (ROM) memory.

Brian.
 

Status
Not open for further replies.

Similar threads

Cookies are required to use this site. You must accept them to continue using the site. Learn more…