bugAVR C Runtime Library - Bugs: bug #18818, ATMega644P missing second USART...

 
 

You are not allowed to post comments on this tracker with your current authentication level.

bug #18818: ATMega644P missing second USART erroneously

Submitter:  None
Submitted:  Thu 18 Jan 2007 12:21:42 PM UTC
   
 
Category:  Header Severity:  3 - Normal
Priority:  5 - Normal Item Group:  Header files
Status:  Invalid Assigned to:  joerg_wunsch
Percent Complete:  0% Originator Email:  -email is unavailable-
Open/Closed:  Closed Release:  None
Fixed Release:  None

Sun 21 Jan 2007 09:11:30 PM UTC, comment #3: 

Confusing comment has been fixed in that header file.

Joerg Wunsch <joerg_wunsch>
Group administrator
Fri 19 Jan 2007 12:50:20 AM UTC, comment #2: 

You're right.

What happened was I never bothered to check if it really works, fooled by the absence of 'p' in the individual header files, coupled with this line in iomxx4.h:

/*

  • Only ATmega164/324 have a second USART.

 */

I may be partly absolved by that slight glitch in the documentation, but nevertheless I shall repent my rather blatant foolishness.

Tero Sinervo <tvjsin>
Thu 18 Jan 2007 01:18:16 PM UTC, comment #1: 

Works as designed:

$252% cat > foo.c
#include <avr/io.h>

void foo(void)
{
  UCSR1A = 42;
}
^D
$ avr-gcc -mmcu=atmega644p -c foo.c
$ avr-gcc -mmcu=atmega644 -c foo.c
foo.c: In function 'foo':
foo.c:5: error: 'UCSR1A' undeclared (first use in this function)
foo.c:5: error: (Each undeclared identifier is reported only once
foo.c:5: error: for each function it appears in.)

Are you perhaps using an obsolete version of compiler and/or
library?

Joerg Wunsch <joerg_wunsch>
Group administrator
Thu 18 Jan 2007 12:21:42 PM UTC, original submission:  

There's a slight problem with ATMega644P and ATMega644 in the iomxx4.h header file. ATMega644 has only one USART, which is correct, but ATMega644P should have two USARTs. avr-libc seems to see both devices as the same device which they apparently are not. Even the paratetric product table at www.atmel.com says that ATMega644P has only one USART, but the datasheet says otherwise.

Suggested solution: recognize ATMega164P, ATMega324P and ATMega644P as their own product family and isolate ATMega644 from it. This means adding the 'p' letter to the processors' individual headers as is already done with ATMega196 and ATMega169P. iom644.h should perhaps not be part of this family. The ATMega644 and ATMega644P should probably be seen as different devices.

Anonymous

 

(Note: upload size limit is set to 16384 kB, after insertion of the required escape characters.)

No files currently attached

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -email is unavailable- added by tvjsin (Posted a comment)
  • -email is unavailable- added by joerg_wunsch (Posted a comment)
  •  

    Follow 3 latest changes.

    Date Changed by Updated Field Previous Value => Replaced by
    2007-01-21 joerg_wunsch Open/ClosedOpen Closed
    2007-01-18 joerg_wunsch StatusNone Invalid
        Assigned toNone joerg_wunsch

    Back to the top

    Powered by Savane 3.13-4448.
    Corresponding source code