We are running a survey to help us improve the experience for all of our members. If you see the survey appear, please take the time to tell us about your experience if you can.
SFRs are declared in the same fashion as other C variables. The only difference is that the data type specified is sfr rather than char or int. I can't declare sfr to refer xdata. TUSB3210 has some registers there.
The Philips 80C51MX provides an additional extended SFR space with the address range 0x180 to 0x1FF. How much did Philips pay for thses locations to be SFRs? Well, the 8051MX has additional instructions AND additional memory areas. The NEW instructions in the MX are NOT compatible with the legacy 8051 instruction set. Furthermore, the additional SFR memory is not available on legacy 8051 devices. Some of the new instructions provide access to the new SFRs. Intel did something similar with the 251. The added new instructions and several new memory areas and lots of new SFRs. They even added 16-bit and 32-bit registers. Legacy 8051 devices (which is most of them) only have 128 bytes of SFRs PERIOD. The reason for this limitation is the addressing method. Refer to any good 8051 user guide for more information. When a chip is augmented with lots of new instructions and memory areas (like the 8051MX or the 251) a new compiler is required. The cost of developing and testing a new compiler is pretty expensive. But, it's probably not as expensive as designing new silicon and making several new microcontrollers. But, I don't think this was the point of your original question. Were you finally able to define XDATA registers for the 3210? If not, the following may be helpful:
#include <absacc.h> #define IEPCNFG_0 XBYTE[0xFF80] #define IEPBCNT_0 XBYTE[0xFF81] #define OEPCNFG_0 XBYTE[0xFF82] #define OEPBCNT_0 XBYTE[0xFF83] #define INTCFG XBYTE[0xFF84]