
Segment 3
Main Memory (devices</=32kB NVM Memory)
0FFFFh
00000h
Segment 2
Segment 1
Border (B2)
Border (B1)
MPU Segments
6.2
MPU Segments
6.2.1 Main Memory Segments
The MPU offers the option to logically divide the main memory into three segments. The size of each
segment is defined by appropriately setting the borders between adjacent segments. To configure three
segments, a lower (B1) and higher (B2) border needs to be programmed by control register bits
MPUSB1[4:0] and MPUSB2[4:0] of the MPUSEG register, respectively. Each segment consists of pages.
The smallest size of a segment is a page, and therefore sets the granularity of a segment. A page size is
restricted to 1/32 of the implemented memory size. For example, a device with a main memory size of
16KB would result in a page size of 512B.
The beginning of segment 1 is the lowest available address for the main memory as defined in the device-
specific data sheet. The setting of the lower border (B1) defines the end of segment 1 and the beginning
of segment 2. Similarly, the end of segment 2 and beginning of segment 3 is defined by the higher border
(B2). Lastly, the end of segment 3 is given by the highest main memory address as defined in the device-
specific data sheet. The segmentation of the main memory is shown in
.
The address bus (MAB) is analyzed by the MPU along with the current border settings to determine which
segment of memory is selected. If the address is lower than B1 and B2, segment 1 is selected. For
address values between B1 and B2, segment 2 is selected. For address values larger than B1 and B2,
segment 3 is selected. Setting B1 equal to B2 results in the memory being partitioned in only two
segments.
Figure 6-2. Segmentation of Main Memory
6.2.2 Segment Border Setting
describes the procedure of setting borders for segmentation of the main memory. This
section describes how the values in MPUSB1[4:0] and MPUSB2[4:0] bits need to be set to achieve the
desired borders for different memory sizes. The bits of the MUSBx[4:0] bits represent the five most
significant bits of the border address that can be selected. Therefore, the granularity of the border settings
and the minimum segment size is 512 bytes in a 16KB device, 256 bytes in a 8KB device, and 128 bytes
in a 4KB device.
253
SLAU272C – May 2011 – Revised November 2013
Memory Protection Unit (MPU)
Copyright © 2011–2013, Texas Instruments Incorporated