[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [avr-chat] F_CPU values for Atmega 169 (Butterfly board)

From: Preston Wilson
Subject: Re: [avr-chat] F_CPU values for Atmega 169 (Butterfly board)
Date: Sun, 16 Mar 2008 21:50:44 -0400
User-agent: Microsoft-Entourage/

"Robert L Cochran" wrote:

> address@hidden butterfly]$ avr-gcc -I. -I/usr/avr/include -std=c99 -g
> -mmcu=atmega169 -Os -fpack-struct -fshort-enums -funsigned-bitfields
> -funsigned-char -Wall -Wstrict-prototypes -Wa,-ahlms=blinky.lst -c
> blinky.c -o blinky.o
> In file included from blinky.c:4:
> /usr/lib/gcc/avr/4.1.2/../../../../avr/include/util/delay.h:84:3:
> warning: #warning "F_CPU not defined for <util/delay.h>"
> What values for F_CPU do I need?

The Butterfly is setup to run on the internal oscillator, which can run up
to 8MHz (depends upon the voltage supplied to the part), and the way it is
shipped, it is configured with the clock prescale set to 8, so that results
in a 1MHz clock.  If you have not modified the CKSEL and CKDIV8 fuses, and
you do not mess with the clock prescaler register(s) in your code, then that
is what you are working with, and you need to set F_CPU to 1000000 (or

Look at the section on system clock source in the datasheet for the
ATmega169 where it describes all of the fuse and register settings that
impact the part.


reply via email to

[Prev in Thread] Current Thread [Next in Thread]