Hi.
I have a feeling, Keil is using only lower 128Bytes Data space of my ADuC814. The ADuC manual says, it has a lower RAM (00H - 7FH), and upper RAM (80H - FFH). The upper RAM is addressable by indirect adressing. Can anyone write one line as example, how should I make it in C for Keil? Do I need to change any other seetings?
Look up the 'data' and 'idata' keywords in the manual...
http://www.keil.com/support/man/docs/c51/c51_le_memareas.htm http://www.keil.com/support/man/docs/c51/c51_le_memtypes.htm
... and also look up the various memory models while you're at it. You'll see that C51 will not use the upper 128 bytes of RAM unless you explicitly tell it to do so by using the idata specifier.
Thank you so much for your replies. You've been very helpful. The problem solved - instead of:
int i;
one should write:
int idata i;
and that's it.
before writing
for any memory space in an 8051, one should think very carefully about whether an 'int' is really needed - or will a 'char' do?
And should it be unsigned?
When running out of 'data' space do not willy-nilly change some variables to 'idata'. The access of an idata variable is slower than the access of a data variable
First check arrays (data/idata makes no difference unless addressed by fixed offsets). Then find some rarely used variables and change them. then ... well you should have gotten the drift by now.
Erik