
*****************************************************************************
*                                                                           *
*                                                                           *
*     HELP FOR ATMEL and the formerly ATMEL WIRELESS MICROCONTROLLERS       *
*                      (informal document)                                  *
*                                                                           *
*****************************************************************************


****************************************************************************
T87C5111
T87C5112
--------

Encryption Array and configuration byte are supported on these devices.
Lock bits are part of the configuration byte.
Data in the programmer's User Memory is partitioned as follows:

                                  87C5111            87C5112
                             =================    ================
  MAIN ARRAY DATA                0 - FFF hex          0 - 1FFF hex
  ENCRYPTION ARRAY DATA      1000 - 103F hex       2000 - 203F hex
  CONFIGURATION BYTE                1040 hex              2040 hex

To enable encryption array programming set
"Program device->Program XNOR data" option to "Y".

To enable configuration byte programming set
"Program device->Program configuration." option to "Y".

Enter Encryption Array data by editing the appropriate address in User
Memory.

After the Encryption Array is programmed, device data will no longer
match data in User RAM. Encryption Array data cannot be read from the
device.

The content of the configuration byte is as follows:

   Bit 7 = Lock bit 1
   Bit 6 = Lock bit 2
   Bit 5 = Lock bit 3
   Bit 4 = Selected oscillator at reset
   Bit 3 = Crystal oscillator speed
   Bit 2 = External reset (Always programmed as 1)
   Bit 1 = Control for watchdog RC oscillator
   Bit 0 = Reserved (Always programmed as 1)

NOTE : Bit 0 and Bit 2 of the configuration byte are always programmed
       as 1 irrespective of the content of the user memory.
       Any operations attempted after programming Bit 3 and 4 of the
       configuration byte may not work properly.

****************************************************************************

 89C51AC2 / 89C51CC01:
--------------------

Unisystem RAM mapping:
----------------------
       0x0000- 0x07FFF    User Memory (FM0)
       0xF000- 0x0F7FF    Data Memory (EEPROM)2KB
       0xF800- 0x0FFFF    Boot Memory 2KB (FM1)
       0x10000-0x10004    XA flash mem
       0x10005-           HSB (1byte)
Please refer figure 1 for pictorial representation

XAF Details:
-----------
Details of XA flash locations and their significance: This memory can be
programmed by setting Program Configuration data Option to 'Y'
If the chip is erased, this XAF array is filled with the default values
Id locations i.e 0030h, 0031h, 0060h, 0061h are filled with a constant data
viz. 58h, D7h, F7h, FFh every time the Program XAF operation is selected.

Ram Location            XAF Address     Default data
-----------             -----------     ------------
0x10000                  0x0000            0xFF          Boot Status Byte
0x10001                  0x0001            0xF8          Software Boot Vector
0x10002                  0x0004            0xD8          Copy of HSB **Note1
0x10003                  0x0006            0xFF          Extra Byte
0x10004                  none                            not used

**Note1: This location is filled with HSB copy irrespective of what is present
in the corresponding Ram location(0x10002). However, while reading, it displays
the data that is present in Copy of HSB location. This data is valid only
after a read operation.
In verification, the contents of the device are compared with the HSB directly.

HSB Contents (1byte) - Ram mapping 0x10005
-------------------
This memory can be programmed by setting Program Protect Register Option to 'Y'

Here, only bit 6, 7 of the HSB are programmed as per the data in the Ram
location 10005.
Bit 6, 7 of HSB signify  BLJB and X2 respectively.
Bits 0, 1, 2 represent Lock bits and are programmed by selecting 
the options - Program Security bit options to 'Y'
The bits 3,4,5 are reserved and are programmed as per their previously stored
value.


Figure 1:
---------

         Device mapping:
     ----------------------  0
    |User memory FM0       |
    | 0-07FFF hex          |
    |                      |
    |                      |
    |                      |
    |----------------------| 32K


    |----------------------|
    | EEPROM               |
    | F000->F7FF hex       |
    | 2K                   |
    |----------------------|
    | FM1- Boot Memory     |
    | F800->FFFF hex       |
    |                      |
    |                      |
    |                      |
    |----------------------|
    | XA FLASH MEM         |
       (only 4 bytes done)
