Hi guys, I'm hoping someone has been here before and can help me out with this. I've got a big pile of code that runs nicely on the AT89C51ED2 chip. But I'm running low on variable space, so thought "hey, I'll use some of that XRAM on the chip".
Er, no you won't Mike. It doesn't want to play.
Just to complicate matters I've got a bit of genuine IO hooked up to the bus (which all works fine), as follows:
xdata volatile ubyte gpcRCBaseAddress[8] _at_ 0x8000;
and I use the eeprom by pretending it's variable memory:
xdata volatile ubyte eepromaddress[2048] _at_ 0x2000;
So, how do I get to use the genuine on-chip XDATA. Just declaring xdata variables doesn't work - the compiler seem to think it's off chip xdata.
If I try to turn XDATA on the hard way: AUXR = 0x11 Then the entire processor appears to slow down to a crawl. It might be that I've disabled the I/O which made everything else slow down, although the chip hanging off the I/O still functions perfectly, just verrrry slowly.
I had a quick play with startup.a51 (not used that before), defining: XRAMEN EQU 1 XDATASTART EQU 0H ; the absolute start-address of XDATA memory XDATALEN EQU 7FFH ; the length of XDATA memory in bytes. Which had no effect whatsoever
And I tried ticking the box in project options for 'Use on-chip XRAM', which just gave me a link error about XDATA: *** ERROR L107: ADDRESS SPACE OVERFLOW SPACE: XDATA SEGMENT: ?XD?READERMAIN
So I'm all out of ideas. Anyone able to help ?
That should be "your startup.a51 file...", of course!
eg, see:
http://www.keil.com/support/docs/610.htm
and other links