Pages: [1] 2   Go Down
Author Topic: Arduino Atmega Standalone - need for Capacitors & Crystal?  (Read 4823 times)
0 Members and 1 Guest are viewing this topic.
Offline Offline
Newbie
*
Karma: 0
Posts: 17
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Hi

I have read several tutorials showing how to run an Arduino Uno Atmega chip as standalone
after programming it on the Arduino board. My query is-
Why do we need capacitors & 16MHz Crystal?

If I have grasped it correctly, the capacitors on the power-pins are required to remove
the DC ripple effect.

About the 16 MHz Crystal, I think Arduino Uno has 16MHz external clock & this Crystal
does that function on the standalone. However,  the Atmega328 chip has an internal clock.
Can I not use it, without the Crystal, on the standalone board?

Project intention: 3x & 4x LED Cube
Source: http://www.instructables.com/id/Standalone-Arduino-ATMega-chip-on-breadboard/
Logged

Massachusetts, USA
Offline Offline
Tesla Member
***
Karma: 202
Posts: 8711
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

You can eliminate the crystal and associated load capacitors if you change the fuses to select the internal 8 MHz RC oscillator.  You can do this by selecting one of the 8 MHz boards (like "LilyPad Arduino w/ ATmega328") and burning a fresh bootloader.  You will need an ISP to burn the bootloader.
Logged

Send Bitcoin tips to: 1L3CTDoTgrXNA5WyF77uWqt4gUdye9mezN
Send Litecoin tips to : LVtpaq6JgJAZwvnVq3ftVeHafWkcpmuR1e

0
Offline Offline
Jr. Member
**
Karma: 0
Posts: 78
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

The internal clock is limited to half the speed that is usually present on Arduino and is subject to inaccuracies if you have not calibrated it. But yes, it can be used (with a bootloader adapted for it), but timing-dependent stuff like serial communications might be unreliable.
Similarly, the power supply filter capacitor is not necessary per se, but it is very useful and improves reliability.
Logged

Offline Offline
Sr. Member
****
Karma: 1
Posts: 252
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

You don't need a crystal and caps. You have to change the Atmega's fuses (by an ICSP programmer) to use the internal oscillator @ 8MHz.

*edit* someone beat me to it!
Logged

Offline Offline
Newbie
*
Karma: 0
Posts: 17
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Thanks John, Fat D & Rob for replying. So the internal clock would require a new bootloader.
That doesn't help if one wishes to program the chip on-board & just place it on a PCB.

A new bootloader & a fuse select is needed for the internal clock to work.
Got it. So, primarily, the chip is dependant on the clock frequency that its corresponding
bootloader was burnt on.

Logged

Salem, Oregon
Offline Offline
Sr. Member
****
Karma: 7
Posts: 307
Friends don't let friends use Strings
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

You can eliminate the crystal and associated load capacitors if you change the fuses to select the internal 8 MHz RC oscillator.  You can do this by selecting one of the 8 MHz boards (like "LilyPad Arduino w/ ATmega328") and burning a fresh bootloader. 

Unfortunately you'll need to modify the boards.txt file and change the fuse settings if you're using an ATmega328.  The current 328 Lilypad entry expects an external 8MHz crystal.

Currently only the "LilyPad Arduino w/ ATmega168" will work "out of the box" with the internal oscillator.

Brad (KF7FER)
Logged

Lancashire, UK
Offline Offline
Edison Member
*
Karma: 9
Posts: 1991
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

An option which allows the arduino to work like an arduino without changing the fuses and is simpler than a crystal and capacitors is to use a 16Mhz ceramic oscillator (like the Uno).  1 component rather than 3 and no workarounds to get it working at half speed on the internal oscillator.
Logged


Cumming, GA
Offline Offline
Edison Member
*
Karma: 20
Posts: 1643
Ultimate DIY: Arduino
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

Just buy the resonator and skip the internal oscillator option.
Logged

Toronto, Canada
Offline Offline
Edison Member
*
Karma: 2
Posts: 1234
"Keep it R.E.I.L. - "Research, Experiment, Investigate and Learn"
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Quote
Just buy the resonator and skip the internal oscillator option

Now, that is a good idea.  ... I should try that...

Most in my breadboard project, I only use a 16 MHz crystal, no 22 pF cap. But on a PCB version, I do have a crystal - 16 MHz and the 2 cap of 22 pF. For a reliability operation of my project... it is a must.

I just don't understand why you don't want to use it in your project....( I don't know your situation... ) 
Logged

Offline Offline
Sr. Member
****
Karma: 1
Posts: 252
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

FYI in the future... This page will help you setup a chip for use with out the need for external mumbo jumbo.

http://arduino.cc/en/Tutorial/ArduinoToBreadboard
Logged

Offline Offline
Newbie
*
Karma: 0
Posts: 17
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Thank you all for replying smiley

Quote
I just don't understand why you don't want to use it in your project....( I don't know your situation... )  

@Techone Nothing like that. I was just curious to know what was the need & what prevents the internal clock from being used as is. Beginners knowledge sake smiley
Logged

Western New York, USA
Offline Offline
Faraday Member
**
Karma: 32
Posts: 4259
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

FYI in the future... This page will help you setup a chip for use with out the need for external mumbo jumbo.

http://arduino.cc/en/Tutorial/ArduinoToBreadboard

Unfortunately this tutorial does not set a very good example.  Two things that come to mind are the lack of decoupling capacitors at the IC power pins and the long wires between the crystal and the IC.

Don
Logged

Offline Offline
Sr. Member
****
Karma: 1
Posts: 252
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

All true... But it does have a readily available Board.Txt file with all the fuses and settings for running at 8MHz without a crystal making the bootloading and fuses easy as pie....
























mmmmm... pie.
Logged

0
Offline Offline
Shannon Member
****
Karma: 200
Posts: 11718
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Hi


If I have grasped it correctly, the capacitors on the power-pins are required to remove
the DC ripple effect.


No, the power supply capacitors are for decoupling - for logic circuits they prevent the high-speed(*) switching transients from all the 10,000's of transistors adding up on the supply rail and causing circuit misbehaviour - incorrect logic switching.  Since the Arduino chip has analog inputs as well the decoupling also is very important in reducing analog noise.  With high speed decoupling its important the capacitors are right next to the chips connected via a low impedance (low inductance) path - that means short fat wires/PCB-traces.
Often voltage regulators require a certain amount of capacitance on the output rail to be able to live up to their specifications.  Typically you want 0.1uF ceramic caps next to each chip and 10uF to 100uF somewhere on the board for lower-frequency decoupling.

Inadequate decoupling shows up as unreliable behaviour, pattern sensitive and difficult to trace with a logic analyser or 'scope since monitoring the signals changes the high-speed transients that are causing the problem.  It will drive you crazy trying to work out what's happening, so never skimp on decoupling.

Incidentally DC ripple should be handled by the voltage regulator circuit/chip.

(*) modern CMOS devices switch output pins in 1 to 10 nanoseconds, but internally some might be switching in 10's to 100's of picoseconds (and have local decoupling capacitors built onto the surface of the chip!). 
Logged

[ I won't respond to messages, use the forum please ]

Offline Offline
Newbie
*
Karma: 0
Posts: 17
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

@MarkT Wow. That was heavy smiley I will have to read it several times more & cross-reference it with the help of Google Uncle before I fully understand it. Thanks all the same for willing to share your knowledge.
Logged

Pages: [1] 2   Go Up
Jump to: