avr-chat
[Top][All Lists]
Advanced

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

Re: [avr-chat] New Programmer, Small Program, F_CPU for Atmega644


From: Preston Wilson
Subject: Re: [avr-chat] New Programmer, Small Program, F_CPU for Atmega644
Date: Fri, 21 Mar 2008 19:02:32 -0400
User-agent: Microsoft-Entourage/11.4.0.080122

"Weddington, Eric" wrote:

>> I have an Atmega644 in the DIP package that I could breadboard with a
>> quick LED blinking circuit. Since I'm doing this in Linux,
>> I'm not sure
>> what is a good value to assign to F_CPU, and yes, I did check the 376
>> page data sheet, but I am still not sure how to calculate
>> this value --
>> sorry.
>> 
> 
> Hi Bob,
> 
> F_CPU is just a defined value which is your CPU Frequency in Hertz. This
> symbol can then be used in your application if you need it.

Take a look at the section of the datasheet that explains the default clock
source, which is a subsection of the System Clock chapter or wherever the
ATmega644's datasheet describes the CKSEL, SUT, and CKDIV8 fuse values.

Examples of how to set F_CPU:
  System Clock Frequency      F_CPU
  125 kHz                      125000
  1 MHz                       1000000
  7.3728 MHz                  7372800

avr-libc's delay.h also uses F_CPU.

-Preston






reply via email to

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