Difference between internal and external oscillator for a microcontroller?

The name of the pictureThe name of the pictureThe name of the pictureClash Royale CLAN TAG#URR8PPP











up vote
1
down vote

favorite












I am a beginner with respect to microcontrollers, so I just want to ask is there two option for choosing the frequency of the microcontroller: to be internal or external?



If there is internal frequency available in the controller, then we don't need to use external crystal oscillator?










share|improve this question









New contributor




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























    up vote
    1
    down vote

    favorite












    I am a beginner with respect to microcontrollers, so I just want to ask is there two option for choosing the frequency of the microcontroller: to be internal or external?



    If there is internal frequency available in the controller, then we don't need to use external crystal oscillator?










    share|improve this question









    New contributor




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





















      up vote
      1
      down vote

      favorite









      up vote
      1
      down vote

      favorite











      I am a beginner with respect to microcontrollers, so I just want to ask is there two option for choosing the frequency of the microcontroller: to be internal or external?



      If there is internal frequency available in the controller, then we don't need to use external crystal oscillator?










      share|improve this question









      New contributor




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











      I am a beginner with respect to microcontrollers, so I just want to ask is there two option for choosing the frequency of the microcontroller: to be internal or external?



      If there is internal frequency available in the controller, then we don't need to use external crystal oscillator?







      microcontroller oscillator frequency timer






      share|improve this question









      New contributor




      Varun Sahni 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




      Varun Sahni 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 48 mins ago









      Greenonline

      6212722




      6212722






      New contributor




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









      asked 3 hours ago









      Varun Sahni

      61




      61




      New contributor




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





      New contributor





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






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




















          3 Answers
          3






          active

          oldest

          votes

















          up vote
          2
          down vote













          Main difference is that the internal oscillator is usually a RC type oscillator which is not very accurate. External oscillators can be of type quartz crystal which are far more accurate.






          share|improve this answer



























            up vote
            2
            down vote













            It depends on what you want to use the processor for, the manufacturer, etc.
            RC internal oscillators are "only" good for 1-2% accuracy, there are some processors that have tuning adjustment registers that allow you to shift the frequency, so with the right software/calibration, etc. you can get better results.



            For (asynchronous) serial port type communications, the RC inaccuracy can become critical at high baud speeds (generally 230kbps and above, depending on processor and baud rate clock flexibility)



            With RC oscillators you typically get 1 or 2 frequencies unless the MCU offers PLL capabilities in which case there can be a wide range. This can be used to advantage to dynamically scale the clock speed for battery powered situations where you can't go to 'sleep' due to complicated monitoring situations, but don't have to be running flat-out.



            A crystal can get you any frequency you would want within the MCU operating limits, however you need to verify that the loading is correct so that the oscillator starts up correctly and is accurate and stable over time and temperature.



            The RC internal oscillator is generally guaranteed to work by the manufacturer with no hardware design issues.






            share|improve this answer








            New contributor




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













            • 1




              Good answer, but I'm not sure about "RC inaccuracy can become critical at high baud speeds". Why would that be the case? Because of more limited divisor selection for baudrate, or am I missing something?
              – domen
              59 mins ago

















            up vote
            0
            down vote













            Most practical differences I have encountered:



            1. Frequency stability (especially across different temperatures). It depends on your application if you need a very stable clock or not. I had issues once using an ATmega8 running from the internal oscillator with an UART that lost sync below zero. For VGA a crystal is a must.


            2. Power consumption - internal oscillators usually will be more power efficient than external crystals


            3. Available frequencies. For example to get ideal 115200 baud UART timing on an ATmega8 you will need a clock with an "oddball" frequency of 7.3728 MHz, while the closest frequency the internal clock can only deliver 8 Mhz (so some bauds will not be available).


            Depending on the exact MCU you can also get great clock stability if you use it as an USB device. The internal oscillator can lock on to the clock signal from the USB host (that is crystal-stabilized).






            share|improve this answer




















              Your Answer




              StackExchange.ifUsing("editor", function ()
              return StackExchange.using("mathjaxEditing", function ()
              StackExchange.MarkdownEditor.creationCallbacks.add(function (editor, postfix)
              StackExchange.mathjaxEditing.prepareWmdForMathJax(editor, postfix, [["\$", "\$"]]);
              );
              );
              , "mathjax-editing");

              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',
              convertImagesToLinks: false,
              noModals: false,
              showLowRepImageUploadWarning: true,
              reputationToPostImages: null,
              bindNavPrevention: true,
              postfix: "",
              onDemand: true,
              discardSelector: ".discard-answer"
              ,immediatelyShowMarkdownHelp:true
              );



              );






              Varun Sahni 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%2f401594%2fdifference-between-internal-and-external-oscillator-for-a-microcontroller%23new-answer', 'question_page');

              );

              Post as a guest






























              3 Answers
              3






              active

              oldest

              votes








              3 Answers
              3






              active

              oldest

              votes









              active

              oldest

              votes






              active

              oldest

              votes








              up vote
              2
              down vote













              Main difference is that the internal oscillator is usually a RC type oscillator which is not very accurate. External oscillators can be of type quartz crystal which are far more accurate.






              share|improve this answer
























                up vote
                2
                down vote













                Main difference is that the internal oscillator is usually a RC type oscillator which is not very accurate. External oscillators can be of type quartz crystal which are far more accurate.






                share|improve this answer






















                  up vote
                  2
                  down vote










                  up vote
                  2
                  down vote









                  Main difference is that the internal oscillator is usually a RC type oscillator which is not very accurate. External oscillators can be of type quartz crystal which are far more accurate.






                  share|improve this answer












                  Main difference is that the internal oscillator is usually a RC type oscillator which is not very accurate. External oscillators can be of type quartz crystal which are far more accurate.







                  share|improve this answer












                  share|improve this answer



                  share|improve this answer










                  answered 3 hours ago









                  Stefan Wyss

                  1,21512




                  1,21512






















                      up vote
                      2
                      down vote













                      It depends on what you want to use the processor for, the manufacturer, etc.
                      RC internal oscillators are "only" good for 1-2% accuracy, there are some processors that have tuning adjustment registers that allow you to shift the frequency, so with the right software/calibration, etc. you can get better results.



                      For (asynchronous) serial port type communications, the RC inaccuracy can become critical at high baud speeds (generally 230kbps and above, depending on processor and baud rate clock flexibility)



                      With RC oscillators you typically get 1 or 2 frequencies unless the MCU offers PLL capabilities in which case there can be a wide range. This can be used to advantage to dynamically scale the clock speed for battery powered situations where you can't go to 'sleep' due to complicated monitoring situations, but don't have to be running flat-out.



                      A crystal can get you any frequency you would want within the MCU operating limits, however you need to verify that the loading is correct so that the oscillator starts up correctly and is accurate and stable over time and temperature.



                      The RC internal oscillator is generally guaranteed to work by the manufacturer with no hardware design issues.






                      share|improve this answer








                      New contributor




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













                      • 1




                        Good answer, but I'm not sure about "RC inaccuracy can become critical at high baud speeds". Why would that be the case? Because of more limited divisor selection for baudrate, or am I missing something?
                        – domen
                        59 mins ago














                      up vote
                      2
                      down vote













                      It depends on what you want to use the processor for, the manufacturer, etc.
                      RC internal oscillators are "only" good for 1-2% accuracy, there are some processors that have tuning adjustment registers that allow you to shift the frequency, so with the right software/calibration, etc. you can get better results.



                      For (asynchronous) serial port type communications, the RC inaccuracy can become critical at high baud speeds (generally 230kbps and above, depending on processor and baud rate clock flexibility)



                      With RC oscillators you typically get 1 or 2 frequencies unless the MCU offers PLL capabilities in which case there can be a wide range. This can be used to advantage to dynamically scale the clock speed for battery powered situations where you can't go to 'sleep' due to complicated monitoring situations, but don't have to be running flat-out.



                      A crystal can get you any frequency you would want within the MCU operating limits, however you need to verify that the loading is correct so that the oscillator starts up correctly and is accurate and stable over time and temperature.



                      The RC internal oscillator is generally guaranteed to work by the manufacturer with no hardware design issues.






                      share|improve this answer








                      New contributor




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













                      • 1




                        Good answer, but I'm not sure about "RC inaccuracy can become critical at high baud speeds". Why would that be the case? Because of more limited divisor selection for baudrate, or am I missing something?
                        – domen
                        59 mins ago












                      up vote
                      2
                      down vote










                      up vote
                      2
                      down vote









                      It depends on what you want to use the processor for, the manufacturer, etc.
                      RC internal oscillators are "only" good for 1-2% accuracy, there are some processors that have tuning adjustment registers that allow you to shift the frequency, so with the right software/calibration, etc. you can get better results.



                      For (asynchronous) serial port type communications, the RC inaccuracy can become critical at high baud speeds (generally 230kbps and above, depending on processor and baud rate clock flexibility)



                      With RC oscillators you typically get 1 or 2 frequencies unless the MCU offers PLL capabilities in which case there can be a wide range. This can be used to advantage to dynamically scale the clock speed for battery powered situations where you can't go to 'sleep' due to complicated monitoring situations, but don't have to be running flat-out.



                      A crystal can get you any frequency you would want within the MCU operating limits, however you need to verify that the loading is correct so that the oscillator starts up correctly and is accurate and stable over time and temperature.



                      The RC internal oscillator is generally guaranteed to work by the manufacturer with no hardware design issues.






                      share|improve this answer








                      New contributor




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









                      It depends on what you want to use the processor for, the manufacturer, etc.
                      RC internal oscillators are "only" good for 1-2% accuracy, there are some processors that have tuning adjustment registers that allow you to shift the frequency, so with the right software/calibration, etc. you can get better results.



                      For (asynchronous) serial port type communications, the RC inaccuracy can become critical at high baud speeds (generally 230kbps and above, depending on processor and baud rate clock flexibility)



                      With RC oscillators you typically get 1 or 2 frequencies unless the MCU offers PLL capabilities in which case there can be a wide range. This can be used to advantage to dynamically scale the clock speed for battery powered situations where you can't go to 'sleep' due to complicated monitoring situations, but don't have to be running flat-out.



                      A crystal can get you any frequency you would want within the MCU operating limits, however you need to verify that the loading is correct so that the oscillator starts up correctly and is accurate and stable over time and temperature.



                      The RC internal oscillator is generally guaranteed to work by the manufacturer with no hardware design issues.







                      share|improve this answer








                      New contributor




                      isdi 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 answer



                      share|improve this answer






                      New contributor




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









                      answered 2 hours ago









                      isdi

                      513




                      513




                      New contributor




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





                      New contributor





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






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







                      • 1




                        Good answer, but I'm not sure about "RC inaccuracy can become critical at high baud speeds". Why would that be the case? Because of more limited divisor selection for baudrate, or am I missing something?
                        – domen
                        59 mins ago












                      • 1




                        Good answer, but I'm not sure about "RC inaccuracy can become critical at high baud speeds". Why would that be the case? Because of more limited divisor selection for baudrate, or am I missing something?
                        – domen
                        59 mins ago







                      1




                      1




                      Good answer, but I'm not sure about "RC inaccuracy can become critical at high baud speeds". Why would that be the case? Because of more limited divisor selection for baudrate, or am I missing something?
                      – domen
                      59 mins ago




                      Good answer, but I'm not sure about "RC inaccuracy can become critical at high baud speeds". Why would that be the case? Because of more limited divisor selection for baudrate, or am I missing something?
                      – domen
                      59 mins ago










                      up vote
                      0
                      down vote













                      Most practical differences I have encountered:



                      1. Frequency stability (especially across different temperatures). It depends on your application if you need a very stable clock or not. I had issues once using an ATmega8 running from the internal oscillator with an UART that lost sync below zero. For VGA a crystal is a must.


                      2. Power consumption - internal oscillators usually will be more power efficient than external crystals


                      3. Available frequencies. For example to get ideal 115200 baud UART timing on an ATmega8 you will need a clock with an "oddball" frequency of 7.3728 MHz, while the closest frequency the internal clock can only deliver 8 Mhz (so some bauds will not be available).


                      Depending on the exact MCU you can also get great clock stability if you use it as an USB device. The internal oscillator can lock on to the clock signal from the USB host (that is crystal-stabilized).






                      share|improve this answer
























                        up vote
                        0
                        down vote













                        Most practical differences I have encountered:



                        1. Frequency stability (especially across different temperatures). It depends on your application if you need a very stable clock or not. I had issues once using an ATmega8 running from the internal oscillator with an UART that lost sync below zero. For VGA a crystal is a must.


                        2. Power consumption - internal oscillators usually will be more power efficient than external crystals


                        3. Available frequencies. For example to get ideal 115200 baud UART timing on an ATmega8 you will need a clock with an "oddball" frequency of 7.3728 MHz, while the closest frequency the internal clock can only deliver 8 Mhz (so some bauds will not be available).


                        Depending on the exact MCU you can also get great clock stability if you use it as an USB device. The internal oscillator can lock on to the clock signal from the USB host (that is crystal-stabilized).






                        share|improve this answer






















                          up vote
                          0
                          down vote










                          up vote
                          0
                          down vote









                          Most practical differences I have encountered:



                          1. Frequency stability (especially across different temperatures). It depends on your application if you need a very stable clock or not. I had issues once using an ATmega8 running from the internal oscillator with an UART that lost sync below zero. For VGA a crystal is a must.


                          2. Power consumption - internal oscillators usually will be more power efficient than external crystals


                          3. Available frequencies. For example to get ideal 115200 baud UART timing on an ATmega8 you will need a clock with an "oddball" frequency of 7.3728 MHz, while the closest frequency the internal clock can only deliver 8 Mhz (so some bauds will not be available).


                          Depending on the exact MCU you can also get great clock stability if you use it as an USB device. The internal oscillator can lock on to the clock signal from the USB host (that is crystal-stabilized).






                          share|improve this answer












                          Most practical differences I have encountered:



                          1. Frequency stability (especially across different temperatures). It depends on your application if you need a very stable clock or not. I had issues once using an ATmega8 running from the internal oscillator with an UART that lost sync below zero. For VGA a crystal is a must.


                          2. Power consumption - internal oscillators usually will be more power efficient than external crystals


                          3. Available frequencies. For example to get ideal 115200 baud UART timing on an ATmega8 you will need a clock with an "oddball" frequency of 7.3728 MHz, while the closest frequency the internal clock can only deliver 8 Mhz (so some bauds will not be available).


                          Depending on the exact MCU you can also get great clock stability if you use it as an USB device. The internal oscillator can lock on to the clock signal from the USB host (that is crystal-stabilized).







                          share|improve this answer












                          share|improve this answer



                          share|improve this answer










                          answered 10 mins ago









                          filo

                          5,5651930




                          5,5651930




















                              Varun Sahni is a new contributor. Be nice, and check out our Code of Conduct.









                               

                              draft saved


                              draft discarded


















                              Varun Sahni is a new contributor. Be nice, and check out our Code of Conduct.












                              Varun Sahni is a new contributor. Be nice, and check out our Code of Conduct.











                              Varun Sahni 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%2f401594%2fdifference-between-internal-and-external-oscillator-for-a-microcontroller%23new-answer', 'question_page');

                              );

                              Post as a guest













































































                              Comments

                              Popular posts from this blog

                              What does second last employer means? [closed]

                              List of Gilmore Girls characters

                              Confectionery