This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

XDATA problem

Hopefully someone can Help,

I'm working on a project with the Atmel AT89C51ED2 processor. I have selected the AT89C51RD2 controller from the device database (If I'm not mistaken the only difference is the EEPROM which I'm not using..... Yet).
I have a project which works correctly (in the simulator) except when Xdata is used. I have gone through tens of threads and can not find the answer.
I have edited the Startup.A51 code which seems to work (clears 0x6FF bytes of data) cleared bit 1 of AUXR. All seems to be OK. I suspect the simulator, I have checked the memory mapping, and that also seems to be OK. Everything is working except Xdata.

Any thoughts of anything else I can try..??

Any suggestions appreciated.

Regards
John Garrelts

Parents
  • It was most probably optimised out...

    Here's what I get for the compiler output. As you can see, the access to xdata was not "optimized out". Maybe there was another reason this didn't work.

    line level    source
    
       1
       2
       3          xdata unsigned char test;
       4
       5
       6          void main(void){
       7   1        test = 0xFF;
       8   1        }
    
    ASSEMBLY LISTING OF GENERATED OBJECT CODE
    
                 ; FUNCTION main (BEGIN)
                                               ; SOURCE LINE # 6
                                               ; SOURCE LINE # 7
    0000 900000      R     MOV     DPTR,#test
    0003 74FF              MOV     A,#0FFH
    0005 F0                MOVX    @DPTR,A
                                               ; SOURCE LINE # 8
    0006 22                RET
                 ; FUNCTION main (END)

    Jon

Reply
  • It was most probably optimised out...

    Here's what I get for the compiler output. As you can see, the access to xdata was not "optimized out". Maybe there was another reason this didn't work.

    line level    source
    
       1
       2
       3          xdata unsigned char test;
       4
       5
       6          void main(void){
       7   1        test = 0xFF;
       8   1        }
    
    ASSEMBLY LISTING OF GENERATED OBJECT CODE
    
                 ; FUNCTION main (BEGIN)
                                               ; SOURCE LINE # 6
                                               ; SOURCE LINE # 7
    0000 900000      R     MOV     DPTR,#test
    0003 74FF              MOV     A,#0FFH
    0005 F0                MOVX    @DPTR,A
                                               ; SOURCE LINE # 8
    0006 22                RET
                 ; FUNCTION main (END)

    Jon

Children