gcctest4.c:89: error: `UBRR' undeclared (first use in this f

Last post
3 posts / 0 new
Author
Message
#1
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Can you please help?

I am using the latest WINAVR-2004-0720.

I used atmega163 as MCU name to compile an application, the result is what I expected.

When I used atmega16 to compile the same file I have the following:

Compiling: gcctest4.c
avr-gcc -c -mmcu=atmega16 -I. -g -Os -funsigned-char -funsigned-bitfields -fpack-struct -fshort-enums -Wall -Wstrict-prototypes -Wa,-adhlns=gcctest4.lst -std=gnu99 gcctest4.c -o gcctest4.o
gcctest4.c: In function `uart_init':
gcctest4.c:89: error: `UBRR' undeclared (first use in this function)
gcctest4.c:89: error: (Each undeclared identifier is reported only once
gcctest4.c:89: error: for each function it appears in.)
gcctest4.c:104:2: warning: no newline at end of file
make.exe: *** [gcctest4.o] Error 1

 Process Exit Code: 2

The program that I try to compile is AVR-GCC test program #4 from Volker Oth

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

I think you'll find that the Mega16 has two registers to set the baud rate, UBRRL and UBRRH. It's all in the (freely available from Atmel) datasheet.

Act now, think later.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0
Nerva Joachim wrote:
Compiling: gcctest4.c
...
The program that I try to compile is AVR-GCC test program #4 from Volker Oth

Which is incredibly out-of-date, is deprecated, and should not be used as a test/sample program any more.