EmbeddedRelated.com
Forums

LPC210x UART bug ?

Started by hansklos2003 June 24, 2004
Hi!

I set LPC2106 UART to work with 2 stop bits. After this I try to
recieve few bytes transmitted with one stop bit, from PC computer to
LPC2106. And, what is strange for me, LPC2106 UART returns only one,
last byte from transmitted frame. I think, it is an error, becouse
all chips compatible with 16c550, in this case return all bytes with
no error indication (when second stop bit is missing).
Am I right or not ?

Regards
Robert



An Engineer's Guide to the LPC2100 Series

--- In , "hansklos2003" <hansklos2003@y...> wrote:
> Hi!
>
> I set LPC2106 UART to work with 2 stop bits. After this I try to
> recieve few bytes transmitted with one stop bit, from PC computer to
> LPC2106. And, what is strange for me, LPC2106 UART returns only one,
> last byte from transmitted frame. I think, it is an error, becouse
> all chips compatible with 16c550, in this case return all bytes with
> no error indication (when second stop bit is missing).
> Am I right or not ?
>
> Regards
> Robert

Who said the LPC2106 was 16c550 compatible?

A stop bit is the same as an idle line. Using 2 stop bits increases
the idle time between characters. Many UARTS, when set for 2 stop bits
put them on the transmission but do not bother to implement them on
the reception (2 stop bits is always recievable by a UART set to 1
stop bit). If framing checks are fully implemented then a UART should
not receive when there is only 1 stop bit.

Having said that the UART in the LPC will always try and use a new
edge as a start bit and so should recieve a successive character even
if it causes a frame error in the previous character. Have you
investigated frame errors? Are they being generated?



hansklos2003 wrote:

> Hi!
>
> I set LPC2106 UART to work with 2 stop bits. After this I try to
> recieve few bytes transmitted with one stop bit, from PC computer to
> LPC2106. And, what is strange for me, LPC2106 UART returns only one,
> last byte from transmitted frame. I think, it is an error, becouse
> all chips compatible with 16c550, in this case return all bytes with
> no error indication (when second stop bit is missing).
> Am I right or not ?
>
> Regards
> Robert
>

Hi Robert,

if you send with one stop bit but the receiver expects two, the receiver
generates a framing error only when the time between the stop bit of one byte
and the start bit of the following byte is below one bit time. Ohterwise the
idle state of the serial line will be interpreted as a stop bit. That's why your
last byte is returned correctly.
The description of the '16550 framing error bit says that in case the receiver
sees a 0 when there should be a 1 for a stop bit it tries to resynchronize by
assuming that 0 is the start bit of a following byte. Nevertheless, the error
bit for the byte with the missing stop bit is set. The description of the
LPC2106's UART say the same. Hence, every 16550 compatible UART should mark all
but the last of your bytes erroneous.
How do you return your bytes? Does the software on your LPC2106 evaluate the
Line Status Register (LSR) when it reads a byte from the receiver register/FIFO?
What does it do if LSR shows that there was a framing error in the byte you are
going to read from the receiver register/FIFO?

Regards,
Jens




> Who said the LPC2106 was 16c550 compatible?

LPC210x datasheet :
"Key features: ... Multiple serial interfaces including two UARTs
(16C550) ..."

I use interrupts to recieve bytes from Lpc210x UART.
The problem is, this UART generate only one RDA interrupt, when
last byte is recieved. There is no RLS interrupts - in means - UART
does not signal framing errors.
Earlier characters are lost with no error signalization...

From my experience I know, other UARTs (for exapmle in AVR or '550
in PC) are ready to recieve next byte immediately after detecting
first stop bit. Previous character is returned without framing error.

Has someone similar problem ?

Robert.



Robert
If you are having problems with interrupt mode operation of the
LPC uart, you might want to take a look at my code in the files
section on Yahoo. http://groups.yahoo.com/group/lpc2000/files/
and look for the descriptive title of UT040311A.zip

Regards
-Bill Knight
www.theARMPatch.com On Thu, 24 Jun 2004 16:10:59 -0000, hansklos2003 wrote: > Who said the LPC2106 was 16c550 compatible?

LPC210x datasheet :
"Key features: ... Multiple serial interfaces including two UARTs
(16C550) ..."

I use interrupts to recieve bytes from Lpc210x UART.
The problem is, this UART generate only one RDA interrupt, when
last byte is recieved. There is no RLS interrupts - in means - UART
does not signal framing errors.
Earlier characters are lost with no error signalization...

From my experience I know, other UARTs (for exapmle in AVR or '550
in PC) are ready to recieve next byte immediately after detecting
first stop bit. Previous character is returned without framing error.

Has someone similar problem ?

Robert.