How does an ARM MCU run faster than the external crystal?ARM Cortex (M3-M4): manufacturer and development IDEDoes the CPU of an ARM Cortex M halt during flash self-programming?Can a wrong crystal oscilator capacitor burn the MCU?ARM Processor board and ProgrammingLockup when executing relocated ISR in ARM Cortex-M0+Using “oscillator” rather than crystal for MCUWhen should one use an external crystal for this MCU given that the internal oscillator is much faster?How should I connect the external crystal in MPU6050LPC1768 Baud rateRectifying failed MCU crystal oscillator design

Does the growth of home value benefit from compound interest?

If Boris Johnson were prosecuted and convicted of lying about Brexit, can that be used to cancel Brexit?

What is the right way to float a home lab?

Will TSA allow me to carry a Continuous Positive Airway Pressure (CPAP) device?

Why don't B747s start takeoffs with full throttle?

Convert camelCase and PascalCase to Title Case

How can Iron Man's suit withstand this?

Initialize an std::array algorithmically at compile time

X-shaped crossword

California: "For quality assurance, this phone call is being recorded"

Is it possible for people to live in the eye of a permanent hypercane?

Could the Missouri River be running while Lake Michigan was frozen several meters deep?

When writing an error prompt, should we end the sentence with a exclamation mark or a dot?

What happened to all the nuclear material being smuggled after the fall of the USSR?

Applicants clearly not having the skills they advertise

Word for a small burst of laughter that can't be held back

The term for the person/group a political party aligns themselves with to appear concerned about the general public

Do adult Russians normally hand-write Cyrillic as cursive or as block letters?

Replace only 2nd, 3rd, nth...character and onwards

How certain is a caster of when their spell will end?

Old black and white movie: glowing black rocks slowly turn you into stone upon touch

Does any lore text explain why the planes of Acheron, Gehenna, and Carceri are the alignment they are?

Can Green-Flame Blade be cast twice with the Hunter ranger's Horde Breaker ability?

How do you build a story from a world?



How does an ARM MCU run faster than the external crystal?


ARM Cortex (M3-M4): manufacturer and development IDEDoes the CPU of an ARM Cortex M halt during flash self-programming?Can a wrong crystal oscilator capacitor burn the MCU?ARM Processor board and ProgrammingLockup when executing relocated ISR in ARM Cortex-M0+Using “oscillator” rather than crystal for MCUWhen should one use an external crystal for this MCU given that the internal oscillator is much faster?How should I connect the external crystal in MPU6050LPC1768 Baud rateRectifying failed MCU crystal oscillator design






.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty,.everyoneloves__bot-mid-leaderboard:empty margin-bottom:0;








12












$begingroup$


So before this I only worked with simple 8 bit Atmel MCUs and I realized on my development board schematics it has only a 12Mhz crystal, yet the MCU operates at up to 100MHz. (I think the default is 80MHz. I only made it higher once for fun. It's just a simple line in the code.)



How does it do that? Why does an Atmega328, for example, run at the used crystal speed?










share|improve this question









New contributor



Amy Gamble is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.






$endgroup$







  • 5




    $begingroup$
    1) mHz means milli Hertz so 1/1000th of a Hertz, use MHz (capital M) when you mean Mega Hertz. 2) what 8 Bit MCU? 3) What development board? 4) The ATMega 328 doesn't have to run at the crystal's speed, read the section of clocking in the datasheet to see what is possible. 5) Some ICs have a PLL which can be used to multiply the external clock frequency.
    $endgroup$
    – Bimpelrekkie
    May 26 at 12:03






  • 1




    $begingroup$
    @Bimpelrekkie: Most of that comment is the answer. Would you like to make an answer of it?
    $endgroup$
    – JRE
    May 26 at 12:12










  • $begingroup$
    VCO divider to compare with 12 MHz ends up multiplying f. Thats what a PLL freq synth does.
    $endgroup$
    – Sunnyskyguy EE75
    May 26 at 12:43











  • $begingroup$
    @Bimpelrekkie looks like someone already fixed it for me. I already mentioned Atmel and atmega328. but it doesn't matter as that's an example. afaik atmega328p doesn't have a PPL? I was mostly curious about how you can just simply multiply it. thankfully Marcus Muller already explained it very well.
    $endgroup$
    – Amy Gamble
    May 26 at 14:14










  • $begingroup$
    the processor in the computer you are reading this on is likely using a 100Mhz reference clock or slower yet the core runs in the ghz.
    $endgroup$
    – old_timer
    May 26 at 18:43


















