Hi all,
I am a graduate student experimenting with the Stellaris Cortex M4 Launchpad Ek-LM4F120XL on behalf of my advisor, who would like to use this board for his embedded systems class. I am quite new to the Cortex M4 world, so this could potentially be a noob question. I'm trying to use an external USB serial converter to connect to this dev board, so that we can dedicate the USB to the ICDI debug hardware, and then use the external an USB serial converter for UART printf statements. This facilitates concurrent debug and serial output, which is not possible with the on board hardware. This is a very useful for class.
My starting point for this project was the hello microvision project found in the Stellarisware folder for the Ek-LM4F120XL board. I modified this code to print continuously, and successfully tested the code using UART0. To use UART1, I connected a USB to serial converter to PB0 and PB1 for UART1 RX/TX, as well as a ground connection to my USB serial converter.
I then changed the following code in hello.c:::
// ROM_SysCtlPeripheralEnable(SYSCTL_PERIPH_GPIOA);
// ROM_GPIOPinConfigure(GPIO_PA0_U0RX );
// ROM_GPIOPinConfigure(GPIO_PA1_U0TX);
// ROM_GPIOPinTypeUART(GPIO_PORTA_BASE, GPIO_PIN_0 | GPIO_PIN_1);
// UARTStdioInit(0);
//
I modified the above code to the following, to confgure the correct GPIO pins for UART1:::::
//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);
When I look at the corresponding serial output on my PC terminal, characters are displayed, but they essentially look like garbage, as if the Baud rate is incorrect. I checked the uartstdio.c, and according to this, the Baud rate should be 115200, which is what I selected in the terminal program. I also changed it to other baud rates within the terminal program, and it still doesn't change the serial output to anything recognizable.I also used the UARTStdioInitExpClk() function to explicitly set the baud rate. This worked for the UART0 case, but produced the same incorrect results for the UART1 connection. Any suggestions? Thanks in advance!