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.

Interrupt problem after baudrate change !

Other Parts Discussed in Thread: TM4C123GH6PM

Hi Everyone;

I am using TM4C123GH6PM. When i change uart baudrate on the fly, Interrupt is stopping.

First of all , i set  UART6 baudrate to 300, then a few time later i  set baudrate to 9600. Transmit is still working but receive interrupt stopping.

Why ?

  • Hi Metin,

    Could you please post your code? Can you also check if the raw interrupt is being set? What interrupt do you want?

    Note that:

    "The UART must be disabled (see the UARTEN bit in the UARTCTL register on page 919) before any
    of the control registers are reprogrammed."

    So you might be causing some kind of error. 

  • Hi Luis,

    SysCtlPeripheralEnable(SYSCTL_PERIPH_UART6);
    SysCtlPeripheralEnable(SYSCTL_PERIPH_GPIOD);
    GPIOPinConfigure(GPIO_PD4_U6RX);
    GPIOPinConfigure(GPIO_PD5_U6TX);
    GPIOPinTypeUART(GPIO_PORTD_BASE, GPIO_PIN_4|GPIO_PIN_5);
    UARTDisable(UART6_BASE);
    UARTClockSourceSet(UART6_BASE, UART_CLOCK_PIOSC);
    UARTConfigSetExpClk(UART6_BASE, 16000000, 300, (UART_CONFIG_WLEN_7 | UART_CONFIG_STOP_ONE | UART_CONFIG_PAR_EVEN));
    UARTIntEnable(UART6_BASE, UART_INT_RX | UART_INT_RT);
    IntEnable(INT_UART6);
    UARTEnable(UART6_BASE);

    //A few times later
    UARTConfigSetExpClk(UART6_BASE, 16000000, 9600, (UART_CONFIG_WLEN_7 | UART_CONFIG_STOP_ONE | UART_CONFIG_PAR_EVEN));

  • Hello Metin

    Luis is correct. The data sheet for UART "strictly" prohibits this kind of on the fly change. What you are seeing is expected.

    Regards

    Amit