UART channel change problem on LM4F120H5QR(Stellaris Launchpad)

Status
Not open for further replies.
Were you able to fix this issue. I have exactly same problem on LM4F120 launchpad using UART2.

Thanks
Yes i fixed it.
If you want to use two or more channel you may want to look this UART startup code:
Code:
    ROM_SysCtlPeripheralEnable(SYSCTL_PERIPH_UART1);
    ROM_SysCtlPeripheralEnable(SYSCTL_PERIPH_GPIOB);
    GPIOPinConfigure(GPIO_PB0_U1RX);
    GPIOPinConfigure(GPIO_PB1_U1TX);
    ROM_GPIOPinTypeUART(GPIO_PORTB_BASE, GPIO_PIN_0 | GPIO_PIN_1);
    ROM_UARTConfigSetExpClk(UART1_BASE, ROM_SysCtlClockGet(), 115200,
                            (UART_CONFIG_WLEN_8 | UART_CONFIG_STOP_ONE |
                             UART_CONFIG_PAR_NONE));
    UARTCharPut(UART1_BASE,'x');
If you want to use one UART channel you look this startup code:
Code:
    ROM_SysCtlPeripheralEnable(SYSCTL_PERIPH_GPIOB);
    ROM_GPIOPinConfigure(GPIO_PB0_U1RX);
    ROM_GPIOPinConfigure(GPIO_PB1_U1TX);
    ROM_GPIOPinTypeUART(GPIO_PORTB_BASE, GPIO_PIN_0 | GPIO_PIN_1);
    UARTStdioInit(1);
If you use the first you can't use UARTPrintf() function unless change the channel in run-time,you should use like
UARTCharPut(UART1_BASE,sentit);
UARTCharPut(UART2_BASE,sentit);
functions.
 

Status
Not open for further replies.

Similar threads

Cookies are required to use this site. You must accept them to continue using the site. Learn more…