Yahoo Groups archive

AVR-Chat

Index last updated: 2026-04-28 22:41 UTC

Message

Re: [AVR-Chat] avr-gcc ATMega8 USART trouble, was: Compile problem

2009-12-06 by Jim Wagner

If I recall correctly, those two DO share the address and require a  
data bit to distinguish which is which. It is NOT a compiler error.

Jim Wagner
Oregon Research Electronics
On Dec 6, 2009, at 9:34 AM, Marc R.J. Brevoort wrote:

> Hi,
>
> To answer my own question- it seems like the cause
> is a possible bug in the avr-gcc toolset in file
>
> /usr/avr/include/avr/iom8.h
>
> This file states
>
> #define UCSRC	_SFR_IO8(0x20)
> #define UBRRH	_SFR_IO8(0x20)
>
> (Twice the same definition for different ports?
> Suspicious...)
>
> To make ATmega8 USART functionality work for avr-gcc,
> I changed these two lines to the following:
>
> #define UCSRC _SFR_IO8(0x03)
> #define UBRRH _SFR_IO8(0x02)
>
> After these changes, I can compile my code (which
> used to work on ATtiny2313) with -mmcu=atmega8 and
> it will work on the ATmega8.
>
> Hope this helps someone!
>
> Best,
> Marc
>
>
> 



[Non-text portions of this message have been removed]

Attachments

Move to quarantaine

This moves the raw source file on disk only. The archive index is not changed automatically, so you still need to run a manual refresh afterward.