Advantages to external clock?

I was thinking of setting up my next project in the 'minimal' configuration described here:

"If you don't have the extra 16 MHz crystal and 18-22 picofarad capacitors used in the above examples, you can configure the ATmega328 to use its internal 8 MHz RC oscillator as a clock source instead."

But, I'm uninformed enough to not really understand what the implications of using the internal oscillator is, compared to the external crystal. Can someone help me understand this?

Thanks!
Matt

At 8MHz the processor is running at "half" speed. The processor uses less current at 8MHz than 16 MHz. One can run the processor at a lower voltage, as well (3.3V for instance). If using the internal oscillator, there are fewer parts, no need for a crystal and loading caps.

I have several projects with Atmega 328s using their internal 8MHz clock and none using an external clock.

Using an external crystal oscillator will probably give more precise timing.

And, obviously, a 16MHz Arduino can do things more quickly.

...R

The 16MHz crystal is more accurate but not accurate enough to use as a real-time clock. So for 99.9% of Arduino projects the extra accuracy is useless.

Awesome, thanks everyone!

Follow up Q: if I set up my project as described in the article, using my Arduino to program an ATMega328p using an internal clock and set to 8 Mhz in the Tools -> Board menu, is there anything else I need to do to get the project to run at 8 Mhz/using the internal clock?

Assuming you have the bootloader uploaded correctly then when you want to compile and upload a program you need to select the correct board with the 8MHz clock.

For my Atmega 328s I use Nick Gammon's program to upload the lilypad bootloader and then I select the LilyPad Arduino as the board for compiling and uploading.

...R

elveax:
Q: if I set up my project as described in the article, using my Arduino to program an ATMega328p using an internal clock and set to 8 Mhz in the Tools -> Board menu, is there anything else I need to do to get the project to run at 8 Mhz/using the internal clock?

If the ATmega328P you are using has been programmed with an Arduino bootloader it will need a crystal to generate the system clock necessary for serial programming to work.

There are two ways to provide a system clock:

1: If you can find a crystal between 8 and 20 MHz you can connect it between pins 9 and 10 of the target chip. You can probably get away without the load capacitors.

2: If you can't find a spare crystal or you try the crystal and still get the "Device signature = 0x000000" error you should get this modified ArduinoISP sketch from adafruit: GitHub - adafruit/ArduinoISP: A fork of the ArduinoISP that has 8mhz output clock Upload this version of ArduinoISP to your ISP Arduino. Connect Pin 9 of the ISP Arduino to pin 9 of the ATmega168/328P on the breadboard. That will provide an 8 MHz clock to allow programming without a crystal.

If you try both methods and it still fails with "Device signature = 0x000000" you might have a chip with configuration fuses set to disable serial programming. To fix the fuses you will need something like the HV Rescue Shield 2 from MightyOhm (HV Rescue Shield 2 | MightyOhm). That uses High Voltage Serial Programming to reset your ATmega/ATtiny configuration fuses to factory defaults. If that doesn't work your ATmega/ATtiny is probably damaged beyond use.

johnwasser:
If the ATmega328P you are using has been programmed with an Arduino bootloader it will need a crystal to generate the system clock necessary for serial programming to work.

Nick Gammon's program for loading the bootloader can provide a clock if needed - and without a requirement for a crystal

...R