12












$begingroup$


So before this I only worked with simple 8 bit Atmel MCUs and I realized on my development board schematics it has only a 12Mhz crystal, yet the MCU operates at up to 100MHz. (I think the default is 80MHz. I only made it higher once for fun. It's just a simple line in the code.)



How does it do that? Why does an Atmega328, for example, run at the used crystal speed?










share|improve this question









New contributor



Amy Gamble is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.






$endgroup$







  • 5




    $begingroup$
    1) mHz means milli Hertz so 1/1000th of a Hertz, use MHz (capital M) when you mean Mega Hertz. 2) what 8 Bit MCU? 3) What development board? 4) The ATMega 328 doesn't have to run at the crystal's speed, read the section of clocking in the datasheet to see what is possible. 5) Some ICs have a PLL which can be used to multiply the external clock frequency.
    $endgroup$
    – Bimpelrekkie
    May 26 at 12:03






  • 1




    $begingroup$
    @Bimpelrekkie: Most of that comment is the answer. Would you like to make an answer of it?
    $endgroup$
    – JRE
    May 26 at 12:12










  • $begingroup$
    VCO divider to compare with 12 MHz ends up multiplying f. Thats what a PLL freq synth does.
    $endgroup$
    – Sunnyskyguy EE75
    May 26 at 12:43











  • $begingroup$
    @Bimpelrekkie looks like someone already fixed it for me. I already mentioned Atmel and atmega328. but it doesn't matter as that's an example. afaik atmega328p doesn't have a PPL? I was mostly curious about how you can just simply multiply it. thankfully Marcus Muller already explained it very well.
    $endgroup$
    – Amy Gamble
    May 26 at 14:14










  • $begingroup$
    the processor in the computer you are reading this on is likely using a 100Mhz reference clock or slower yet the core runs in the ghz.
    $endgroup$
    – old_timer
    May 26 at 18:43














12












12








12


4



$begingroup$


