Part Number: TM4C123GH6PM
I'm having trouble trying to initialize my UART with an odd parity. I was originally using the following, which configures the UART with no parity:
ROM_SysCtlPeripheralEnable(SYSCTL_PERIPH_GPIOB);
ROM_SysCtlPeripheralEnable(SYSCTL_PERIPH_UART1);
ROM_GPIOPinConfigure(GPIO_PB0_U1RX);
ROM_GPIOPinConfigure(GPIO_PB1_U1TX);
ROM_GPIOPinTypeUART(GPIO_PORTB_BASE, GPIO_PIN_0 | GPIO_PIN_1);
ROM_IntMasterEnable();
ROM_UARTClockSourceSet(UART1_BASE, UART_CLOCK_PIOSC);
ROM_IntEnable(INT_UART1);
UARTStdioConfig(1, 19200, 16000000); //baud rate 19200 based on 16mhz crystal
ROM_UARTIntEnable(UART1_BASE, UART_INT_RX);
I tried replacing the UARTStdioConfig call with
UARTConfigSetExpClk(UART1_BASE, 16000000, 19200, UART_CONFIG_WLEN_8 | UART_CONFIG_STOP_ONE | UART_CONFIG_PAR_ODD);
However, I can no longer establish communication after making this change. The configuration of the PLC I'm communicating with is also set to 19200 baud, 8 data bits, 1 stop bit, odd parity, etc.
Is there a difference between using the uartstdio and uart functions? Is there something else I'm missing?
I'm sorry if there's already a question about this topic. I tried searching the forums first and could not find anyone with the same problem.
Thank you.