[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [avr-gcc-list] Small program for UART not working

From: Vincent Trouilliez
Subject: Re: [avr-gcc-list] Small program for UART not working
Date: Tue, 30 Aug 2005 04:28:57 +0200

> LEDs on STK board. The RS232 cable is good, 
> I'm suspecting the baud rate was not set accurately in
> Atmega128L, so cause the reception of PC side is not
> synchronized. For example, if I set to 115200, but not
> accurate, the number could be set as 115000, so I have
> some errors in PC terminal.

The PC might be set accurately spot on to 115,200 but no uC will ever be
spot on anyway I think, depending on clock period etc, you can only get
as close as possible using the available counters, but rarely spot on.
IIRC the RS-232 allows for at least 1% tolerance/difference in bit
time/speed between the receiver and sender. You only need to be in sync
enough to transmit 10 bits, before syncing with the next start bit, so
in theory, even with 9.9% difference (in case of 10 bits frames) you
could still get your data, well okay that's stretching a bit far but you
get the idea ! ;o)
115,200 vs 115,000 shouldn't be a problem as it's under 0.2% difference.

So if the frames are formed properly, if the speeds are satisfyingly (is
that a word?!) matched, and the cable is good. Well have you checked on
your scope that, on the Atmel side, the Tx line driver was producing the
correct voltage levels ? Maybe it's a bit "weak" and the receiver of the
PC a bit critical ? 

Not sure that's much help, but since your problem seems to persist, some
food for thoughts can't hurt ;-)



reply via email to

[Prev in Thread] Current Thread [Next in Thread]