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.

TMS320F28388D: CM core UART on GPIO28 and GPIO29

Part Number: TMS320F28388D
Other Parts Discussed in Thread: C2000WARE

Hello.

Is there any way to control from the CM core the SCIA port at GPIOs 28 and 29?

If yes, is it possible to use uDMA?

I have only seen example for one uart at GPIO85

Best Regards

  • Hi,

    Is there any way to control from the CM core the SCIA port at GPIOs 28 and 29?

    No, access to SCI module is only available from CPU1 and CPU2 (not from CM). On CM, we have different UART module which is available on different GPIO pins. 

    Regards,

    Vivek Singh

  • Thank you Vivek.

    Is there any example for GPIO42 and GPIO43 as UART?

    Do you need to set any pinmux configuration?

    Regards

  • We do not have example with that GPIO but you should be able to update the pinmux setting in the example provided in C2000Ware. Please note that pinmux setting is controlled by CPU1 code only. In C2000Ware we have a C28x example (driverlib\f2838x\examples\c28x\cm_common_config_c28x) which configures required GPIOs for CM examples (driverlib\f2838x\examples\cm\uart). In C28x example you can change the GPIO number for UART.

    Hope this helps.

    Regards,

    Vivek Singh 

  • Hello Vivek.

    My question Here is how to set GPIO MUX, since the MUx is at address 0xF, ie, for SCI in CPU1 we are using:

             GPIO_SetupPinMux(43, GPIO_MUX_CPU1, 0xF);
             GPIO_SetupPinOptions(43, GPIO_INPUT, GPIO_PUSHPULL);
             GPIO_SetupPinMux(42, GPIO_MUX_CPU1, 0xF);
             GPIO_SetupPinOptions(42, GPIO_OUTPUT, GPIO_ASYNC);

      GpioCtrlRegs.GPBGMUX1.bit.GPIO43 = 1;
             GpioCtrlRegs.GPBMUX1.bit.GPIO43 = 1;

            GpioCtrlRegs.GPBGMUX1.bit.GPIO42 = 1;
               GpioCtrlRegs.GPBMUX1.bit.GPIO42 = 1;

    What should we use for doing the same with CM core?

  • GPIO mux setting is controlled by CPU1 only because it's global mux. CM code does not need to do any pinmux setting. Please refer the example I sent earlier.

  • Hello Vivek. I just tried the example by substituting 85 and 84 for 42 and 43, but it does not work.

    void Configurar_Serie_42_43_UART()
    {
    
    
    
        //
        // Configure GPIO85 as the UART Rx pin.
        //
        GPIO_setPinConfig(GPIO_43_UARTA_RX);
        GPIO_setDirectionMode(43, GPIO_DIR_MODE_IN);
        GPIO_setPadConfig(43, GPIO_PIN_TYPE_STD);
        GPIO_setQualificationMode(43, GPIO_QUAL_ASYNC);
    
        //
        // Configure GPIO84 as the UART Tx pin.
        //
        GPIO_setPinConfig(GPIO_42_UARTA_TX);
        GPIO_setDirectionMode(42, GPIO_DIR_MODE_OUT);
        GPIO_setPadConfig(42, GPIO_PIN_TYPE_STD);
        GPIO_setQualificationMode(42, GPIO_QUAL_ASYNC);
    
    
    }
    
    
    

    Would you be so kind to test the example?

    Regards

  • Hi PAk,

    Can you elaborate on how it doesn't work? 

    Do you see activity on the pins? One good sanity check is to set the pins in GPIO output mode and then toggle the pin to verify the hookup.  

  • The pins are OK, because when configured as SCI communications work fine. When we set it as UART and in CM we set up at the same speed, we only get some zeros, rubbish data or nothing.

  • Hi PAk,

    So the issue is more on porting code that was working on the SCI module on C28x CPU1 to get it to work on the CM-UART module?

    Do you have other peripherals that are already working on the CM?  If not, I'd definitely recommend to start with a full example like say the CM UART echo-back example. 

    From there, once you've modified the code per your needs, some good sanity checks after running the code would be to:

    • Ensure the M4 core on the CM side is clocked as expected by bringing out the CM clock via XCLKOUT (configured on the C28x CPU1 side)
    • After the UART has been initialized, ensure that TX, RX, and UART enables in UARTCTL are indeed set
    • Directly examine the GPIO mux settings in the expressions window for GPIO85 and GPIO84 to ensure that the muxes are configured for UART operation (and not SCI) as expected
    • Check the baud rate registers to ensure they are configured as expected
    • Check the UART data register (UARTDR) and UART receive status register (UARTRSR) to see if any errors occurred. Check the UART flag register (UARTFR) to determine if the module is ready and waiting or is stuck doing something 
  • Yes and No, the issue is that even with the provided example , by just changing pins to GPIO42 and GPIO43 don't work. We were only modifying GPIO85 and GPIO84 UART example.

    Are you able to test your example with the suggested pins?

  • Hi PAk,

    Can you confirm that you are?: 

    • First running cm_common_config_c28x example on CPU1 with symbol "UART" explicitly defined in the project properties "Predefined Symbols" and GPIOs in the UART section changed to to 42 and 43
      • (OR running uart_config_c28x example with modified GPIOs...UART should already be defined in the compiler settings)
    • Then running the uart_ex1_echoback (or loopback example 2) on the CM (shouldn't need any modification)?