Serial Problem in AVR

ChibiOS public support forum for topics related to the Atmel AVR family of micro-controllers.

Moderator: tfAteba

Post Reply
kimgunzung
Posts: 9
Joined: Thu Apr 21, 2011 9:37 am

Serial Problem in AVR

Post by kimgunzung »

Hi Giovanni,

I'm using ChibiOS/RT 2.2.3 with ATMega128A and AVR-GCC 4.3.3 (WinAVR 20100110).

There is error in source code in serial_llc.c in AVR port.
At line 192, SER1 should be SD1.

The USART0 is not working under the 38400bps.
There is no output at USART0 under the 38400bps.
\
User avatar
Giovanni
Site Admin
Posts: 14891
Joined: Wed May 27, 2009 8:48 am
Has thanked: 1202 times
Been thanked: 996 times

Re: Serial Problem in AVR

Post by Giovanni »

Hi,

Thanks for reporting this problem, I will verify it and open a ticket.

Giovanni
kimgunzung
Posts: 9
Joined: Thu Apr 21, 2011 9:37 am

Re: Serial Problem in AVR

Post by kimgunzung »

It is a problem of UBRR macro.
The AVR-GCC make warning "large integer implicitly truncated to unsigned type".

I modify UBRR macro such as below. This has no problem and no warning.

#define UBRR(b) (((F_CPU / b) >> 4) - 1)
User avatar
Giovanni
Site Admin
Posts: 14891
Joined: Wed May 27, 2009 8:48 am
Has thanked: 1202 times
Been thanked: 996 times

Re: Serial Problem in AVR

Post by Giovanni »

Thanks for the fix, I didn't notice any warning, probably I am using an old version of AVR-GCC, time to upgrade it. I'll commit your change.

Giovanni
Post Reply