CPU core clock change

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

In my circuit I have a separate clock generator, which I plan to use as CPU core clock. The problem is that by default my generator outputs 1MHz clock, which I would like to change to 10MHz by AVR program. So my AVR will be initially clocked at 1MHz, and later at 10MHz. Is such a rapid change possible? Can it influence the processor operation?

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

Quote:
which I would like to change to 10MHz by AVR program
How do you plan to do that if the generator only outputs 1MHz? Is it switchable somehow under software?

John Samperi

Ampertronics Pty. Ltd.

https://www.ampertronics.com.au

* Electronic Design * Custom Products * Contract Assembly

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

Most of the spec sheets warn about limiting the rate of change of clock frequency.

Jim

 

Until Black Lives Matter, we do not have "All Lives Matter"!

 

 

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

As Jim mentined, some data sheets limit the rate of change of the clock when the clock is provided by an external clock.

The Mega164/324/644/128 series, for example, states:

Quote:
When applying an external clock, it is required to avoid sudden changes in the applied clock frequency to ensure stable operation of the MCU. A variation in frequency of more than 2% from one clock cycle to the next can lead to unpredictable behavior. If changes of more than 2% is required, ensure that the MCU is kept in Reset during the changes.

Note, however, that the Xmega series can switch easily from 1 to 10 MHz, and back again, without worries.

JC

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

I use RFM22 radio module, which can output selectable clock. But by default it outputs 1MHz clock, which is to slow for me, but later I can switch it to 10MHz. Do you think that watch dog can help me? For example I can enable WD, switch the frequency, WD can reset a CPU if something goes wrong, and from this moment microcontroller will be operating at 10 MHz.

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

Are you building one for a non-critical system?

Why not just put a crystal on the uC and run at whatever speed you want the entire time?

JC

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

Yes, I will put a crystal. Just RFM22 has its own crystal, so I was thinking that it will be easy to use it.