SNIU028D February 2016 – September 2020 UCD3138 , UCD3138064 , UCD3138064A , UCD3138128 , UCD3138A , UCD3138A64
The UCD3138 has only one memory bus used for both program and data.
Memories are called “Program” Flash” and “Data” Flash, but all memories can be used for both.
The names just show the main use for each memory.
After reset, the UCD3138 starts executing in ROM. In this mode, the ROM is mapped to fill up the entire first 64 Kbytes of memory. The 4 Kbytes of ROM are repeated 16 times.
Here is the memory map for ROM mode:
0x00000 => 0x0FFFF => Boot ROM - 4 Kbytes, repeated 16 times.
0x10000 => 0x17FFF => Program Flash - 32 Kbytes
0x18800 => 0x18FFF => Data Flash - 2 Kbytes
0x19000 => 0x19FFF => Data RAM - 4 Kbytes
If the ROM finds a valid checksum for the Program Flash, or if a PMBus command is sent telling the ROM to transfer control to the flash, the memory map is changed a little bit.
Here is the memory map during normal operation:
0x00000 => 0x07FFF => Program Flash - 32 Kbytes
0x0A000 => 0x0AFFF => Boot ROM - 4 Kbytes
0x18800 => 0x18FFF => Data Flash - 2 Kbytes
0x19000 => 0x19FFF => Data RAM - 4 Kbytes
In ROM mode, the reset and interrupt vectors are in the ROM. In normal operation, the reset and interrupt vectors are in the Program Flash.
The two flash memories, “Program” and “Data”, are programmed separately. Each has its own programming logic. When a Flash memory is being programmed, it cannot be read.
Flash memories can be programmed word by word, but must be erased a block at the time. The Data Flash has 64 small blocks containing only 32 bytes each. This makes it ideal for storing small blocks of data which need to be changed frequently.
The Program Flash has only 32 blocks, and each one contains 1KB.
For more information on memory maps for all family members, see Chapter 15, Memory.