SNIU028D February 2016 – September 2020 UCD3138 , UCD3138064 , UCD3138064A , UCD3138128 , UCD3138A , UCD3138A64
As previously mentioned UCD3138 (ARM7TDMI-S) is based on Von-Neumann architecture, with a single bus providing access to different memory modules and peripherals.
Within the UCD3138 architecture, there is a 2048x32 bit Boot ROM that contains the initial firmware startup routines for PMBUS communication and non-volatile (FLASH) memory download. This Boot ROM is executed after power up reset and the code will determine if there is a valid FLASH program written. If a valid program is present, the ROM code branches to the main FLASH program execution.
UCD3138 also supports customization of Boot program by allowing an alternative booting routine to be executed from program Flash. This UCD3138 feature enables assignment of unique address to each device therefore supporting firmware reprogramming even when several devices are connected on the same communication bus.
This is accomplished using multiple checksums at different locations in Program FLASH. Other 3138 family members even support multiple program images. See Chapter 13 for more information on how this is done.
Two separate FLASH memories are present inside the device. The 32KB Program FLASH memory is organized as an 8Kx32 bit memory block and is intended to be for firmware program space. The block is configured with page erase capability for erasing blocks as small as 1KB per page, or with a mass erase for erasing the entire program FLASH array. The FLASH endurance is specified at 1000 erase/write cycles and the data retention is good for 100 years. The 2KB Data FLASH array is organized as a 512x32 memory. The Data FLASH is intended for firmware data value storage and data logging. Thus, the Data FLASH is specified as a high endurance memory of 20K cycles with embedded ECC (Error correction code) mechanism. The Data Flash can be mass erased, or erased in 32 byte blocks.
The ARM7 has its reset and interrupt vectors mapped starting at address zero. At reset, the ROM is mapped to start at zero. In program flash execution, the program flash needs to be mapped to zero. The UCD3138 has programmable memory addressing which is used by the Boot ROM to remap the memories. With the UCD3138, there is no need for the customer to remap memory. However, with the 3138064 and other family members, it may be useful. These chips have more than one program flash block. This makes it possible to store more than one program version on the same chip. Each version can be mapped to location zero for efficient
For run time data storage and scratchpad memory, a 4KB RAM is available for firmware usage. The RAM is organized as a 1024x32 bit array. This feature can even be used to download a new version while executing from an existing one. It is possible to switch versions without powering down the supply. When the device comes out of reset, the program memories are mapped as follows:
Module | Size (KB) | Memory Select | Start Address | ||
---|---|---|---|---|---|
3138 | 3138064/A64 | 3138128 | |||
Boot ROM | 8 | 0 | 0 | 0 | 0 |
Program Flash 0 | 32 | 1 | 0x10000 | 0x40000 | 0x40000 |
Program Flash 1 | 32 | 17 | – | 0x48000 | 0x48000 |
Program Flash 2 | 32 | 18 | – | – | 0x50000 |
Program Flash 3 | 32 | 19 | – | – | 0x58000 |
In ROM mode, ROM extends from 0 up to start of program flash – the same 8KB block is repeated many times.
The large ROM area is needed because the ROM needs to jump from its ROM mode address to its Flash mode address before it moves the Flash to location 0. After boot ROM transfers control to program in Flash memory, memory gets remapped as follows:
Module | Size (KB) | Memory Select | Start Address | |||||
---|---|---|---|---|---|---|---|---|
3138 | 3138064/A64A | 3138A64 | 3138128 | |||||
Mode 1 | Mode 2 | Mode 1 | Mode 2 | |||||
Program Flash 0 | 32 | 1 | 0 | 0 | 0x8000 | 0 | 0 | 0x10000 |
Program Flash 1 | 32 | 17 | – | 0x8000 | 0 | 0x8000 | 0x8000 | 0x18000 |
Program Flash 2 | 32 | 18 | – | – | – | – | 0x10000 | 0 |
Program Flash 3 | 32 | 19 | – | – | – | – | 0x18000 | 0x8000 |
Boot ROM | 8 | 0 | 0xA000 | 0x20000 | 0x20000 | 0x20000 | 0x20000 | 0x20000 |
Mode 1 and Mode 2 are provided so that multiple versions can be supported by the Boot ROM. The put different flash blocks or pairs of flash blocks at location 0. The Data Flash and RAM are always in the same locations regardless of ROM or FLASH mode.
Module | Size (KB) | Memory Select | Start Address | ||
---|---|---|---|---|---|
3138 | 3138064 | 3138128/A64 | |||
Data Flash | 2 | 2 | 0x18800 | 0x68800 | 0x69800 |
Data RAM | 4/8 | 3 | 0x19000 | 0x69000 | 0x6A000 |
The ‘128/’A64 devices have 8 KB of data RAM, the other devices have 4KB.
Address | Size | Module | Comment |
---|---|---|---|
0x0002_0000 - 0x0002_00FF | 256 | Loop Mux | Memory Select[4] |
0x0003_0000 - 0x0003_00FF | 256 | Fault Mux | Memory Select[5] |
0x0004_0000 - 0x0004_00FF | 256 | ADC | Memory Select[6] |
0x0005_0000 - 0x0005_00FF | 256 | DPWM 3 | Memory Select[7] |
0x0006_0000 - 0x0006_00FF | 256 | Filter 2 | Memory Select[8] |
0x0007_0000 - 0x0007_00FF | 256 | DPWM 2 | Memory Select[9] |
0x0008_0000 - 0x0008_00FF | 256 | Front End/Ramp I/F 2 | Memory Select[10] |
0x0009_0000 - 0x0009_00FF | 256 | Filter 1 | Memory Select[11] |
0x000A_0000 - 0x000A_00FF | 256 | DPWM 1 | Memory Select[12] |
0x000B_0000 – 0x000B_00FF | 256 | Front End/Ramp I/F 1 | Memory Select[13] |
0x000C_0000 - 0x000C_00FF | 256 | Filter 0 | Memory Select[14] |
0x000D_0000 - 0x000D_00FF | 256 | DPWM 0 | Memory Select[15] |
0x000E_0000 - 0x000E_00FF | 256 | Front End/Ramp I/F 0 | Memory Select[16] |
0xFFF7_EC00 - 0xFFF7_ECFF | 256 | UART 0 | Peripheral Select[4] |
0xFFF7_ED00 - 0xFFF7_EDFF | 256 | UART 1 | Peripheral Select[4] |
0xFFF7_F000 - 0xFFF7_F0FF | 256 | Miscellaneous Analog Control | Peripheral Select[3] |
0xFFF7_F600 - 0xFFF7_F6FF | 256 | PMBus Interface | Peripheral Select[2] |
0xFFF7_FA00 - 0xFFF7_FAFF | 256 | GIO | Peripheral Select[1] |
0xFFF7_FD00 - 0xFFF7_FDFF | 256 | Timer | Peripheral Select[0] |
0xFFFF_FD00 - 0xFFFF_FDFF | 256 | MMC | SAR Select[2] |
0xFFFF_FE00 - 0xFFFF_FEFF | 256 | DEC | SAR Select[1] |
0xFFFF_FF20 - 0xFFFF_FF37 | 23 | CIM | SAR Select[0] |
0xFFFF_FF40 - 0xFFFF_FF50 | 16 | PSA | SAR Select[0] |
0xFFFF_FFD0 - 0xFFFF_FFEC | 28 | SYS | SAR Select[0] |
The registers and bit definitions inside the System and Peripheral blocks are detailed in the next chapter. This chapter gives the register reference for the memory controller and address decoder, but the details of its use are in the next two chapters. Note that on 3138 family members with more than one flash block, all the memory select peripherals start at 0x00120000 instead of 0x00020000.