Using ATMEGA328P-PU without oscillator

Hi!

did someone of you ever run an ATMEGA328P-PU (From arduino uno r2 in my case) with a configuration without the 16mhz crystal?

My idea was to just connect Vcc and AVcc to +5 and both GND's to GND and let it run on 8mhz. (please tell me if im doing something silly here)
But how do i tell the software to do calculations based on 8mhz?

Thx!

with a configuration without the 16mhz crystal?

Everybody runs the ATMega328 without a 16mhz crystal.

Most people do use a 16MHz crystal. How much are you really saving not using one?

But how do i tell the software to do calculations based on 8mhz?

Most software isn't even aware of the clock speed. Serial transmission and delay() care.

What is it you are trying to do?

Thanks for your quick response!

i want to get rid of the board, basically like in this tutorial: http://arduino.cc/en/Main/Standalone
but without usb, leds, reset button, etc...
and i also would like the 328P to run on his internal oscillator at 8mhz so i dont need the crystal and the two capacitors as well.
But i am afraid that the arduino library wont play along nicely with this, so i would like to "tell" the library to do calculations based on 8mhz instead of 16mhz.

First, the unit of measure for frequency is named after Heinrich Hertz. The abbreviation is Hz, not hz.

Second,it is unlikely that you want to operate at 0.008 Hz. That is what you keep saying that you want to use.

m is the abbreviation for milli. M is the abbreviation for mega.

But i am afraid that the arduino library wont play along nicely with this, so i would like to "tell" the library to do calculations based on 8mhz instead of 16mhz.

Which library? What will the slower Arduino be doing? analogRead and digitalWrite and many other functions don't know about the speed of the chip.

You can create an entry in the boards.txt file for your board, and set the frequency to use, when compiling for your board, in that file.

Various flavors of Arduino hardware run at 8MHz and are in the supplied boards.txt file. Running on the internal 8MHz oscillator is perfectly possible, however, if it's not calibrated closely, it may not be accurate enough to work with serial communications, e.g. the bootloader.

A couple solutions to this:

  1. Program the chip on a target board with an 8MHz crystal or resonator, then change the fuses to operate on the internal oscillator.

  2. Use an ICSP programmer instead of the bootloader, add an appropriate entry to the boards.txt file. This is my preferred solution. Below is my boards.txt entry. Works great, less filling XD

m328pi.name=ATmega328P, internal RC osc 8MHz
m328pi.upload.using=arduino:usbtinyisp
m328pi.upload.protocol=stk500
m328pi.upload.maximum_size=32256
m328pi.upload.speed=57600
m328pi.bootloader.low_fuses=0xe2
m328pi.bootloader.high_fuses=0xd6
m328pi.bootloader.extended_fuses=0x05
m328pi.bootloader.path=optiboot
m328pi.bootloader.file=optiboot_atmega328.hex
m328pi.bootloader.unlock_bits=0x3F
m328pi.bootloader.lock_bits=0x0F
m328pi.build.mcu=atmega328p
m328pi.build.f_cpu=8000000L
m328pi.build.core=arduino

Thank you Jack!

hi piccaso

may i know how you program the chip? would you like to explain how you do that exactly please? i want to get rid of the crystal too, thanks! i m using Arduino UNO and am a mac user.

L

If you want to use the atmega328 without crystal then you must change the fuse settings with an external programmer

So you need also an avr fuse calculator

http://www.engbedded.com/fusecalc

Also there is an application that calculate and after transfer the fuse to the chip, the name of this program it is mkavr calculator

https://www.google.com/search?q=kmkavr&rlz=1C1AFAB_enGR489GR489&oq=kmkavr&aqs=chrome..69i57.3297j0j4&sourceid=chrome&espv=210&es_sm=93&ie=UTF-8#es_sm=93&espv=210&q=mkavrcalculator

Now you can choose from using a bootloader designed to run at 8 MHz without a crystal (the Lilypad loader) or one designed to run at 16 MHz with a crystal or resonator (The Uno loader).

The choice is yours, it depends if you are planning to use a crystal or not. The crystal (or resonator) lets you run at the higher speed of 16 MHz.

Everything you need is a already in Arduino...

Ray

Hi

You can burn the bootloader as this tutorial explains it http://www.instructables.com/id/Atmega-Standalone-Running-without-crystal-oscillat/?lang=es

But, the problem you may have, is the fact of the actual chip has a pre-programmed fuses/bootloader configured to use an external crystal resonator. So I came with this idea:

1- Before to start the burn the bootloader, connect a jumper wire between the physical pin 9 (XTAL1) of your ATMEGA in the Arduino UNO board and the same pin 9 on the ATMEGA in the breadboard. This will feed temporarily to your standalone chip with a clock signal.

2- Burn the bootloader from the Arduino IDE menu.

3- Disconect the temporary jumper wire, and thats it. Now you can upload the sketches as usual with your Arduino UNO as an ISP.

piccaso:
did someone of you ever run an ATMEGA328P-PU (From arduino uno r2 in my case) with a configuration without the 16mhz crystal?

Yes.

I used the instructions on this Arduino to Breadboard tutorial.

...R