I am now using LM3S9B90 to develop our company’s products. I used UART1 ro received data from PC side COM port (a program written by C# that keeps sending data to M3 with 10400 8n1 speed, no s/w and h/w handshaking). The UART1 initialization code of UART1 is as follows:
/* Configure the UART 1. */
GPIOPinTypeUART(GPIO_PORTD_BASE, GPIO_PIN_2 | GPIO_PIN_3);
UARTConfigSetExpClk(UART1_BASE, SysCtlClockGet(), UART1_BAUD, (UART_CONFIG_WLEN_8 | UART_CONFIG_STOP_ONE | UART_CONFIG_PAR_NONE));
UARTIntEnable(UART1_BASE, UART_INT_RX | UART_INT_RT);
I was using pl2303 usb to UART IC from the PC side, the M3 uses MAX3243
I found there is a problem where the received data is wrong when I set:
#define UART1_BAUD 10400
However when I set “#define UART1_BAUD 1200”, the data is correct!
Later on, I was using FTDI FT232B usb to UART IC from the PC side, the M3 uses MAX3243.
Both 10400 and 1200 work perfect!
Also, my colleague used LM3S9B90 in other project that uses UART0 to receive data from PC side. He found that some of the data is wrong (wrong rate is around 1%). He used an original COM port from the PC MatherBoard. He is using 19200 8n1, no s/w and h/w handshaking.
May I ask is there any compatibility issues on UART existed in 9B90?
Since then, our projects are now getting stuck in the UART issue. Would you please provide any recommendation for us?
I'm not aware of any UART issues on lm3s9b90 that would affect communication based on the baud rate. From my experience, communicating with a "real" RS232 port, I've seen absolutely no problems unless the Stellaris device system clock is set wrongly and, as a result, the UART baud rate is out of spec. When talking to USB-to-serial devices like the pl2303 you mention, I have seen occasional missed data on the PC side, though. The same code runs fine without any missing data if I talk to a PC with a D9 RS232 connector, skipping the USB dongle. I suspect this is a flow control issue, though, since I typically see blocks of data that are missed rather than corrupted characters as I would expect if the baud rate was slightly wrong.
All of our code here tends to use 115,200bps so I'm very surprised that you are seeing problems at such relatively low bit rates. Have you verified that your system clocking is definitely correct and that the baud rate on the wire is exactly as you expect (with an oscilloscope, for example)? Are your RS-232 signals clean? Does one of our evaluation or development kits show the same problem when you connect it to the same PC (our lm3s kits use FTDI232 USB-to-serial devices and our new lm4f ones use a Stellaris part to perform the same function)?
Reading your post again, it seems you are seeing missed data on the lm3s9b90 side. Is all data sent from the 9b90 received correctly on the PC or are you seeing characters missing there too? Are you 100% sure that your software can keep up and no data is being lost in the UART (you are not seeing any receive overrun errors reported)?
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.