So before this I only worked with simple 8 bit Atmel MCUs and I realized on my development board schematics it has only a 12Mhz crystal, yet the MCU operates at up to 100MHz. (I think the default is 80MHz. I only made it higher once for fun. It's just a simple line in the code.)



How does it do that? Why does an Atmega328, for example, run at the used crystal speed?










share|improve this question









New contributor



Amy Gamble is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.






$endgroup$




So before this I only worked with simple 8 bit Atmel MCUs and I realized on my development board schematics it has only a 12Mhz crystal, yet the MCU operates at up to 100MHz. (I think the default is 80MHz. I only made it higher once for fun. It's just a simple line in the code.)



How does it do that? Why does an Atmega328, for example, run at the used crystal speed?







arm crystal cortex-m






share|improve this question









New contributor



Amy Gamble is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.










share|improve this question









New contributor



Amy Gamble is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.








share|improve this question




share|improve this question








edited May 26 at 12:11









JRE

25.8k64786




25.8k64786






New contributor



Amy Gamble is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.








asked May 26 at 11:55









Amy GambleAmy Gamble

694




694




New contributor



Amy Gamble is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.




New contributor




Amy Gamble is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.









  • 5




    $begingroup$
    1) mHz means milli Hertz so 1/1000th of a Hertz, use MHz (capital M) when you mean Mega Hertz. 2) what 8 Bit MCU? 3) What development board? 4) The ATMega 328 doesn't have to run at the crystal's speed, read the section of clocking in the datasheet to see what is possible. 5) Some ICs have a PLL which can be used to multiply the external clock frequency.
    $endgroup$
    – Bimpelrekkie
    May 26 at 12:03






  • 1




    $begingroup$
    @Bimpelrekkie: Most of that comment is the answer. Would you like to make an answer of it?
    $endgroup$
    – JRE
    May 26 at 12:12










  • $begingroup$
    VCO divider to compare with 12 MHz ends up multiplying f. Thats what a PLL freq synth does.
    $endgroup$
    – Sunnyskyguy EE75
    May 26 at 12:43











  • $begingroup$
    @Bimpelrekkie looks like someone already fixed it for me. I already mentioned Atmel and atmega328. but it doesn't matter as that's an example. afaik atmega328p doesn't have a PPL? I was mostly curious about how you can just simply multiply it. thankfully Marcus Muller already explained it very well.
    $endgroup$
    – Amy Gamble
    May 26 at 14:14










  • $begingroup$
    the processor in the computer you are reading this on is likely using a 100Mhz reference clock or slower yet the core runs in the ghz.
    $endgroup$
    – old_timer
    May 26 at 18:43













  • 5




    $begingroup$
    1) mHz means milli Hertz so 1/1000th of a Hertz, use MHz (capital M) when you mean Mega Hertz. 2) what 8 Bit MCU? 3) What development board? 4) The ATMega 328 doesn't have to run at the crystal's speed, read the section of clocking in the datasheet to see what is possible. 5) Some ICs have a PLL which can be used to multiply the external clock frequency.
    $endgroup$
    – Bimpelrekkie
    May 26 at 12:03






  • 1




    $begingroup$
    @Bimpelrekkie: Most of that comment is the answer. Would you like to make an answer of it?
    $endgroup$
    – JRE
    May 26 at 12:12










  • $begingroup$
    VCO divider to compare with 12 MHz ends up multiplying f. Thats what a PLL freq synth does.
    $endgroup$
    – Sunnyskyguy EE75
    May 26 at 12:43











  • $begingroup$
    @Bimpelrekkie looks like someone already fixed it for me. I already mentioned Atmel and atmega328. but it doesn't matter as that's an example. afaik atmega328p doesn't have a PPL? I was mostly curious about how you can just simply multiply it. thankfully Marcus Muller already explained it very well.
    $endgroup$
    – Amy Gamble
    May 26 at 14:14










  • $begingroup$
    the processor in the computer you are reading this on is likely using a 100Mhz reference clock or slower yet the core runs in the ghz.
    $endgroup$
    – old_timer
    May 26 at 18:43








5




5




$begingroup$
1) mHz means milli Hertz so 1/1000th of a Hertz, use MHz (capital M) when you mean Mega Hertz. 2) what 8 Bit MCU? 3) What development board? 4) The ATMega 328 doesn't have to run at the crystal's speed, read the section of clocking in the datasheet to see what is possible. 5) Some ICs have a PLL which can be used to multiply the external clock frequency.
$endgroup$
– Bimpelrekkie
May 26 at 12:03




$begingroup$
1) mHz means milli Hertz so 1/1000th of a Hertz, use MHz (capital M) when you mean Mega Hertz. 2) what 8 Bit MCU? 3) What development board? 4) The ATMega 328 doesn't have to run at the crystal's speed, read the section of clocking in the datasheet to see what is possible. 5) Some ICs have a PLL which can be used to multiply the external clock frequency.
$endgroup$
– Bimpelrekkie
May 26 at 12:03




1




1




$begingroup$
@Bimpelrekkie: Most of that comment is the answer. Would you like to make an answer of it?
$endgroup$
– JRE
May 26 at 12:12




$begingroup$
@Bimpelrekkie: Most of that comment is the answer. Would you like to make an answer of it?
$endgroup$
– JRE
May 26 at 12:12












$begingroup$
VCO divider to compare with 12 MHz ends up multiplying f. Thats what a PLL freq synth does.
$endgroup$
– Sunnyskyguy EE75
May 26 at 12:43





$begingroup$
VCO divider to compare with 12 MHz ends up multiplying f. Thats what a PLL freq synth does.
$endgroup$
– Sunnyskyguy EE75
May 26 at 12:43













