Hi guys,
I tried to construct a waveform with more than 6000 points. the program is like:
arg.h . . int xdata wave[6000] . . main(){ . . for...{ wave[i]=i*10; . } .
it passed the compiling and linking. it showed that xdata=12131. but when i ran the program, it's actually showing a messed up waveform. it only works correctly when i reduced the size of the wave[] to 4000, which makes xdata=8131.
i m using version 7.2, and the xram on the board is 128k. i think it's something missing in the program but couldnt figure it out yet since i m just a beginner of mcu programing in c. any suggestion? i really appreciate it.
is there anything to do with the 8k issue i just read
No. That's quite a different issue. For starters, your array is not an initialized variable.
thanks for the advice. i dont have a simulator. and i dont think it's the banking problem either. I changed the compile option to fixed the variables order. It actually allow the program doing what it's supposed to do with the wave[] as large as 32000, except any point higher than index 4000, goes back to the value of index 0, which makes me think it might be related to that '8k' problem.
A standard 8051 cannot directly address 128K - so this must mean that you have some kind of banking arrangement?
Are you certain that your banking is working correctly - and that it doesn't have any issues related to 8K boundaries...?
If it does, that suggests that there's an issue with your hardware;
If it doesn't, then there's something more fundamental...
Thank you! but that was a bad example, because even I changed it to:
unsigned int xdata wave[6000]
main(){ . wave[i]=10; . .
I still have the same problem if the size is more than 4000. is there anything to do with the 8k issue i just read http://www.keil.com/support/docs/2177.htm ?
i=5999 -> 10*i = 59990. Max integer size is 32767. See any problem?
View all questions in Keil forum