Using Atmega168 stand-alone

Thread Starter

Sonoma_Dog

Joined Jul 24, 2008
99
Hey all,

I will be using Arduino to program my Atmega168. After that, I will be using the chip stand-along.

This is the voltage regulator and crystal oscillator i am going to purchase. Will this work good on the Atmage168? and is it the only two components i need to run the chip stand-alone? I want to do things right the first time. Because the cost shipping is really expensive.

http://www.newark.com/89K1377/semic...s/product.us0?sku=stmicroelectronics-l7805acp

http://www.newark.com/16C8140/passives/product.us0?sku=vishay-dale-xt49s16m

Thanks a lot!!
 

SIcam

Joined Aug 9, 2008
61
http://www.arduino.cc/playground/Learning/Standalone

Crystal or Resonator:


Option 1:
  • 16mhz Ceramic Resonator Jameco# 324662
OR


Option 2:
  • 16mhz Crystal HC49/US Jameco# 325139
  • 20pF Ceramic Disc Capacitors Jameco # 332321 (x2)
If this is being soldered to a perfboard you need a socket for the chip:
  • 28pin DIP IC Socket Jameco# 683171
For the voltage regulator you will need these parts:

  • 7805 Voltage Regulator Jameco# 51263
  • 10uF Electrolytic Capacitor Jameco# 94220
  • 1uF Electrolytic Capacitor Jameco# 94160
According to Sparkfun they recommend using a 100 uF and a 10 uF for decoupling capacitors.

http://www.sparkfun.com/commerce/tutorial_info.php?tutorials_id=57

Because of shipping costs I would recommend getting 1's 10's and 100's.

You might want to look into Jameco as they have batch bargains on LED's caps and other items that Newark does not sell as cheap.

Don't forget to get some DIP switches if you don't have any. The outputs are rated on the arduino for 40 mA and I have been using 2532 optoisolators rated for 150 mA to control larger items.
 
Last edited:

nanovate

Joined May 7, 2007
666
You do not need an external crystal to play with the mega168... it has an internal 8MHz oscillator which you can configure in the Fuse settings.

Minimum parts should include 0.1uF ceramic caps for VCC and AVCC and AREF (all to GND). I usually put a 10K resistor from the RESET pin to VCC also.
 

hgmjr

Joined Jan 28, 2005
9,027
One word of caution if you decide to go with the internal oscillator on your AVR. There is situation that you can get into, though it is very rare, when your design is relying on the AVR's internal oscillator. If you inadvertently alter the clock selection fuse setting from the internal clock source to an external clock source during a programming download session, the AVR will stop working.

Take heart, there is a means of recovery from this unhappy situation as I found out from experience. It requires the AVR to be supplied temprorarily with an external clock source long enough to reset the clock selection fuse back to the internal clock source.

Many an AVR has probably been tossed in the garbage prematurely when it was accidentally put into this condition.

All this said, I am not trying to discourage you from using the AVR in the internal clock mode, I am simply conveying this bit of wisdom gained from experience for you to file away in the event you find yourself in this situation.

Good Luck,
hgmjr
 

nanovate

Joined May 7, 2007
666
One word of caution
Another word of caustion about fuse settings. The DWEN fuse should not be set unless you really do want to use the Debug Wire interface.

I also want to add that if you are using a bootloader then you likely are not going to be changing the fuse settings. If you can make a change to the fuse settings then you will have to use whatever the arduino has set... so if it is configured for an external oscillator then that is what you have to use. Of course if you have a STK500 or Dragon or AVRISP (or some other programmer) then you can change the fuses.
 
Top