Using Internal Oscillator on ATmega328P

Intosc Banner
I’ve been working on a project which involves a very small PCB layout, and I found it very hard to route unless I remove some unnecessary connections.

Therefore, I decided to remove the external oscillator and use the internal 8MHz oscillator.

int_osc_sch

To do this, you’ll need a programmer. I’m using a cheap USBASP bought from ebay.

IMG_2243

IMG_2245

To enable the internal oscillator, you’ll need to change the fuses on the ATmega328P. In PIC terms, it’s called the configuration bits.

Head on to http://www.engbedded.com/fusecalc to help you decide what fuse values to use.

Select ATmega328P and choose Int. Rc Osc. 8MHz (default value). Then proceed to uncheck divide clock by 8 internally.

fuse

It will return three sets of hex numbers for you to change using avrdude. Avrdude is a tool designed for flashing Atmel chips.

fuse2

They are E2 D9 and FF. To avoid typing it wrongly in avrdude, they also generated the arguments for you to paste into the command prompt.

Fire up command prompt and type in the following command.

avrdude -c usbasp -p m328p -U lfuse:w:0xe2:m -U hfuse:w:0xd9:m -U efuse:w:0xff:m

avrdude1

Ignore the last error that says the verification of the efuse has failed. Choose No when it’s asking whether to change back the fuse or not.

Now that you’ve flashed the fuse to use the internal oscillator, you can still use the Arduino IDE to program your ATmega328P.

upload_programmer

Be sure to select “Upload using programmer”. Now your circuit will be much simpler.

IMG_2249

  1. Ming You01-31-2015

    Why don’t you burn the bootloader of “ATmega328 on a breadboard (8MHz internal clock)”?

    • Hello,I had a quick question and do not know who can help me! I was given what looks like a vintage cooking item but I can’t figure out what to do with it nor can I find it anywhere on the web. It is and oblong cast iron unit about 12″ long. It opens and closes (both sides are identical) and it seems to hold food inside. It has 2 marble looking handles on the end almost as to hold it over a fire or hold it on a grill. Does anyone know the name of this item? Thanks so much!

  2. Wai Hung11-05-2013

    You’ll need to go the website and change to ATmega328 under part name and uncheck divide clock by 8 internally.
    You cannot use back the same fuse values for ATmega328.

  3. vick11-05-2013

    Is this same goes to atmega 328 ?

    Thanks !

Leave a Reply to Wai Hung Click here to cancel reply.