TI E2E Community
Stellaris® ARM® Microcontrollers
Stellaris® ARM® LM3S Microcontrollers Forum
UART in EKS-LM3S3748 and DK-LM3S9B96?
I have a simple program that reads from & writes to the UART module 0 (similar to the uart_echo example). It ran fine on the EKS-LM3S3748 with PuTTY (a terminal program) connected to the Virtual COM Port of the ICDI connection. When I deployed the program to the DK-LM3S9B96, it still worked but only partially. For example, it echoed normal characters fine but the white space character was replaced by '0'. Some other characters were messed up too. When changing the target, I also changed the .cmd linking file.
What do you could possibly caused this?
Thanks a lot,
I'm following up.
I changed the clock setting from
SysCtlClockSet(SYSCTL_SYSDIV_1 | SYSCTL_USE_OSC | SYSCTL_OSC_MAIN | SYSCTL_XTAL_8MHZ);
SysCtlClockSet(SYSCTL_SYSDIV_1 | SYSCTL_USE_OSC | SYSCTL_OSC_MAIN | SYSCTL_XTAL_16MHZ);
and everything worked fine now on the DK-LM3S9B96.
Can someone please explain for me how the change affected the output of the UART module as described in the 1st post?
When you changed your system clock settings, you changed the baud rate you were operating at. The fact that any of the characters echoed OK was more a coincidence than anything.
But after the system clock is set, I have another funciton call,
UARTConfigSetExpClk(UART0_BASE, SysCtlClockGet(), baudRate, (UART_CONFIG_WLEN_8 | UART_CONFIG_STOP_ONE | UART_CONFIG_PAR_NONE));
with the parameter 'baudRate' to be always 115200, in both cases.
That second call only works correctly when you have your system clock configured correctly. If you have a 16MHz crystal, but tell the processor that it's an 8MHz crystal, then all of your clock calculations will be off, including baud rates for UARTs.
I see. Thanks a lot.
Could you share your uart_echo example Binh?
The uart_echo example is in the TI SDK.
All content and materials on this site are provided "as is". TI and its respective suppliers and providers of content make no representations about the suitability of these materials for any purpose and disclaim all warranties and conditions with regard to these materials, including but not limited to all implied warranties and conditions of merchantability, fitness for a particular purpose, title and non-infringement of any third party intellectual property right. TI and its respective suppliers and providers of content make no representations about the suitability of these materials for any purpose and disclaim all warranties and conditions with respect to these materials. No license, either express or implied, by estoppel or otherwise, is granted by TI. Use of the information on this site may require a license from a third party, or a license from TI.
TI is a global semiconductor design and manufacturing company. Innovate with 100,000+ analog ICs andembedded processors, along with software, tools and the industry’s largest sales/support staff.