Address Decoder (DEC)
500
SNIU028A – February 2016 – Revised April 2016
Copyright © 2016, Texas Instruments Incorporated
Control System Module
The Memory Fine Base Address Low Registers 1 – 3 (MFBALRx) are loaded as follows:
•
MFBALR1 – The BLOCK_SIZE field is loaded with a 6. This means that the Program Flash is at
0x10000, and is 32KB long.
•
MFBALR2 – BLOCK_SIZE = 2, ADDRESS = 0x22 – Data flash = 2KB at 0x18800
•
MFBALR3 – BLOCK_SIZE = 3, ADDRESS = 0x24 – RAM = 4KB at 0x19000.
Now that the other memories are mapped, the ROM is moved to fill the entire 64K space starting at zero.
This is done at this point so that the ROM can still control the interrupt vectors at 0, all the other memories
can be read and written, and the ROM can still execute at 0xA000.
This is done by modifying the MFBALR0 register, which controls the ROM address, and also enables the
memory map.
MFBALR0 – BLOCK_SIZE = 7, RONLY = 1, MS = 1. (ADDRESS is left at 0)
This does all that is described above, as well as making it a fault if the program attempts to write to the
ROM. All of the statements above are shorthand descriptions, not C code. In fact, to save space in the
ROM a single constant is written to each register, with all the bit fields properly placed in it.
After the memory map is initialized in this pattern, the ROM program performs a simple additive checksum
on the Program Flash. If the checksum matches, the ROM program then reconfigures the memory map
and jumps to location zero in the flash.
There is also a PMBus command that can command the ROM program to do the same thing.
This reconfiguration involves two steps:
1. Remap the ROM to 0xA000 only
2. Remap the Program Flash to location 0
So the memory map when the Program Flash is running is:
Table 16-1.
Memory
Start
End
Program Flash
0
0x7FFF
ROM
0xA000
0xAFFF
Data flash
0x18800
0x18FFF
Program Flash
0x19000
0x19FFF
There should be no need to modify any of the memory base address registers. In fact it is highly
recommended against modifying them because it is very easy to cause a fault which will cause the CPU
to be reset.
16.1.6 Erasing the Programming Flash
There will be frequent need for programming data Flash memory, for changing default values, for
calibration, and for data logging. Program flash modification is much more difficult, and less likely to be
needed.
Note that all flash operations other than read involve considerable delay. Erase delays, especially, can be
several milliseconds. Consult UCD3138 datasheet for specific delay information.
16.1.7 Waiting for Flash Operations to Finish
All flash modifications take more than one instruction cycle to complete. Both flash control registers have a
BUSY bit that should be checked to verify that no flash process is already underway.