2 Replies Latest reply on Jan 5, 2016 11:31 AM by userc_40279

    Question about 8051 'xdata' not 'working' ...



      I'm making a small modification to a project that appears to use various global variables declared as 'xdata'.


      I added my own variable, that I return on an IN endpoint:


      xdata BYTE test;


                  test = 0xAB;
                  EP1INBUF[0] = test;


                  EP1INBC = 1;


      If my windows app reads this endpoint, it reads the value '0'.
      However, if I remove the 'xdata' declaration, my windows app DOES actually read '0xAB'.


      What is going on here, and how do I make 'xdata' work? (This is stripped down code to show the issue, I need 'xdata' because I want to use EZUSB EEPROM routines that have 'BYTE xdata *dat' arguments.


      ~ Paul Claessen