This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

MSP432P401R: Physical Address for GPIOA_EN register.

Part Number: MSP432P401R

Greetings everyone,

I'm new to this forum and the world of microcontrollers. I've been looking through the datasheets for the MSP432P401R microcontroller and I can't find the info I need regarding the physical address for GPIO Port A clock enable register.  I'm trying to activate the registers starting at hex address 0x4000_4C00 as they are currently turned off.  This is the starting address for Port A (ports 1 and 2).  I've found information regarding GPIOA_EN and the offset bits that correspond with this information but not the address of the actual control register.

Any help would be greatly appreciated.

Thanks.

Regards,

  • Michael,

     It's not normally good practice to access registers by their actual numeric address, as this kind of code is not very portable. (i.e. it may only work on 1 specific device and not on device variants with more memory or different peripherals).  

    To avoid this in register-level (aka "baremetal") coding style, you can use predefined acronyms for the registers.  You can find the names of these registers in the MSP432P401 datasheet in Table 6-21. Port Registers (Base Addr:0x4000_4C00).

    An example of accessing the ports using these acronyms is given below:

    // Code example pulled from msp432p401x_p1_03.c Register level example

    // Configuring P1.0 as output and P1.1 (switch) as input with pull-up
    // resistor. Rest of pins are configured as output low.
    // Notice intentional '=' assignment since all P1 pins are being
    // deliberately configured

    P1->DIR = ~(uint8_t) BIT1;
    P1->OUT = BIT1;
    P1->REN = BIT1; // Enable pull-up resistor (P1.1 output high)
    P1->SEL0 = 0;
    P1->SEL1 = 0;
    P1->IES = BIT1; // Interrupt on high-to-low transition
    P1->IFG = 0; // Clear all P1 interrupt flags
    P1->IE = BIT1; // Enable interrupt for P1.1

    Regards,

      Bob

  • Thanks for your time! Not the answer I'm looking for!

    Regards,
  • Michael,
    I'm not able to find a specific reference to GPIOA_EN in our header files or docs. Where are you seeing this register name?
    If you describe what you are trying to do more generally, I could provide some coding options for you either in Reigster-level or (preferred) Driverlib code. The latter uses more portable & more powerful API function calls to manipulate system resources.

    Regards,
    Bob
  • Hello again Bob,
    I'm on a steep learning curve with the MSP432. I'm using the IAR developer software to interface with the board. With this software, I'm able to communicate with the board at the bit level. I've figured out how to set bits in the appropriate registers for the output, direction and resistor enable register. The only thing I haven't been able to find is the register and bit location that will activate the Port A registers starting at address 0x4000_4C00. Currently, the registers are turned off. Nothing but _ _ _ _ _ _ _ _ empty spaces where data should be. I believe the clock gating control register that controls Port A is turned off, probably as part of the power saving features of the chip. In prior versions of the Microcontroller, you could find this information in the data sheets.
    I would really like to figure this out. I understand that I can code all of this in C and get my program working but I won't have an understanding of how the C compiler has acted at the bit and byte level to execute an instruction. The more I understand the assembly level of the chip and the machine instructions, the stronger my understanding of how the C compiler and the machine code work!

    Any help in this matter is appreciated.

    Regards,

    Mike
  • Mike,
    The datasheet reference I gave earlier ( MSP432P401 datasheet in Table 6-21. Port Registers (Base Addr:0x4000_4C00))
    has the address offsets for the different registers in addition to the acronyms that you would normally use. I'd suggest looking in that section.

    I applaud your willingness to try to learn as much as possible about the compilers and how they work. If you find yourself more pressed for time, I'd suggest looking at the higher-level TI drivers & examples (for RTOS projects) or the TI driverlib APIs and examples (for non-RTOS projects). Both are available in the SimpleLink SDK. They provide a substantial productivity boost, with the added advantage that porting code to other SimpleLink devices is effortless.

    Regards,
    Bob

**Attention** This is a public forum