[En-Nut-Discussion] Proposal to change baudrate setting method using U2Xn

Harald Kipp harald.kipp at egnite.de
Wed Feb 23 10:28:06 CET 2005

Hi Henrik,

At 14:33 23.02.2005 +1000, you wrote:

>These two clock speeds have the drawback that the accuracy of the 115 KBit 
>speed is less than 3% if ones does not use the "Double the USART 
>Transmission Speed" feature of ATmega128 and AT90CAN128. This feature is 
>enabled by setting U2Xn to 1.

I can't see any disadvantage with your proposal.

>         sv = (u_short) ((((2UL * NutGetCpuClock()) / (*((u_long *)conf) * 
> 8UL)) + 1UL) / 2UL) - 1;

The latest ICCAVR V7 seems to contain a bug, when
mixing longs and shorts in an rvalue. In the calculation
above, this should not hurt. Anyone installed V7 to verify
this? (Be careful. Installing the V7 demo may spoil your V6


More information about the En-Nut-Discussion mailing list