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.

TMS320F28P550SJ: Sysconfig PinMux_Init

Part Number: TMS320F28P550SJ
Other Parts Discussed in Thread: SYSCONFIG, C2000WARE

Hi,

I am trying to include SCI communication in the "adc_ex2_soc_epwm" example using GPIO28 and GPIO29 pins as SCI_RX and SCI_TX.

But the PinMux_init() function called within the Board_init() function does:
GPIO_setAnalogMode(28, GPIO_ANALOG_ENABLED);
Right after calling the Board_init() function I do:

Board_init();
GPIO_setPinConfig(DEVICE_GPIO_CFG_SCIRXDA);
GPIO_setDirectionMode(DEVICE_GPIO_PIN_SCIRXDA, GPIO_DIR_MODE_IN);
GPIO_setPadConfig(DEVICE_GPIO_PIN_SCIRXDA, GPIO_PIN_TYPE_STD);
GPIO_setQualificationMode(DEVICE_GPIO_PIN_SCIRXDA, GPIO_QUAL_ASYNC);

GPIO_setPinConfig(DEVICE_GPIO_CFG_SCITXDA);
GPIO_setDirectionMode(DEVICE_GPIO_PIN_SCITXDA, GPIO_DIR_MODE_OUT);
GPIO_setPadConfig(DEVICE_GPIO_PIN_SCITXDA, GPIO_PIN_TYPE_STD);
GPIO_setQualificationMode(DEVICE_GPIO_PIN_SCITXDA, GPIO_QUAL_ASYNC);

I noticed that serial reception doesn't work and it's because of the "GPIO_setAnalogMode(28, GPIO_ANALOG_ENABLED)" configuration called inside the PinMux_init() function.

Why is the GPIO28 configuration as analog not overridden by the GPIO28 pin configuration as SCI_RX?

How to make sysconfig not configure the GPIO28 pin as analog?

Thanks,

 Ari

  

  • Hi Ari,

    Could you send your .syscfg file? I'm assuming you're using version 5.02 of C2000Ware from ti.com. When I test this on my end, GPIO28 is configured to disable analog mode:

    Thank you,

    Luke

  • Hi Luke,

    I couldn't figure out how to upload the .syscfg file. It's the same as the "adc_ex2_soc_epwm" example, it just includes "Device Support" to be able to switch to the internal oscillator. My board does not have an external crystal. Is there a way to configure the .syscfg file to choose which pins I want to be analog? And I don't understand why once configured as analog, I can't make the pin become an SCI pin for example?

    Ari

  • Hi Ari,

    You can upload a .syscfg file using the "Insert" tab when writing a message in E2E. I'm a bit confused on what you are trying to do. Do you want GPIO28 and GPIO29 to be analog or digital pins? To do SCI communication, these pins will need to configured as digital.

    To designate pins as analog in SysConfig, you need to add an ADC instance in the SysConfig GUI by pressing the "ADD" button at the top of the ADC GUI.

    Thank you,

    Luke

  • Hi Luke,

     Insert: "Image/Video/File"? Should I manually enter the file path?

     I started the project from the "adc_ex2_soc_epwm"  example, which uses sysconfig to configure the ADC. Sysconfig configures the GPIO28 as analog, using: 

       GPIO_setAnalogMode(28, GPIO_ANALOG_ENABLED);

     I was trying to configure the GPIO28 pin as SCI_RX using:

    Board_init();  

    GPIO_setAnalogMode(28U, GPIO_ANALOG_DISABLED);
    GPIO_setPinConfig(GPIO_28_SCIA_RX);
    GPIO_setDirectionMode(28U, GPIO_DIR_MODE_IN);
    GPIO_setPadConfig(28U, GPIO_PIN_TYPE_STD);
    GPIO_setQualificationMode(28U, GPIO_QUAL_ASYNC);

    I discovered that I need to convert GPOIO28 to digital before configuring it to be SCIA_RX, using the code below:

    GPIO_setAnalogMode(28U, GPIO_ANALOG_DISABLED);

    Now the only question remains is how to configure sysconfig so that GPIO28 is not configured as analog?

    Ari.

  • Hi Ari,

    You should move your ADC to another pin if you want to configure GPIO28 as digital SCIA_RX. No additional code should be needed outside of Board_init(). Does the issue still persist after moving your ADC to another pin?

    Thank you,

    Luke

  • Hi Luke,

     If you import the adc_ex2_soc_epwm example, and compile it, you will notice that sysconfig initializes all pins that can be analog as analog. In the PinMux_init() function called in Board_Init(). I couldn't figure out how to configure sysconfig to be able to choose which pins I want to be analog. 

     What does "any" mean in the ADC pin configuration?

    It doesn't matter if I set it to "any" or not, all pins are configured as analog in Board_Init();

  • Hi Ari,

    Can you try changing the "Use Case" to "CUSTOM" instead of "ALL" and then disable analog usage of the pin you want to use for SCI?

    Thank you,

    Luke