Skip to content
  • MySensors
  • OpenHardware.io
  • Categories
  • Recent
  • Tags
  • Popular
Skins
  • Light
  • Brite
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Brand Logo
  1. Home
  2. Hardware
  3. Running ATmega328P on internal 8MHz clock

Running ATmega328P on internal 8MHz clock

Scheduled Pinned Locked Moved Hardware
14 Posts 8 Posters 24.4k Views 6 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • siodS Offline
    siodS Offline
    siod
    wrote on last edited by
    #2

    Hi BartE,

    I´ve read the internal clock at 8 MHz is not as good as an external 8MHz clock because the accuracy of the internal oscillator seems to be only 10% (Atmel Datasheet page 323). What are your experiences? Would you recommend using internal or external OScillator?

    Also I am wondering why most people are running their custom PCB´s using 8MHz clocks instead of 16MHz. Is it only because of reducing the energy consumption? I think so.

    I originally planned to use 16MHz clocks, but now, from the energy consumption point of view, I will probably switch to the 8MHz variant...

    still learning...

    E 1 Reply Last reply
    0
    • tbowmoT Offline
      tbowmoT Offline
      tbowmo
      Admin
      wrote on last edited by
      #3

      @siod

      Yes, the lower your frequency is, the lower the power consumption is while running the program, but also the longer it takes to execute the program. So there is some trade offs on it.

      Although the RC oscillator isn't that accurate, it doesn't matter that much. Not many node types are that dependent on highly accurate timings, so it's not necessary to use an xtal oscillator, and thus you can save some $ on components.

      1 Reply Last reply
      0
      • BartEB Offline
        BartEB Offline
        BartE
        Contest Winner
        wrote on last edited by
        #4

        @siod Using a 16 MHz clock requires a 5 volt source. So running on 2 AA(A) batteries and thus 3 volt also limits the clock frequency to 8 MHz

        1 Reply Last reply
        0
        • siodS Offline
          siodS Offline
          siod
          wrote on last edited by
          #5

          @BartE
          Oh, didn´t know that 3 V automatically limits to 16MHz but good to know. I´ve already ordered a bunch of 16MHz Oscillators which I could still install and just run in 8MHz by powering with 2 AA batteries. Also I would stay flexible If I´d need 16MHz; Just use 5V!

          @tbowmo
          thanks for your explanation! After I used up my 16MHz Oscillators I will test a setup using the internal clock.

          still learning...

          1 Reply Last reply
          0
          • G Offline
            G Offline
            gloob
            wrote on last edited by gloob
            #6

            If you use an 16MHz oscillator and power the board with 3V, the board will run unstable as the ATMega does not support 16Mhz with 3V.
            If you just change the power, will not change the oscillator frequenzy. You have to Switch to the internal clock signal when powering the board with 3V and you have a 16MHz clock installed.

            1 Reply Last reply
            0
            • tbowmoT Offline
              tbowmoT Offline
              tbowmo
              Admin
              wrote on last edited by
              #7

              @gloob

              I think that there is a typo in your comment? I think you mean that "If you use an 16Mhz oscillator and power the board with 3V..."

              That would make the most sense in my world :)

              G 1 Reply Last reply
              0
              • tbowmoT tbowmo

                @gloob

                I think that there is a typo in your comment? I think you mean that "If you use an 16Mhz oscillator and power the board with 3V..."

                That would make the most sense in my world :)

                G Offline
                G Offline
                gloob
                wrote on last edited by
                #8

                @tbowmo
                You are right. I did modify my post.

                1 Reply Last reply
                0
                • siodS Offline
                  siodS Offline
                  siod
                  wrote on last edited by
                  #9

                  Ah Ok, so I misunderstood BartE´s post.

                  So what should I do now with my bunch of 16MHz Osc´s? Maybe useful for some other project in the future...

                  still learning...

                  1 Reply Last reply
                  0
                  • H Offline
                    H Offline
                    HarryDutch
                    wrote on last edited by
                    #10

                    Have a look here:
                    http://www.gammon.com.au/breadboard

                    This is the easyiest way to bootload you Atmega328p with 8Mhz. Works like a charm.

                    dakkyD 1 Reply Last reply
                    1
                    • H HarryDutch

                      Have a look here:
                      http://www.gammon.com.au/breadboard

                      This is the easyiest way to bootload you Atmega328p with 8Mhz. Works like a charm.

                      dakkyD Offline
                      dakkyD Offline
                      dakky
                      wrote on last edited by
                      #11

                      @HarryDutch Hu awesome link. Thanks!

                      Controller: Raspberry Pi 2 :: Openhab2 :: with @TimO MySensors Binding
                      Gateway: Arduino MEGA 2560 R3 :: W5100 :: Ethernet GW

                      Software: MySensors 2.0development

                      1 Reply Last reply
                      0
                      • E Offline
                        E Offline
                        eeichinger
                        wrote on last edited by
                        #12

                        a bit late but a word of warning for anyone embarking on this idea: the internal 8MHz clock is very inaccurate (%10 according to the datasheet), which likely will break asynchronous protocols like UART. As long as you are using only synchronous protocols like I2C you should be fine. More details can be found in this excellent thread on stackexchange https://electronics.stackexchange.com/a/32433/216828

                        1 Reply Last reply
                        0
                        • siodS siod

                          Hi BartE,

                          I´ve read the internal clock at 8 MHz is not as good as an external 8MHz clock because the accuracy of the internal oscillator seems to be only 10% (Atmel Datasheet page 323). What are your experiences? Would you recommend using internal or external OScillator?

                          Also I am wondering why most people are running their custom PCB´s using 8MHz clocks instead of 16MHz. Is it only because of reducing the energy consumption? I think so.

                          I originally planned to use 16MHz clocks, but now, from the energy consumption point of view, I will probably switch to the 8MHz variant...

                          E Offline
                          E Offline
                          eeichinger
                          wrote on last edited by
                          #13

                          @siod yes, mostly because of power consumption. You can run an ATmega328P on a 3V battery, but then you need to use 8MHz instead of 16MHz according to the datasheet.
                          As I replied separately, you don't want to use an inaccurate clock for async protocols like UART that require precise timing.

                          bjacobseB 1 Reply Last reply
                          0
                          • E eeichinger

                            @siod yes, mostly because of power consumption. You can run an ATmega328P on a 3V battery, but then you need to use 8MHz instead of 16MHz according to the datasheet.
                            As I replied separately, you don't want to use an inaccurate clock for async protocols like UART that require precise timing.

                            bjacobseB Offline
                            bjacobseB Offline
                            bjacobse
                            wrote on last edited by
                            #14

                            @eeichinger
                            Yes an old thread, but still useful.
                            well if you plan to run on a low voltage, you must disable BOD, else per default the 328 will switch off at 2,7V. And then you need to run 1 at MHz

                            1 Reply Last reply
                            0
                            Reply
                            • Reply as topic
                            Log in to reply
                            • Oldest to Newest
                            • Newest to Oldest
                            • Most Votes


                            21

                            Online

                            11.7k

                            Users

                            11.2k

                            Topics

                            113.0k

                            Posts


                            Copyright 2019 TBD   |   Forum Guidelines   |   Privacy Policy   |   Terms of Service
                            • Login

                            • Don't have an account? Register

                            • Login or register to search.
                            • First post
                              Last post
                            0
                            • MySensors
                            • OpenHardware.io
                            • Categories
                            • Recent
                            • Tags
                            • Popular