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.

peripheral disable in TIVA129x

Other Parts Discussed in Thread: TM4C1294NCPDT

Hello 

I am using TM4C1294NCPDT in my design.

I have enabled UART0 in code with following API.

ROM_GPIOPinConfigure(GPIO_PA0_U0RX);
ROM_GPIOPinConfigure(GPIO_PA1_U0TX);
ROM_GPIOPinTypeUART(GPIO_PORTA_BASE, GPIO_PIN_0 | GPIO_PIN_1);

Now i want to disable this UART0 peripheral in run time.

How can i disable it in single command?

Thanks 

MANISH 

  • Hello Manish,

    The Code mentioned above only set's up the GPIO for UART-0. They do not configure the UART peripheral. The UART peripheral is configured by API like ROM_UARTxxx

    Secondly, when you mention that you have to disable the UART0 peripheral, do you mean the TX-RX capability with functional access or no access to any UART register.

    For just disabling TX-RX capability you can write to Bit 0 of UARTCTL register or use UARTDisable API

    For completely disabling UART register access (which may result in Fault if the code tries to access it later), you can call the System Control API SysCtlPeripheralDisable(SYSCTL_PERIPH_UART0)

    Regards

    Amit Ashara

  • Hello Amit 

    My only intention is to disable the UART0 functionality on these pin and again use same pins as a GPIO.

    I have written following code

    ROM_GPIOPinConfigure(GPIO_PA0_U0RX);
    ROM_GPIOPinConfigure(GPIO_PA1_U0TX);
    ROM_GPIOPinTypeUART(GPIO_PORTA_BASE, GPIO_PIN_0 | GPIO_PIN_1);

    and 

    ROM_UARTDisable(UART0_BASE); //  To disable the UART0 on these pins.

    Can i now use these pins as a GPIO on run time ?

    Regards

    MANISH 

      

  • Hello Manish.

    The initial post suggested to me that you wanted to disable UART0 (I interpreted it as UART0 Functionality).

    Anyways, for getting back GPIO function, you can use

    GPIOPinTypeGPIOOutput(GPIO_PORTA_BASE, GPIO_PIN_0);

    GPIOPinTypeGPIOOutput(GPIO_PORTA_BASE, GPIO_PIN_1);

    Regards

    Amit