Ram Location  XAF Location      Default Value
0x10000       0x0000            0xFF        Boot Status Byte
0x10001       0x0001            0xF8        Software Boot Vector
0x10002       0x0004            0xD8        Copy of HSB **Note1
0x10003       0x0006            0xFF        Extra Byte
0x10004       none              0xFF        spare location not used presently

    |----------------------|
    | HSB MEM - 1 Byte     |
           0x10005

         7       6        5        4        3        2        1        0
    |--------|--------|--------|--------|--------|--------|--------|--------|
    |        |        |        |        |        |        |        |        |
    |  X2Bit |  BLJB  |Reserved|Reserved|Reserved|  LB2   |  LB1   |  LB0   |
    |        |        |        |        |        |        |        |        |
    |--------|--------|--------|--------|--------|--------|--------|--------|


*****************************************************************************

AWM 89C5115 / 89C51CC02:
------------------------

Unisystem RAM mapping:
----------------------
       0x0000- 0x03FFF    User Memory (FM0)
       0xF000- 0x0F7FF    Data Memory (EEPROM)2KB
       0xF800- 0x0FFFF    Boot Memory 2KB (FM1)
       0x10000-0x10005    XA flash mem
       0x10006-           HSB (1byte)
Please refer figure 1 for pictorial representation

XAF Details:
-----------
Details of XAFlash locations and their significance:
This memory can be programmed by setting Program Configuration data Option to
'Y'  If the devices is erased the ID locations in the XAF region are reset to
default ID values.  Thge ID locations and their corresponding data can be found
int the device data sheet, but are included here for clarity.
XAF ID Locations: 0030h, 0031h, 0060h, 0061h are filled with the following
constant
XAF ID Default values: 58h, D7h, BBh, FFh

Ram Location  XAF Address Default data    Parameter Name
-----------   ----------- ------------    ----------------------------
0x10000        0x0000     0xFF            Boot Status Byte (BSB)
0x10001        0x0001     0x3F            Software Boot Vector (SBV)
0x10002        0x0002     0xFE            P1_CF
0x10003        0x0003     0xFF            P3_CF
0x10004        0x0004     0xFF            P4_CF
0x10005        0x0005     0xFF            Software Security Byte (SSB)


HSB Contents (1byte) - Ram mapping 0x10006         Default value 0xBF
-------------------
HSB byte is programmed with the data in the Ram location 0x10006.

Here, only bit 6,7 of the HSB are programmed as per the data in the Ram
location 0x10006.

Please see format below regarding programming of bits 6, 7 of
the HSB(BLJB and X2 respectively.)

Bits 0, 1, 2 of the HSB are the devices Lock Bits and are programmed by
setting the "Program security fuse 1, 2, or 3" option.
Bits 3,4,5 of HSB are reserved and are programmed as per their factory default
value.

The device has three lock bits (bit0 - bit2 of HSB byte).These bits are
programmed to '0' (to secure state) if PROGRAM SECURITY FUSE fields in the
Program Memory Device Options screen are set to 'Y'.
Unsecured device has security bits set to '1'.
To set Lock Bits flag in TaskLink you must navigate to the following
Dialog box: Setup -> Programmer Properties... -> "Security" Dialog tab.

Program Security fuse 1 : Lock Bit 1
Program Security fuse 2 : Lock Bit 2
Program Security fuse 3 : Lock Bit 3

Program Lock Bits
------------------------
     LB1    LB2    LB3
     ---    ---    ---
1    U      U      U       No program lock features
2    P      U      U       Further programming of device memory is disabled
3    P      P      U       Further programming and verify is disabled
4    P      P      P       Further programming, verify and external execution
                           is disabled
(U) unprogrammed
(P) programmed


Figure 1:
---------
         Device mapping:
     ----------------------  00000 hex
    |User memory FM0       |
    | 0->03FFF hex         |
    |                      |
    |                      |
    |                      |
    |----------------------| 03FFF hex(32kBytes)
    |                      |
    |   Reserved Area      |
    |                      |
    |----------------------| 0F000 hex
    | EEPROM - Data Memory |
    | F000->F7FF hex       |
    | 2K                   |
    |----------------------| 0F7FF hex / 0F800 hex
    | FM1- Boot Memory     |
    | F800->FFFF hex       |
    | 2K                   |
    |----------------------| 10000 hex
    | XA FLASH MEM         |
    |  (only 6 bytes done) |
    |                      |
Ram Location  XAF Location  Default Value  Parameter Name
------------  ------------  ------------   ----------------------------
0x10000       0x0000        0xFF           Boot Status Byte (BSB)
0x10001       0x0001        0x3F           Software Boot Vector (SBV)
0x10002       0x0002        0xFE           P1_CF
0x10003       0x0003        0xFF           P3_CF
0x10004       0x0004        0xFF           P4_CF
0x10005       0x0005        0xFF           Software Security Byte (SSB)
    |                      |
    |----------------------| 10006 hex
    | HSB MEM - 1 Byte     |
    |      0x10006         |
     ----------------------

