I want to have an array that is larger an 65535 bytes. I need to be able to address this array a byte at a time. Can I simply use a index that is defined as a long? Do I have to break the array up into two parts - the first 64K and "the rest"? What is the best way to do this? Thanks in advance.
What 8051 variant are you using? Jon
We are using the 8031
How much XDATA do you have and how do you access A16, A17, A18, and so on? Note: The 8031 only has 16 address lines (A0-A15) and therefore only supports 65536 bytes of XDATA. Jon
I guess that answers my question. I would have to use one of the 8031 ports to manufacture an A16 signal whenever I wanted to reach a memory location between 64K and 128K. Then I would write a set of read/write routines that would decode an address value (defined as a long) into the port driven A16 and the uC generated A0 to A15. Does the 8051 support more address lines than the 8031?
No
Note that we do support XDATA banking in the latest tools. This is a NEW feature and there isn't a lot of documentation available for it, yet. However, it also isn't all that complex. Take a look at the latest newsletter: http://www.keil.com/newsletters/2001sp_keil.pdf Page 2 documents how to configure generic 24-bit pointers for ANY 8051-compatible part. To summarize, there is a configuration file named XBANKING.A51 found in the \KEIL\C51\LIB directory. This file contains routines that read and write bytes, words, and dwords using 24-bit addresses. In your C code you simply refer to these as far data types. For example:
unsigned char far big_array [1234];
http://www.keil.com/newsletters/2001sp_keil.pdf Ouch! That's a 1-hour, 6.5MB download!! Got anything a little more succinct!?
That's a 1-hour, 6.5MB download!! No it's not, about 30 seconds here. Time to get a better cablemodem provider. I love 1.5Mbit/s downstream! :-) - Mark
Is that compatible with the 240psi steam pressure over here? Maybe I should fit a superheater? Or is it something to do with that new fangled "Electricity" stuff?
Andrew, Just take a look at the XBANKING.A51 file. That'll explain it all. Jon