Why is the Upper Byte of Data Memory Always 00 or FF?

<< Click to Display Table of Contents >>

Navigation:  eTPU Development Tool (ASH WARE, Inc.) >

Why is the Upper Byte of Data Memory Always 00 or FF?

Previous pageReturn to chapter overviewNext page

Why is the Upper Byte in the Memory Window always 0xFF or 0x00?

As shown by in the red circles in the picture below:

UpperByte0x00_or_0xFF

This is a 24-bit representation of the memory! Bit 23 is sign-extended to the upper byte, bits 31...24.

You can view the entire 32-bits of memory (instead of just the lower 24-bits with sign extension of bits 31...24) by right-clicking your mouse in the window and from the popup menu, selecting the DATA option, as shown below.

UpperByteSelectNormalDataMem

This will give you the normal, full, 32-bit DATA memory, as shown below. See, now the upper byte is valid, and not just a sign-extension.

UpperByteFixed

That is all well and good, BUT WHAT IS GOING ON????

Because you have the memory space set to the PRAM24 address space. This is a 24-bit "mirror" of the normal 32-bit memory space that is organized such that host-side accesses (which are 32-bit) can work right with the eTPU which is essentially a 24-bit machine. The mirror shows the same physical memory as the normal "Data" memory. The MPC5554, the memory map is shown below.

UpperByteMemoryLayout

So the PRAM24 window displays the memory as seen at address 0xC000 to 0xFFF. The normal PRAM memory shows the memory at address 0x8000. These addresses are from the HOST's perspective in MPC5554, other micros will vary.

WHY???

Host-side accesses are treated as 24 bit signed numbers such that the upper byte of a 32-bit write is ignored (making it a 24-bit write, something neither the PPC nor the COLDFIRE supports.) Also 32-bit reads do not read the upper byte, instead, bit 23 is sign-extended to the entire upper byte such that the read is essentially a 24-bit read, sign extended to 32 bits.

This allows fast accesses by the 32-bit host to the eTPU's memory whose native format is 32-bit.