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.
Hi
I am unable to get the UART1 working on the TM4C123 Launchpad.
Any idea what I am doing wrong?
Below code is executed before the main "while" loop.
I expect to receive a 'U' on my putty prompt but I don't seem to receive it.
SysCtlClockSet(SYSCTL_SYSDIV_1 | SYSCTL_USE_OSC | SYSCTL_OSC_MAIN | SYSCTL_XTAL_16MHZ); SysCtlPeripheralEnable(SYSCTL_PERIPH_UART1); SysCtlPeripheralEnable(SYSCTL_PERIPH_GPIOB); GPIOPinConfigure(GPIO_PB0_U1RX); GPIOPinConfigure(GPIO_PB1_U1TX); GPIOPinTypeUART(GPIO_PORTB_BASE, GPIO_PIN_0 | GPIO_PIN_1 ); UARTConfigSetExpClk(UART1_BASE, SysCtlClockGet(), 115200, (UART_CONFIG_WLEN_8 | UART_CONFIG_STOP_ONE | UART_CONFIG_PAR_NONE)); UARTCharPut(UART1_BASE, 'U');
After enabling I usually wait for device:
void enable_and_wait(uint32_t ui32Peripheral)
{
MAP_SysCtlPeripheralEnable(ui32Peripheral);
while(!MAP_SysCtlPeripheralReady(ui32Peripheral))
{
}
}
Hi, even after waiting nothing comes through.
If I change everything to use UART0 (over the debug USB), I can receive stuff.
Resistors R25 and R29 are left open so i should be able to use UART1 on PINS B0 and B1
My approach is:
Step 1. Configure TX/PB1 pin as GPIO output, then try to set 0 and 1 and verify with voltmeter that you can see correct voltage on the output pin.
Step 2. Use PB1 as TX for UART, go down with speed to 300 bits per second, try to send a lot of 0x00 or 0xFF and verify with voltmeter, that you can see any change in output voltage.
Step 3. Check UART registers for any errors:
UART0 0x4000c000 0 RS/EC 197 FR 0041 IBRD 07 FBRD 70 LCRH 301 CTL 12 IFLS 050 IM 020 RIS 000 MIS 000 ICR 115273 bps
Step1: I can see with a voltmeter PIN toggles.
Step2: I will try this later with a scope attached to the PIN.
Step3: The UART1 registers contain no error (UART_RSR or UART_ECR are 0), the UART_FR contains a 1 on UART_FR_TXFE and UART_FR_RXFE and UART_FR_CTS
Hi Ayrton,
If you are running the code using UART1 on the LaunchPad, it will not work. The ICDI debug probe on the EK-TM4C123GXL has a built-in USB to UART bridge but only for UART0, not UART1. If you want to use UART1, you need to connect another USB to UART bridge. You can find many choices online. Below is an example. I'm not endorsing any product.
Hi Charles
Luckily I do have a converter (3v3 level to USB)
In the end, the UART1 on the launchpak should communicate with another UART device (FPGA)
Hi,
Do you see the data on PB1 on the scope or ?
Do you have the correct COM port? What COM port does the Device Manager show for your USB2UART convert? Please show your Device Manager screenshot for the COM port that is enumerated for your converter.
Did you configure the COM port for 115200 baudrate with one STOP bit and no Parity?
Hi,
Can you just attach the image to the post by dragging it to the window? My company blocks access to online sharing sites for security reason.
Hi,
The ASCII code for 'U' is 0x55. Your scope cap shows 0x55 is put out on the bus. I don't see anything wrong. Just to double check, can you measure the baudrate on the bus. It should be close to 115200.
Can you show your Device Manager for the COM ports when your USB2UART converter is plugged in vs not plugged in.