avr-libc-dev
[Top][All Lists]
Advanced

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

[avr-libc-dev] [patch #5343] Add a util/setbaud.h "helper" file


From: Cliff Lawson
Subject: [avr-libc-dev] [patch #5343] Add a util/setbaud.h "helper" file
Date: Wed, 30 Aug 2006 14:16:17 +0000
User-agent: Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.0; .NET CLR 1.1.4322; .NET CLR 2.0.50727)

Follow-up Comment #2, patch #5343 (project avr-libc):

Carlos,

Thanks for that but it kind of misses the point of what this header file was
intended for. The problem it hopes to avoid is that using just the datasheet
formula for calculating UBRR you:

a) run the risk of numerical rounding errors
b) you deliver UBRR values for F_CPU/BAUD combinations in which the Error% is
outside the -2%..+2% range
c) you don't necessarily use U2X=0 where possible and only offer U2X=1 when
it's the only way to stay within requirement (b)

The hand crafted lookup-table approach that the original setbaud.h offers
means that the user is alerted to unachievable baud rates for F_CPU and BAUD
and is only instructed to use U2X=1 when absolutely necessary.

If it lacks anything it is support for MORE common F_CPU values.

Cliff

    _______________________________________________________

Reply to this item at:

  <http://savannah.nongnu.org/patch/?5343>

_______________________________________________
  Message sent via/by Savannah
  http://savannah.nongnu.org/





reply via email to

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