Hello Everyone,
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,
Binh
I'm following up.
I changed the clock setting from
SysCtlClockSet(SYSCTL_SYSDIV_1 | SYSCTL_USE_OSC | SYSCTL_OSC_MAIN | SYSCTL_XTAL_8MHZ);
to
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?
Thank you,
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.