Format of the bits in HSB:
--------------------------------
         7       6        5        4        3        2        1        0
    |--------|--------|--------|--------|--------|--------|--------|--------|
    |        |        |        |        |        |        |        |        |
    |  X2Bit |  BLJB  |Reserved|Reserved|Reserved|  LB2   |  LB1   |  LB0   |
    |        |        |        |        |        |        |        |        |
    |--------|--------|--------|--------|--------|--------|--------|--------|

*****************************************************************************

T89C51RD2
--------

Unisystem RAM mapping:
----------------------
       0x00000-0x0FFFF    User Flash Memory
       0x10000-0x10003    XA flash mem
       0x10004-           HSB (1byte)
Please refer figure 1 for pictorial representation

XAF Details:
-----------
Details of XA flash locations and their significance: This memory can be
programmed by setting the appropriate data in the required locations. If the
chip is erased, this XAF array is filled with the default values Id locations
i.e 0030h, 0031h, 0060h, 0061h are filled with a constant data viz. 58h, D7h,
FCh, FFh every time the Program XAF operation is selected. The other XAF
locations are Reserved and not accessible to the user.

Ram Location        XAF Address    Default/Erased data
-----------         -----------     ------------
0x10000              0x0000            0xFF        Boot Status Byte (BSB)
0x10001              0x0001            0xFF        Software Boot Vector (SBV)
0x10002              0x0004            0xFF        Copy of HSB **Note1
0x10003              0x0005            0xFF        Software Security Byte (SSB)

                     0x0030            0x58        Manufacturer Id
                     0x0031            0xD7        Family Code
                     0x0060            0xFC        ID3
                     0x0061            0xFF        ID4
* The Id. locations are not displayed to the user.
**Note1: This location is filled with HSB copy irrespective of what is present
in the corresponding Ram location(0x10002). However, while reading, it displays
the data that is present in Copy of HSB location. This data is valid only after
a read operation.In verification, the contents of the device are compared with
the HSB directly.

HSB Contents (1byte) - Ram mapping 0x10004
-------------------
HSB byte is programmed with the data in the Ram location 0x10004.

Here, only bit 3, 5, 6,7 of the HSB are programmed as per the data in the Ram
location 0x10004.
Bit 3, 5, 6,7 of HSB signify  XRAM,BLLB,BLJB and SB respectively.
Bits 0, 1, 2 represent Lock bits and are programmed by selecting the
options - Program Security bit options to 'Y'
The bits 4 is reserved and are programmed as per their previously stored value.

Bits 0, 1, 2 represent Lock bits and are programmed by selecting the options -
Program Security bit options to 'Y'
The bits 4 is reserved and are programmed as per their previously stored value.

The device has three lock bits (bit0 - bit2 of HSB byte).These bits are
programmed to '0' (to secure state) if PROGRAM SECURITY FUSE fields in the
Program Memory Device Options screen are set to 'Y'.
Unsecured device has security bits set to '1'.
To set Lock Bits flag in TaskLink you must navigate to the following
Dialog box: Setup -> Programmer Properties... -> "Security" Dialog tab.

Program Security fuse 1 : Lock Bit 1
Program Security fuse 2 : Lock Bit 2
Program Security fuse 3 : Lock Bit 3

Program Lock Bits
------------------------
     LB1    LB2    LB3
     ---    ---    ---
1    U      U      U      No program lock features
2    P      U      U      Further programming of device memory is disabled
3    P      P      U      Further programming and verify is disabled
4    P      P      P      Further programming, verify and external execution
                          is disabled
(U) unprogrammed
(P) programmed

Figure 1:
---------

         Device mapping:
     ----------------------  0
    |User memory FM0       |
    | 0-0FFFF hex          |
    |                      |
    |                      |
    |                      |
    |----------------------| 64K(10000H)
    | XA FLASH MEM         |
       (only 4 bytes done)
    |----------------------|
    | HSB MEM - 1 Byte     |
           0x10004

Significance of the bits in HSB:
--------------------------------
         7       6        5        4        3        2        1        0
    |--------|--------|--------|--------|--------|--------|--------|--------|
    |        |        |        |        |        |        |        |        |
    |   SB   |  BLJB  |  BLLB  |Reserved|XRAM    |  LB2   |  LB1   |  LB0   |
    |        |        |        |        |        |        |        |        |
    |--------|--------|--------|--------|--------|--------|--------|--------|

The user has to take care to fill in the appropriate data in the required
locations in XAF

For more details please refer the device data sheet.
