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.

MSP432 driverlib

In the void GPIO_setAsPeripheralModuleFunctionInputPin ( uint_fast8_t selectedPort, uint_fast16_t selectedPins, uint_fast8_t mode ), the third parameter is used for for either primary, secondary or ternary module function modes. But how do you know what is the primary, secondary or ternary function of a pin. Is there a table somewhere?

From the examples supplied:

AI is the tertiary module function of the pin
MAP_GPIO_setAsPeripheralModuleFunctionInputPin(GPIO_PORT_P5, GPIO_PIN5, GPIO_TERTIARY_MODULE_FUNCTION); // P5.5 AI

SPI is the primary function of the pin
MAP_GPIO_setAsPeripheralModuleFunctionInputPin(GPIO_PORT_P1, GPIO_PIN5 | GPIO_PIN6 | GPIO_PIN7, GPIO_PRIMARY_MODULE_FUNCTION);

How do you know in general?

I have a similar problem with the ADC14 sample and hold trigger source:

/* Configuring the sample trigger to be sourced from Timer_A0 and setting it to automatic iteration after it is triggered */
MAP_ADC14_setSampleHoldTrigger(ADC_TRIGGER_SOURCE1, false);

How do you know that the ADC_TRIGGER_SOURCE1 is in fact TIMER_A0?

  • Hello Jean-Philippe,
    You have to use the MSP432 datasheet to know that.

    Let me explain:
    In the datasheet, you have the Chapter 6.10: Input/Output Schematics
    You previously have to know which pin are you gonna use, for example i saw there were a external crystal input on port J, pin 0.
    In the corresponding chapter (page 133 of 157), i see that to have this special function on my pin, i need special values for PJSEL1 and PJSEL0.

    GPIO_PRIMARY_MODULE_FUNCTION: SEL1=0 SEL0=1
    GPIO_SECOND_MODULE_FUNCTION: SEL1=1 SEL0=0
    GPIO_TERTIARY_MODULE_FUNCTION: SEL1=1 SEL0=1

    So for my example, to put an external crystal on PJ.0, i use the primary

    Hope you understood :)
  • Hello Romain,

    Thank you. Understood.

    What about the similar problem with the ADC14 sample and hold trigger source:

    /* Configuring the sample trigger to be sourced from Timer_A0 and setting it to automatic iteration after it is triggered */
    MAP_ADC14_setSampleHoldTrigger(ADC_TRIGGER_SOURCE1, false);

    How do you know that the ADC_TRIGGER_SOURCE1 is in fact TIMER_A0?

**Attention** This is a public forum