$begingroup$
@Bimpelrekkie looks like someone already fixed it for me. I already mentioned Atmel and atmega328. but it doesn't matter as that's an example. afaik atmega328p doesn't have a PPL? I was mostly curious about how you can just simply multiply it. thankfully Marcus Muller already explained it very well.
$endgroup$
– Amy Gamble
May 26 at 14:14




$begingroup$
@Bimpelrekkie looks like someone already fixed it for me. I already mentioned Atmel and atmega328. but it doesn't matter as that's an example. afaik atmega328p doesn't have a PPL? I was mostly curious about how you can just simply multiply it. thankfully Marcus Muller already explained it very well.
$endgroup$
– Amy Gamble
May 26 at 14:14












$begingroup$
the processor in the computer you are reading this on is likely using a 100Mhz reference clock or slower yet the core runs in the ghz.
$endgroup$
– old_timer
May 26 at 18:43





$begingroup$
the processor in the computer you are reading this on is likely using a 100Mhz reference clock or slower yet the core runs in the ghz.
$endgroup$
– old_timer
May 26 at 18:43











2 Answers
2






active

oldest

votes


















27












$begingroup$

This doesn't have anything to do with the core being an ARM processor; it's about how the clocking circuitry works:



In many systems like microcontrollers, RF chips, audio chips, … you need to generate a faster clock that is an exact multiple of some reference clock (for example, an external crystal).



You do that by having a voltage-controlled oscillator (VCO) that you can adjust in frequency by in- or decreasing a control voltage.



Now, by just setting any control voltage, you can bring that to oscillate at a frequency roughly in the right "ballpark", but not at an exact multiple of the input frequency. Especially, VCOs can be a bit drifty, so that frequency will also continously "wander" all over the place. You need to control that oscillator by comparing it to the reference oscillator.



The way to do that is by employing a Phase-Locked Loop. The idea is simple:



  1. Divide the frequency that comes out of the VCO by a factor $N$; that's the factor that we want the VCO to be faster than the reference. Doing that is easy: You can, for example, simply use a digital counter that counts to N and only then changes the output.

  2. Compare that $f_textVCO/N$ clock with the reference clock at $f_textref$.
    If one is faster than the other, adjust the frequency accordingly. You can do that in a digital way by just XOR'ing both clocks – ideally, if they are identical, the result is a constant 0, but if one is faster than the other, then there will be a growing amount of times when the XOR of both clocks is 1; slow down or speed up the VCO accordingly.

The above is a control loop, locked to the phase of – hence the name.



For "rich" microcontrollers, which have a lot of peripherals and hence benefit from having multiple clocks internally, it's usual to have at least 1 PLL. The ATMega328 is a bit strange in that respect: It's a relatively power-hungry, relatively peripheral-rich microcontroller that still doesn't have a PLL.






share|improve this answer









$endgroup$








  • 1




    $begingroup$
    Thanks you :) this explains it very well! Instead of poking fun or focusing on my silly mistakes you just told me what I'm obviously asking. Some things are VERY hard for me to pay attention to with my Dyslexia. Even if I read trough my post 2-3 times I miss a lot of makes or accidentally put capitalization where I don't need to. Not to mention English isn't my first language.
    $endgroup$
    – Amy Gamble
    May 26 at 14:07







  • 6




    $begingroup$
    @AmyGamble your English is very good, however! I think the first comment you got under your post was because very many young engineers simply forget about capitalization of units – which can become very problematic later on :) I hope you never feel discouraged!
    $endgroup$
    – Marcus Müller
    May 26 at 20:03


















8












$begingroup$

Some devices have a PLL in them that can multiply the crystal frequency to higher frequencies. The ATMega328 does not have a PLL, it uses the crystal directly.






share|improve this answer









