1284P Xplained CPU Clock and I/O Clock

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

I'm working with a Mega-1284P xplained board.

I'm using Atmel studio 7 and an example project.

 

avr_compiler.h is included and it has this snippet:

#ifndef F_CPU
/*! \brief Define default CPU frequency, if this is not already defined. */
#define F_CPU 11059200UL
#endif

So my CPU Clock seems to be 11.0592MHz.

If that is the case what is the I/O clock running at?

I am specifically trying to correctly set Timer1 prescaler based off whatever the I/O clock speed is.

 

Is the I/O clock running at the same speed as the CPU Clock?

 

There is a 32kHz crystal hooked up. Does the Timer default to the Async Time Clock when it is present?

How can I tell if the Asynchronous Timer Clock is the time base for the Timers? 

 

My fuse settings...

 

 

 

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

@ejanuska said:

So my CPU Clock seems to be 11.0592MHz.

The schematic shows an 11.0592MHz XTAL and you have the fuses set for the XTAL oscillator and you have the DIV8 fuse unprogrammed so, yes, CLKsys, CLKcpu, CLKio, and CLKflash are all 11+MHz.  The following line however has NOTHING to do with setting the clock frequency; it tells the compiler what frequency the CPU is configured to run at:

/*! \brief Define default CPU frequency, if this is not already defined. */
#define F_CPU 11059200UL

There is a 32kHz crystal hooked up. Does the Timer default to the Async Time Clock when it is present?

Huh?  Have you looked at the ATmega1284P datasheet?  MEGA1284 Xplained User guide or schematic?  They contain all kinds of meaningful information.

How can I tell if the Asynchronous Timer Clock is the time base for the Timers?

By getting/setting the CLKSEL bit field in TCCRnB for the TC in question.

 

 

EDIT: multiple typos...

Greg Muth

Portland, OR, US

Atmel Studio 7 (Version: 7.0.1652) on Windows 10

Xplained/Pro/Mini Boards mostly

 

 

Last Edited: Wed. Dec 27, 2017 - 11:36 PM
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Greg_Muth wrote:

 

Huh?  Have you looked at the ATmega1284P datasheet?  MEGA1284 Xplained User guide or schematic?  They contain all kinds of meaningful information.

 

 

Yes I looked have at the documents and datesheets. THe mega1284 Xplained data is not very complete.

Of course I have looked through the ATmega1284P datasheet. How else would I know the clocks even existed? I could not discern what exactly happens when the 32kHz crystal is connected. Does the timer run off of that?

 

 

 

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

From the DS:

 

 

So the default source is the main system i/o clock until you configure it use the external xtal!

 

Jim

 

Mission: Improving the readiness of hams world wide : flinthillsradioinc.com

Interests: Ham Radio, Solar power, futures & currency trading - whats yours?