|
|
View previous topic :: View next topic |
Author |
Message |
Michael Valencia Guest
|
Placing arrays in ROM, instead of RAM? |
Posted: Sat Jul 12, 2003 8:11 am |
|
|
Hello,
I created an array around 70 bytes in size, using the following declaration:
byte my_array[]= {1,2,3,4,...}
I believe it is placed in RAM. Since I will not be modifying this array, and rather keeping it "constant", is there a way I can tell the CCS compiler that I want it to reside in ROM instead of using up RAM? I remember back in my assembly programming days, I can use the instruction "RETLW 0x23" to burn in 0x23 at that place in ROM.
Basically, what i'm asking is how to put a constant lookup table in program memory's (?) ROM, using CCS #directives.
___________________________
This message was ported from CCS's old forum
Original Post ID: 144515906 |
|
|
john cutler
Joined: 06 Sep 2003 Posts: 82 Location: Hot Tub, California
|
Re: Placing arrays in ROM, instead of RAM? |
Posted: Sat Jul 12, 2003 9:07 am |
|
|
look at page 214 of the current manual !
___________________________
This message was ported from CCS's old forum
Original Post ID: 144515907 |
|
|
Darren Logan Guest
|
Re: Placing arrays in ROM, instead of RAM? |
Posted: Sat Jul 12, 2003 2:07 pm |
|
|
Watto!
this...
byte const defaults[17]={1,1,1,1,1,37,3,0,0,115,120,29,0,10,0,0,143};
...does go into ROM automatically.
Regards,
Darren
___________________________
This message was ported from CCS's old forum
Original Post ID: 144515913 |
|
|
Michael Valencia Guest
|
Re: Placing arrays in ROM, instead of RAM? |
Posted: Sat Jul 12, 2003 8:06 pm |
|
|
I see what I did wrong. For one thing, I didn't read the manual from cover to cover, AND...I didn't put the "const" in the declaration.
Thanks guys.
:=Watto!
:=
:=this...
:=
:=byte const defaults[17]={1,1,1,1,1,37,3,0,0,115,120,29,0,10,0,0,143};
:=
:=...does go into ROM automatically.
:=
:=Regards,
:=Darren
___________________________
This message was ported from CCS's old forum
Original Post ID: 144515916 |
|
|
|
|
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
|