$endgroup$













    Your Answer






    StackExchange.ifUsing("editor", function ()
    return StackExchange.using("schematics", function ()
    StackExchange.schematics.init();
    );
    , "cicuitlab");

    StackExchange.ready(function()
    var channelOptions =
    tags: "".split(" "),
    id: "135"
    ;
    initTagRenderer("".split(" "), "".split(" "), channelOptions);

    StackExchange.using("externalEditor", function()
    // Have to fire editor after snippets, if snippets enabled
    if (StackExchange.settings.snippets.snippetsEnabled)
    StackExchange.using("snippets", function()
    createEditor();
    );

    else
    createEditor();

    );

    function createEditor()
    StackExchange.prepareEditor(
    heartbeatType: 'answer',
    autoActivateHeartbeat: false,
    convertImagesToLinks: false,
    noModals: true,
    showLowRepImageUploadWarning: true,
    reputationToPostImages: null,
    bindNavPrevention: true,
    postfix: "",
    imageUploader:
    brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
    contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
    allowUrls: true
    ,
    onDemand: true,
    discardSelector: ".discard-answer"
    ,immediatelyShowMarkdownHelp:true
    );



    );






    Amy Gamble is a new contributor. Be nice, and check out our Code of Conduct.









    draft saved

    draft discarded


















    StackExchange.ready(
    function ()
    StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2felectronics.stackexchange.com%2fquestions%2f440471%2fhow-does-an-arm-mcu-run-faster-than-the-external-crystal%23new-answer', 'question_page');

    );

    Post as a guest















    Required, but never shown

























    2 Answers
    2






    active

    oldest

    votes








    2 Answers
    2






    active

    oldest

    votes









    active

    oldest

    votes






    active

    oldest

    votes









    27












    $begingroup$

    This doesn't have anything to do with the core being an ARM processor; it's about how the clocking circuitry works:



    In many systems like microcontrollers, RF chips, audio chips, … you need to generate a faster clock that is an exact multiple of some reference clock (for example, an external crystal).



    You do that by having a voltage-controlled oscillator (VCO) that you can adjust in frequency by in- or decreasing a control voltage.



    Now, by just setting any control voltage, you can bring that to oscillate at a frequency roughly in the right "ballpark", but not at an exact multiple of the input frequency. Especially, VCOs can be a bit drifty, so that frequency will also continously "wander" all over the place. You need to control that oscillator by comparing it to the reference oscillator.



    The way to do that is by employing a Phase-Locked Loop. The idea is simple:



    1. Divide the frequency that comes out of the VCO by a factor $N$; that's the factor that we want the VCO to be faster than the reference. Doing that is easy: You can, for example, simply use a digital counter that counts to N and only then changes the output.

    2. Compare that $f_textVCO/N$ clock with the reference clock at $f_textref$.
      If one is faster than the other, adjust the frequency accordingly. You can do that in a digital way by just XOR'ing both clocks – ideally, if they are identical, the result is a constant 0, but if one is faster than the other, then there will be a growing amount of times when the XOR of both clocks is 1; slow down or speed up the VCO accordingly.

    The above is a control loop, locked to the phase of – hence the name.



    For "rich" microcontrollers, which have a lot of peripherals and hence benefit from having multiple clocks internally, it's usual to have at least 1 PLL. The ATMega328 is a bit strange in that respect: It's a relatively power-hungry, relatively peripheral-rich microcontroller that still doesn't have a PLL.






    share|improve this answer









    $endgroup$








    • 1




      $begingroup$
      Thanks you :) this explains it very well! Instead of poking fun or focusing on my silly mistakes you just told me what I'm obviously asking. Some things are VERY hard for me to pay attention to with my Dyslexia. Even if I read trough my post 2-3 times I miss a lot of makes or accidentally put capitalization where I don't need to. Not to mention English isn't my first language.
      $endgroup$
      – Amy Gamble
      May 26 at 14:07







    • 6




      $begingroup$
      @AmyGamble your English is very good, however! I think the first comment you got under your post was because very many young engineers simply forget about capitalization of units – which can become very problematic later on :) I hope you never feel discouraged!
      $endgroup$
      – Marcus Müller
      May 26 at 20:03















    27












    $begingroup$

    This doesn't have anything to do with the core being an ARM processor; it's about how the clocking circuitry works:



    In many systems like microcontrollers, RF chips, audio chips, … you need to generate a faster clock that is an exact multiple of some reference clock (for example, an external crystal).



    You do that by having a voltage-controlled oscillator (VCO) that you can adjust in frequency by in- or decreasing a control voltage.



    Now, by just setting any control voltage, you can bring that to oscillate at a frequency roughly in the right "ballpark", but not at an exact multiple of the input frequency. Especially, VCOs can be a bit drifty, so that frequency will also continously "wander" all over the place. You need to control that oscillator by comparing it to the reference oscillator.



    The way to do that is by employing a Phase-Locked Loop. The idea is simple:



    1. Divide the frequency that comes out of the VCO by a factor $N$; that's the factor that we want the VCO to be faster than the reference. Doing that is easy: You can, for example, simply use a digital counter that counts to N and only then changes the output.

    2. Compare that $f_textVCO/N$ clock with the reference clock at $f_textref$.
      If one is faster than the other, adjust the frequency accordingly. You can do that in a digital way by just XOR'ing both clocks – ideally, if they are identical, the result is a constant 0, but if one is faster than the other, then there will be a growing amount of times when the XOR of both clocks is 1; slow down or speed up the VCO accordingly.

    The above is a control loop, locked to the phase of – hence the name.



    For "rich" microcontrollers, which have a lot of peripherals and hence benefit from having multiple clocks internally, it's usual to have at least 1 PLL. The ATMega328 is a bit strange in that respect: It's a relatively power-hungry, relatively peripheral-rich microcontroller that still doesn't have a PLL.






    share|improve this answer









    $endgroup$








    • 1




      $begingroup$
      Thanks you :) this explains it very well! Instead of poking fun or focusing on my silly mistakes you just told me what I'm obviously asking. Some things are VERY hard for me to pay attention to with my Dyslexia. Even if I read trough my post 2-3 times I miss a lot of makes or accidentally put capitalization where I don't need to. Not to mention English isn't my first language.
      $endgroup$
      – Amy Gamble
      May 26 at 14:07







    • 6




      $begingroup$
      @AmyGamble your English is very good, however! I think the first comment you got under your post was because very many young engineers simply forget about capitalization of units – which can become very problematic later on :) I hope you never feel discouraged!
      $endgroup$
      – Marcus Müller
      May 26 at 20:03













    27












    27








    27





    $begingroup$

    This doesn't have anything to do with the core being an ARM processor; it's about how the clocking circuitry works:



    In many systems like microcontrollers, RF chips, audio chips, … you need to generate a faster clock that is an exact multiple of some reference clock (for example, an external crystal).



    You do that by having a voltage-controlled oscillator (VCO) that you can adjust in frequency by in- or decreasing a control voltage.



    Now, by just setting any control voltage, you can bring that to oscillate at a frequency roughly in the right "ballpark", but not at an exact multiple of the input frequency. Especially, VCOs can be a bit drifty, so that frequency will also continously "wander" all over the place. You need to control that oscillator by comparing it to the reference oscillator.



    The way to do that is by employing a Phase-Locked Loop. The idea is simple:



    1. Divide the frequency that comes out of the VCO by a factor $N$; that's the factor that we want the VCO to be faster than the reference. Doing that is easy: You can, for example, simply use a digital counter that counts to N and only then changes the output.

    2. Compare that $f_textVCO/N$ clock with the reference clock at $f_textref$.
      If one is faster than the other, adjust the frequency accordingly. You can do that in a digital way by just XOR'ing both clocks – ideally, if they are identical, the result is a constant 0, but if one is faster than the other, then there will be a growing amount of times when the XOR of both clocks is 1; slow down or speed up the VCO accordingly.

    The above is a control loop, locked to the phase of – hence the name.



    For "rich" microcontrollers, which have a lot of peripherals and hence benefit from having multiple clocks internally, it's usual to have at least 1 PLL. The ATMega328 is a bit strange in that respect: It's a relatively power-hungry, relatively peripheral-rich microcontroller that still doesn't have a PLL.






    share|improve this answer









    $endgroup$



    This doesn't have anything to do with the core being an ARM processor; it's about how the clocking circuitry works:



    In many systems like microcontrollers, RF chips, audio chips, … you need to generate a faster clock that is an exact multiple of some reference clock (for example, an external crystal).



    You do that by having a voltage-controlled oscillator (VCO) that you can adjust in frequency by in- or decreasing a control voltage.



    Now, by just setting any control voltage, you can bring that to oscillate at a frequency roughly in the right "ballpark", but not at an exact multiple of the input frequency. Especially, VCOs can be a bit drifty, so that frequency will also continously "wander" all over the place. You need to control that oscillator by comparing it to the reference oscillator.



    The way to do that is by employing a Phase-Locked Loop. The idea is simple:



    1. Divide the frequency that comes out of the VCO by a factor $N$; that's the factor that we want the VCO to be faster than the reference. Doing that is easy: You can, for example, simply use a digital counter that counts to N and only then changes the output.

    2. Compare that $f_textVCO/N$ clock with the reference clock at $f_textref$.
      If one is faster than the other, adjust the frequency accordingly. You can do that in a digital way by just XOR'ing both clocks – ideally, if they are identical, the result is a constant 0, but if one is faster than the other, then there will be a growing amount of times when the XOR of both clocks is 1; slow down or speed up the VCO accordingly.

    The above is a control loop, locked to the phase of – hence the name.



    For "rich" microcontrollers, which have a lot of peripherals and hence benefit from having multiple clocks internally, it's usual to have at least 1 PLL. The ATMega328 is a bit strange in that respect: It's a relatively power-hungry, relatively peripheral-rich microcontroller that still doesn't have a PLL.







    share|improve this answer












    share|improve this answer



    share|improve this answer










    answered May 26 at 12:37









    Marcus MüllerMarcus Müller

    37k364104




    37k364104







    • 1




      $begingroup$
      Thanks you :) this explains it very well! Instead of poking fun or focusing on my silly mistakes you just told me what I'm obviously asking. Some things are VERY hard for me to pay attention to with my Dyslexia. Even if I read trough my post 2-3 times I miss a lot of makes or accidentally put capitalization where I don't need to. Not to mention English isn't my first language.
      $endgroup$
      – Amy Gamble
      May 26 at 14:07







    • 6




      $begingroup$
      @AmyGamble your English is very good, however! I think the first comment you got under your post was because very many young engineers simply forget about capitalization of units – which can become very problematic later on :) I hope you never feel discouraged!
      $endgroup$
      – Marcus Müller
      May 26 at 20:03












    • 1




      $begingroup$
      Thanks you :) this explains it very well! Instead of poking fun or focusing on my silly mistakes you just told me what I'm obviously asking. Some things are VERY hard for me to pay attention to with my Dyslexia. Even if I read trough my post 2-3 times I miss a lot of makes or accidentally put capitalization where I don't need to. Not to mention English isn't my first language.
      $endgroup$
      – Amy Gamble
      May 26 at 14:07







    • 6




      $begingroup$
      @AmyGamble your English is very good, however! I think the first comment you got under your post was because very many young engineers simply forget about capitalization of units – which can become very problematic later on :) I hope you never feel discouraged!
      $endgroup$
      – Marcus Müller
      May 26 at 20:03







    1




    1




    $begingroup$
    Thanks you :) this explains it very well! Instead of poking fun or focusing on my silly mistakes you just told me what I'm obviously asking. Some things are VERY hard for me to pay attention to with my Dyslexia. Even if I read trough my post 2-3 times I miss a lot of makes or accidentally put capitalization where I don't need to. Not to mention English isn't my first language.
    $endgroup$
    – Amy Gamble
    May 26 at 14:07





    $begingroup$
    Thanks you :) this explains it very well! Instead of poking fun or focusing on my silly mistakes you just told me what I'm obviously asking. Some things are VERY hard for me to pay attention to with my Dyslexia. Even if I read trough my post 2-3 times I miss a lot of makes or accidentally put capitalization where I don't need to. Not to mention English isn't my first language.
    $endgroup$
    – Amy Gamble
    May 26 at 14:07





    6




    6




    $begingroup$
    @AmyGamble your English is very good, however! I think the first comment you got under your post was because very many young engineers simply forget about capitalization of units – which can become very problematic later on :) I hope you never feel discouraged!
    $endgroup$
    – Marcus Müller
    May 26 at 20:03




    $begingroup$
    @AmyGamble your English is very good, however! I think the first comment you got under your post was because very many young engineers simply forget about capitalization of units – which can become very problematic later on :) I hope you never feel discouraged!
    $endgroup$
    – Marcus Müller
    May 26 at 20:03













    8












    $begingroup$

    Some devices have a PLL in them that can multiply the crystal frequency to higher frequencies. The ATMega328 does not have a PLL, it uses the crystal directly.






    share|improve this answer









    $endgroup$

















      8












      $begingroup$

      Some devices have a PLL in them that can multiply the crystal frequency to higher frequencies. The ATMega328 does not have a PLL, it uses the crystal directly.






      share|improve this answer









      $endgroup$















        8












        8








        8





        $begingroup$

        Some devices have a PLL in them that can multiply the crystal frequency to higher frequencies. The ATMega328 does not have a PLL, it uses the crystal directly.






        share|improve this answer









        $endgroup$



        Some devices have a PLL in them that can multiply the crystal frequency to higher frequencies. The ATMega328 does not have a PLL, it uses the crystal directly.







        share|improve this answer












        share|improve this answer



        share|improve this answer










        answered May 26 at 12:13









        JustmeJustme

        4,0732615




        4,0732615




















            Amy Gamble is a new contributor. Be nice, and check out our Code of Conduct.









            draft saved

            draft discarded


















            Amy Gamble is a new contributor. Be nice, and check out our Code of Conduct.












            Amy Gamble is a new contributor. Be nice, and check out our Code of Conduct.











            Amy Gamble is a new contributor. Be nice, and check out our Code of Conduct.














            Thanks for contributing an answer to Electrical Engineering Stack Exchange!


            • Please be sure to answer the question. Provide details and share your research!

            But avoid


            • Asking for help, clarification, or responding to other answers.

            • Making statements based on opinion; back them up with references or personal experience.

            Use MathJax to format equations. MathJax reference.


            To learn more, see our tips on writing great answers.




            draft saved


            draft discarded














            StackExchange.ready(
            function ()
            StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2felectronics.stackexchange.com%2fquestions%2f440471%2fhow-does-an-arm-mcu-run-faster-than-the-external-crystal%23new-answer', 'question_page');

            );

            Post as a guest















            Required, but never shown





















































            Required, but never shown














            Required, but never shown












            Required, but never shown







            Required, but never shown

































            Required, but never shown














            Required, but never shown












            Required, but never shown







            Required, but never shown







            Popular posts from this blog

            Category:9 (number) SubcategoriesMedia in category "9 (number)"Navigation menuUpload mediaGND ID: 4485639-8Library of Congress authority ID: sh85091979ReasonatorScholiaStatistics

            Circuit construction for execution of conditional statements using least significant bitHow are two different registers being used as “control”?How exactly is the stated composite state of the two registers being produced using the $R_zz$ controlled rotations?Efficiently performing controlled rotations in HHLWould this quantum algorithm implementation work?How to prepare a superposed states of odd integers from $1$ to $sqrtN$?Why is this implementation of the order finding algorithm not working?Circuit construction for Hamiltonian simulationHow can I invert the least significant bit of a certain term of a superposed state?Implementing an oracleImplementing a controlled sum operation

            Magento 2 “No Payment Methods” in Admin New OrderHow to integrate Paypal Express Checkout with the Magento APIMagento 1.5 - Sales > Order > edit order and shipping methods disappearAuto Invoice Check/Money Order Payment methodAdd more simple payment methods?Shipping methods not showingWhat should I do to change payment methods if changing the configuration has no effects?1.9 - No Payment Methods showing upMy Payment Methods not Showing for downloadable/virtual product when checkout?Magento2 API to access internal payment methodHow to call an existing payment methods in the registration form?