# Is it compulsory to use ext oscillator in designing arduino circuit?

I am designing a circuit for arduino. I will be using Atmega328p, and will connect few male header for pin access and 6 male headers for programming (MOSI,MISO,SCK,RST,Vcc,GND). So is it compulsory to use ext oscillator. I know MCU can also work using int oscillator but not sure that while programming it through USBasp it will work or not. I heard somewhere that while programming it using USBasp ext osciallator is required. So ext oscillator is required or not.?

• what problem you are getting in connecting ext oscillator to your circuit? – Aircraft Oct 7 '15 at 6:01

The default clock source for the atmega328p is the internal RC oscillator @ 8MHz with the CKDIV8 fuse programmed. See page 28 here.

You can absolutely program the part using the internal RC oscillator. After all the part ships with this default configuration. Assuming that you want to program the part using the arduino IDE and have everything behave as expected you will need to change some settings in you arduino boards.txt file so that the internal clock source is selected (as you know the arduino boards that use the atmega328 ship with an external oscillator and the boards.txt file by default instructs the part to use the external oscillator) and then burn the boot loader. In boards.txt you'll have to modify the fuses to select the proper clock source. One easy solution is to modify the uno board settings since that board uses the same chip. Copy/paste all the uno settings so that you have a new board (call it yourUno or something) entry in the file. The Uno board has the following settings:

uno.bootloader.low_fuses=0xff
uno.build.f_cpu=16000000L


You'll want to modify that to:

yourUno.bootloader.low_fuses=0xe2

• Note that the fuse settings are only used when Burn Bootloader is selected in the Arduino IDE. If you intend to never use this option then there is no need to change that part of the configuration. Also note that the default bootloader for the Uno assumes a 16MHz clock; you will need to modify and rebuild it if you want it to operate at 8MHz. – Ignacio Vazquez-Abrams Oct 7 '15 at 6:14
• yes I need to upload the bootloader first. So you mean to say while uploading bootloader, I need to change uno.build.f_cpu=16000000L to Uno.build.f_cpu=8000000L and then I can design my circuit without oscilator. and during programming i'll choose the internal oscillator. Am I right.? – user46573544 Oct 7 '15 at 6:19