OK, so for myself and others out there I wanted to clarify I am correct on how I am reading datasheets such as the one in the image below. The thing is the data sheet of this MCU says it is 16-bit registers but it looks to me like it has 32-bit addressing space.

enter image description here

The base address 5 hex values and if I were to just replace the offset with the last three hex values that would be 20-bit addressing which seems totally wrong to me. Whereas if I add the offset to the end of the base I get a 32-bit address, 4 bits per the 8 hex values. But again this is a 16-bit MCU so I am confused as to how to get a 16-bit address from what I am looking at.

If someone could should me what is wrong with the way I am reading this that would be great!

  • 1
    \$\begingroup\$ Perhaps you're concatenating Base 0100 and Offset 0002 to get 01000002 instead of adding to get 0102. \$\endgroup\$ – user_1818839 Oct 5 '20 at 23:04
  • 1
    \$\begingroup\$ Where do you get "5 hex values"? you don't count the 'h' at the end, that just eans to interpret the previous 4 characters as hexadecimal. It is only 4 hex values. \$\endgroup\$ – Kevin White Oct 6 '20 at 0:12

The base address 5 hex values ...

The base addresses are four hex digits long. The offsets are two.


0100h = 0x0100 = 0000 0001 0000 0000
+004h = 0x0004 = 0000 0000 0000 0100
        Sum    = 0000 0001 0000 0100 = 0104h = 0x0104

The base and offset values are simply added. For example, 012016 + 0A16 = 012A16.

Have a look into the header files that your compiler actually uses. The msp430fr2000_symbols.ld file for gcc says:

PROVIDE(PMMCTL0            = 0x0120);
PROVIDE(PMMCTL2            = 0x0124);
PROVIDE(PMMIFG             = 0x012A);
PROVIDE(PM5CTL0            = 0x0130);

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.