Notes while learning the P89C664 Microcontroller - XRAM


 
        I'm sure that those of you who have used this or similar microcontrollers in the past are no strangers to the following:

        "The 8051 type micro I'm using has 2K of ram but no ram above 0x00FF seem to be working.".

        Well, I ran into this while debugging some stepper motor control code this morning. Now it makes sense that anyone selling an 8051 compatible (code as well as footprint) microcontroller should make it operate as much like the original as possible as a default. The original 8051 had no extra ram so the default is to disable any 'extra' memory and I have no complaint with it. I just needed to figure out how to make the extra memory (2K - 256 bytes in my case) show up in the memory map. I realized that there must be a special function register setting for this feature and so I did what I usually do when I don't know something, I googled for the info. Unfortunately in this case I came up dry so I next went to the datasheet from Philips (in pdf format). In short order I found that there is indeed a special function register with the nondescript name of AUXR (address 0x8E) which contains a single bit labeled EXTRAM ( bit 1 ). Further reading showed me that when this bit is set to ZERO the "extra" ram in the P89C664 is mapped into XDATA space and it thereby available to the application.

        I added a write to the specified bit (0=enable), recompiled the code and the memory started working for me. Not really a big deal but it might come in handy for anyone else going down this path.


-- Arkwolf --