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.

TMS320F28386S: gpio functions

Part Number: TMS320F28386S

  

I am familiar with Device_initGPIO(), GPIO_setPadConfig(), and GPIO_setDirectionMode(). But I ran across some new functions today that I have not seen in examples nor have a good description for.

GPIO_setQualificationMode(MPGM_BOOT_INPUT_PIN, GPIO_QUAL_3SAMPLE) - I assume this is the number of samples for an input but over what period?  What is the default?

GPIO_setPinConfig(MPGM_BOOT_INPUT_CFG) - Here GPIO_57_GPIO57 is defined as GPIO_57_GPIO57, which is defined as 0x00880C05U. What does this function accomplish? Is it necessary?

GPIO_setMasterCore() - I would guess this is needed for a multicore MCU. Does it have a default?

Thanks,

John

  • Hi John,

    Thanks for your question. To answer each in order:

    GPIO_setQualificationMode: This sets the GPyQSEL register bits, which are as follows:

    Sampling period is as shown below:

      

      

      

    GPIO_setPinConfig does a few things, including clearing GPyMUX registers to avoid glitches, updating GPyGMUX register, and then writing the GPyMUX register witht he final value again. All of this is done to glitch-lessly choose the mux selection for a given GPIO. For example, the one you mentioned. For example, the function below would set GPIO0 mux to use PWM1A:

    GPIO_setPinConfig(GPIO_0_EPWM1A);               // GPIO0 = PWM1A

      

      

      

    GPIO_setMasterCore() - I would guess this is needed for a multicore MCU. Does it have a default?

    You are correct that the GPIO_setMasterCore is for choosing the core that controls the GPIO (using GPyCSELx registers). By default it's the reset value for these bits (most/all cases is 00, which is CPU1). You can see the other options below.

    Please note that you need to configure the GPIO with CPU1 first, then you can choose another core (once all config is completed) to control the GPIO in the actual program.

      

    Regards,

    Vince