[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[avr-gcc-list] ATMega16 #include trouble?
From: |
Heiko Engelke |
Subject: |
[avr-gcc-list] ATMega16 #include trouble? |
Date: |
Thu, 10 Feb 2005 21:21:19 +0100 |
Hallo,
I'm a beginner with Atmel processors, still trying to get some simple
programs running. But I keep getting some very strange errors with very
basic things that I just don't understand. I am using avr-libc in
version 1.0.2 (Included in the binary Mac package from [1]).
Here's the first problem: My ATMega16 is not a valid MMCU, avr-gcc
says. avr-libc seems to support it, so I think atmega16 should exist
:-(
$ avr-gcc -mmcu=atmega16 foo.c
Unknown MCU `atmega16' specified
...
Now that I'm using atmega161 as a workaround, some defines do not
exist. There is no #define for UBRRL, while UBRRH exists. Strange ...
is this normal? What do I need to do to avoid this problem?
$ avr-gcc -mmcu=atmega161 foo.c
foo.c: In function `main':
foo.c:5: `UBRRL' undeclared (first use in this function)
...
$ cat foo.c
#include <io.h>
#define BAUD 42 // still to do
int main() {
outp((unsigned char)(BAUD>>8), UBRRH);
outp((unsigned char)BAUD, UBRRL);
}
[1] http://www.eecs.berkeley.edu/~mseeman/resources/macmicro.html
--
regards
Heiko
--
Grüße,
Heiko
- [avr-gcc-list] ATMega16 #include trouble?,
Heiko Engelke <=