|
|
View previous topic :: View next topic |
Author |
Message |
joe06 Guest
|
Is CCS able to manage long tables |
Posted: Fri Mar 14, 2003 3:25 am |
|
|
Hi All,
Is this delaration allowed on a 16F877 ?
BYTE myvar[3][40];
this makes 3 tables of 40 Bytes, resulting in a 120 bytes table. on a 16F877, each RAM banks are 96 bytes length, is CCS able to split this table to the different RAM banks ?
thanks
joe
___________________________
This message was ported from CCS's old forum
Original Post ID: 12662 |
|
|
PCM programmer
Joined: 06 Sep 2003 Posts: 21708
|
Re: Is CCS able to manage long tables |
Posted: Fri Mar 14, 2003 12:51 pm |
|
|
:=Hi All,
:=Is this delaration allowed on a 16F877 ?
:=
:=BYTE myvar[3][40];
:=
:=this makes 3 tables of 40 Bytes, resulting in a 120 bytes table. on a 16F877, each RAM banks are 96 bytes length, is CCS able to split this table to the different RAM banks ?
---------------------------------------------------------
CCS can not span ram banks with a large array.
___________________________
This message was ported from CCS's old forum
Original Post ID: 12675 |
|
|
mark r. hahn Guest
|
Re: Is CCS able to manage long tables |
Posted: Fri Mar 14, 2003 6:01 pm |
|
|
:=Hi All,
:=Is this delaration allowed on a 16F877 ?
:=
:=BYTE myvar[3][40];
:=
:=this makes 3 tables of 40 Bytes, resulting in a 120 bytes table. on a 16F877, each RAM banks are 96 bytes length, is CCS able to split this table to the different RAM banks ?
:=thanks
:=joe
CCS can't handle this, but you can at the expense of some additional code. For example I had to have a 120 byte array for one project. I just split it into 2 60 byte arrays.
// in bank 0
byte array1[60];
// in bank 1
byte array2[60];
// use a function to access array
byte get_array_value(int index)
{
if (idx < 60)
return(array1[idx]);
else
return(array2[idx-60]);
}
Hey, I know it's sleazy. If you want better code, use one of the 18Fxxx parts, they have tons of RAM.
Mark
___________________________
This message was ported from CCS's old forum
Original Post ID: 12693 |
|
|
joe06 Guest
|
Re: Is CCS able to manage long tables |
Posted: Sat Mar 15, 2003 4:40 am |
|
|
ok thanks, I finally found a trick for that, creating 2 functions read_array and write_array, with both dimensions passed as parameters, and using #locate to place my splitted arrays in different banks.
joe
:=:=Hi All,
:=:=Is this delaration allowed on a 16F877 ?
:=:=
:=:=BYTE myvar[3][40];
:=:=
:=:=this makes 3 tables of 40 Bytes, resulting in a 120 bytes table. on a 16F877, each RAM banks are 96 bytes length, is CCS able to split this table to the different RAM banks ?
:=---------------------------------------------------------
:=
:=CCS can not span ram banks with a large array.
___________________________
This message was ported from CCS's old forum
Original Post ID: 12705 |
|
|
|
|
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
|