0% found this document useful (0 votes)
115 views7 pages

Using Internal Oscillator On ATmega328P

The document discusses using the internal 8MHz oscillator on an ATmega328P microcontroller instead of an external oscillator to simplify a circuit board layout. It describes using a USBASP programmer to change the microcontroller's fuses to enable the internal oscillator using an online fuse calculator tool. The tool provides fuse values that are then programmed into the microcontroller using the avrdude command line tool to avoid errors in manually entering the values. After changing the fuses, the internal oscillator can be used and the Arduino IDE can still be used to program the microcontroller by selecting the "Upload using programmer" option.

Uploaded by

Sergiu Badaluta
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
115 views7 pages

Using Internal Oscillator On ATmega328P

The document discusses using the internal 8MHz oscillator on an ATmega328P microcontroller instead of an external oscillator to simplify a circuit board layout. It describes using a USBASP programmer to change the microcontroller's fuses to enable the internal oscillator using an online fuse calculator tool. The tool provides fuse values that are then programmed into the microcontroller using the avrdude command line tool to avoid errors in manually entering the values. After changing the fuses, the internal oscillator can be used and the Arduino IDE can still be used to program the microcontroller by selecting the "Upload using programmer" option.

Uploaded by

Sergiu Badaluta
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 7

waihung.

net

http://waihung.net/using-internal-oscillator-on-atmega328p/

Using Internal Oscillator on ATmega328P


Ive 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.

To do this, youll need a programmer. Im using a cheap USBASP bought from ebay.

1/7

2/7

To enable the internal oscillator, youll need to change the fuses on the ATmega328P. In PIC terms, its 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.

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

3/7

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

4/7

Ignore the last error that says the verification of the efuse has failed. Choose No when its asking whether to change
back the fuse or not.
Now that youve flashed the fuse to use the internal oscillator, you can still use the Arduino IDE to program your
ATmega328P.

5/7

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

6/7

7/7

You might also like