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.

TI-RTOS Low Level Driver Configuration Documentation?

Is there documentation available that clearly defines how to configure low-level peripherals for the MSP432P401R via TI-RTOS? 

I have found the API-level documentation useful (specifically the TI-RTOS manual v.2.2: www.ti.com/.../spruhd4m.pdf), but it omits vital information on properly configuring board-specific header files.

My main question is: what documents should I have pulled up when I want to learn how to configure things like PWM outputs "from scratch"?

I get the feeling that I am missing some important documents since I usually resort to reverse-engineering example code to figure out how things are configured. By contrast, when I use Atmel or Microchip parts, the data sheets always have nice block diagrams and register tables for each peripheral, so you can clearly see what's going in the chip.

Two examples of how the documentation I currently used has failed me:

1. I tried to set up a few PWM outputs and was not sure what I needed to declare and where. In the board PWM example, it is clear that the first PWM instance is using timer A1 register 1 (TA1.1) and is outputting on pin 1 of port 2 (P2.1): 

const PWMTimerMSP432_HWAttrsV1 pwmTimerMSP432HWAttrs[MSP_EXP432P401R_PWMCOUNT] = {
    {
        .timerBaseAddr = TIMER_A1_BASE,
        .clockSource = TIMER_A_CLOCKSOURCE_SMCLK,
        .compareRegister = TIMER_A_CAPTURECOMPARE_REGISTER_1,
        .gpioPort = GPIO_PORT_P2,
        .gpioPinIndex = GPIO_PIN1,
        .pwmMode = GPIO_PRIMARY_MODULE_FUNCTION
    },

2. In the data sheet, table 6-47 seems to suggest that TA1.1 is tied to P7.7, but I remember reading that you can tie any I/O output to any I/O pin. Is modifying the .gpioPort and .gpioPinIndex in MSP_EXP430P401R.c all that is necessary to shift the PWM output to a different port/pin?

I wanted to read an encoder by using it to increment a counter in the chip. Reading through the data sheet (www.ti.com/.../msp432p401r.pdf), I got a vague sense that I could use one of the timers as the counter, but I failed to see how I could connect it to an input pin. Paragraph 6.9.3.1 and Table 6-46 seemed promising, but didn't lead me anywhere. 

  • In the version of TIRTOS you're using, there is a need to author some code in the device specific Board.c file that performs any low level pin mapping operations required to route functions to pins. This is usually placed in the <board>_initXXX() function. This code usually consists of a few driverlib calls such as below:

    /*
     *  ======== MSP_EXP432P401R_initPWM ========
     */
    void MSP_EXP432P401R_initPWM(void)
    {
        /* Use Port Map on Port2 get Timer outputs on pins with LEDs (2.1, 2.2) */
        const uint8_t portMap [] = {
            PM_NONE, PM_TA1CCR1A, PM_TA1CCR2A, PM_NONE,
            PM_NONE, PM_NONE,     PM_NONE,     PM_NONE
        };
    
        /* Mapping capture compare registers to Port 2 */
        MAP_PMAP_configurePorts((const uint8_t *) portMap, PMAP_P2MAP, 1,
            PMAP_DISABLE_RECONFIGURATION);
    
        PWM_init();
    }
    

     

    In the upcoming release of our CoreSDK products (3.01.00), the TIRTOS driver performs the low level driverlib calls during the XXX_open() call based on the mnemonic pin assignments in the user's <board>.c file.

    It is recognized loud and clear that configuring the drivers is confusing and tedious. TI is developing a graphical tool that is due out early next year that will auto-generate the necessary .c and .h files for you.

    In the meantime, you are best served by studying the various example <board>.c and <board>.h files provided in your TIRTOS installation.

    Alan

  • There was a suggested answer and since there has been no active on this thread for more than a week, the suggested answer was marked as verify. Please feel free to select the "Reject Answer" button and reply with more details.