Lost in Pages of Variables...
Steel
Posts: 313
So I am new to the SX and trying to understand everything.· I have added variable #21 to my program, and the error I get at compile is:
"Variable Exceed Available RAM".· Are there only 20 bytes of available RAM space?· I know my code isn't taking up much room, and I was under the impression that the ram was 2k.
I also know that there are 'pages' to the RAM.· I read "ExploringtheSX" and the DataSheet, but I am pretty lost on what to do.
Could somebody point me to information on getting some more variables in there?
I am hoping that there is a way, incase I want to send a UART message·"This message is more than 20 characters." to the chip.
Please help.
Shaun
Post Edited (Steel) : 6/21/2006 6:56:03 PM GMT
"Variable Exceed Available RAM".· Are there only 20 bytes of available RAM space?· I know my code isn't taking up much room, and I was under the impression that the ram was 2k.
I also know that there are 'pages' to the RAM.· I read "ExploringtheSX" and the DataSheet, but I am pretty lost on what to do.
Could somebody point me to information on getting some more variables in there?
I am hoping that there is a way, incase I want to send a UART message·"This message is more than 20 characters." to the chip.
Please help.
Shaun
Post Edited (Steel) : 6/21/2006 6:56:03 PM GMT
Comments
Post your code so people can see what you're doing instead of guessing.
Thanks, PeterM
2K is the PROGRAM space. Variable space is much smaller.
Due to RAM banking, SX/B has a limited number of "normal" variables.
If you need more use arrays. Arrays use a different section of RAM.
As Peter suggested, please post your code...
Bean.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Cheap 4-digit LED display with driver IC·www.hc4led.com
Low power SD Data Logger www.sddatalogger.com
"I reject your reality, and substitute my own." Mythbusters
·
I Changed the actual names to just the initials...so that may be confusing. Im sorry, but it's just for code protection.
and sorry about the messy code...· :S
Change your PC_RECEIVED_BYTE_x variables to an Array.
PC_RECEIVED_BYTE VAR BYTE (10)
Then you can use PC_RECEIVED_BYTE(0) thru PC_RECEIVED_BYTE(9).
Bean.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Cheap 4-digit LED display with driver IC·www.hc4led.com
Low power SD Data Logger www.sddatalogger.com
"I reject your reality, and substitute my own." Mythbusters
·
The SX48 supports large arrays (up to the entire array space).
Bean
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Cheap 4-digit LED display with driver IC·www.hc4led.com
Low power SD Data Logger www.sddatalogger.com
"I reject your reality, and substitute my own." Mythbusters
·