USER'S GUIDE

SOFT RELOAD OF A DS5001/DS5002

When application software decides that it should repro- gram a portion of memory, the software must convert the target area into data memory. However, a Soft Re- load of a DS5001 series device has minor variations from the DS5000 version. First, there is no PAA bit in the DS5001. If the DS5001 is in a Partitionable mode then the user's program must manipulate the Partition con- trol bits PA3±0, placing the Partition to a value that per- mits the target area to be loaded. Moving the Partition to a new value should convert the target area to data memory allowing read/write access. The user's loader routine then uses MOVX instructions to load the new program contents into memory. This program can be re- ceived from a serial port or other mechanism. When the loading procedure is complete, a new Partition (or the old one) must be loaded. Note that the loader routine must reside below the Partition at all times.

In the DS5000 series, the PAA bit was protected by a Timed Access procedure. In the DS5001, the PA3±0 bits are protected directly. The user's program must use a Timed Access procedure to alter these bits. The mi- crocontroller further protects the application by not per- mitting software to write a 0000b into PA3±0. This would cause a program memory area of 0K. Timed Access is discussed in a later section.

If the device is in a non±partitionable configuration, then an extra step is required. To perform a Soft Reload of the program contents in a non±partitionable mode, the soft- ware must convert the micro to a Partitionable mode temporarily. The Access Enable bit (RPCTL.4) will ac- complish this. Setting the AE bit to a logic 1 converts the DS5001 into a Partitionable mode for as long as it is set. This means that regardless of the original setting, once AE=1, the memory map is a 64K partitionable mode. The Partition is set to 1000h (4K) when AE=1, so the loader routine must reside in this area. The user can then perform the Soft Reload as discussed above. When loading is complete, the software should clear the

AE bit. Note that AE requires software to use a Timed Access procedure to alter it. This method allows a user to alter program memory in a non±partitionable mode. Data memory can be initialized by application software at any time. Since full read/write access is available, no special provisions are needed.

To summarize the ªSoft Reloadº for a DS5001/DS5002, the procedure goes as follows:

Partitionable mode

1.Write a value to PA3±0 using a Timed Access that gives access to the target area of memory.

2.Load new contents into program memory at ad- dresses above the Partition using MOVX instruc- tions.

3.Define a new Partition address if necessary and write the appropriate bits into PA3±0 in the MCON SFR using a Timed Access.

4.Resume operation.

Non±Partitionable mode

1.Set the AE bit to a 1 using a Timed Access proce- dure.

2.Load new contents into program memory at ad- dresses above the Partition (4K) using MOVX instructions.

3.Clear the AE bit using a Timed Access procedure.

4.Resume operation.

The following illustrates an example where a Soft Re- load is performed for a Partitionable mode. The original program requires a partition of 4000h (16K bytes). The new program is larger, requiring a Partition of A000h (40K bytes). A loader routine resides below address 1000h. The code that performs these steps is shown be- low. Note that the Timed Access procedure is per- formed, but is described in a later section.

050396 25/173

26

Page 26
Image 26
Mitsubishi DS907x SIP, DS5000TK manual Soft Reload of a DS5001/DS5002