Pages: [1]   Go Down
Author Topic: Using the ATMega168 chip externally from Arduino  (Read 471 times)
0 Members and 1 Guest are viewing this topic.
0
Offline Offline
Newbie
*
Karma: 0
Posts: 3
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

I'm new to microcontrollers, and have been using the Arduino for a couple of weeks now. I would like to develop my projects using the Arduino IDE, and board, then remove the programmed chip and place it into a circuit board/breadboard.

I think I've got most of this figured out, but I want to keep my component count low. So how do you run the chip without an external clock? I tried the ATMega datasheet, but I'm afraid I don't know enough about AVR programming to make sense of it. I think I have to set some fuses for this, but I haven't a clue on how to do that.

My projects are mostly LED based, (no motors, solenoids, etc..)

Any advice and sample code would be greatly appreciated!  smiley
Logged

Daniel
Guest
 Bigger Bigger  Smaller Smaller  Reset Reset

HI

go to moderndevice.com and look at Paul Badger's standalone Arduino board... or check the Arduino on a breadboard tutorial by ITP. It sys it all.
NKCelectronics.com also sells standalone boards.

D
Logged

Austin, TX
Offline Offline
Jr. Member
**
Karma: 1
Posts: 94
Shh! I am hunting wabbit. Killlll the wabbit!
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

First, what your asking requires a familiarity with straight AVR development at least to a greater extent than just the Arduino managed environment.

The arduino uses a 16MHz clock--the internal clock on the 168 is limited to 8MHz.  The change is possible but not really straight forward.  

To program the 168 to use its internal clock is simply a matter of changing the fuses.  Look at the documentation for the arduino programing software (AVRDUDE?) and the data sheet on how to do this.

After (or before this) you'll need to modify the Arduino environment and libraries to use the different clock speed from 16MHz.  There have been some messages on the forum on how to do this.

On the other hand if you include a 16Mhz resonator (1 part) you could move your 168 to a breadboard after programming with the regular board.  Personally I would use the resonator rather than introduce the complications of rebuilding the Arduino environment.

If you really want to use a different clock speed you can use the Arduino as a programmer (writeups elsewhere) and learn to use the underlying GCC (or WinAVR) to develop your application.  More flexibility but a greater learning curve.
Logged

0
Offline Offline
Newbie
*
Karma: 0
Posts: 3
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Thanks for your advice! I think I'll try the resonator approach.

Logged

0
Offline Offline
Newbie
*
Karma: 0
Posts: 6
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Quote
I'm new to microcontrollers, and have been using the Arduino for a couple of weeks now. I would like to develop my projects using the Arduino IDE, and board, then remove the programmed chip and place it into a circuit board/breadboard.

I think I've got most of this figured out, but I want to keep my component count low. So how do you run the chip without an external clock? I tried the ATMega datasheet, but I'm afraid I don't know enough about AVR programming to make sense of it. I think I have to set some fuses for this, but I haven't a clue on how to do that.

My projects are mostly LED based, (no motors, solenoids, etc..)

Any advice and sample code would be greatly appreciated!  smiley

When I ordered my Arduino from Modern Device, I ordered it with an extra 168 with the bootloader already installed. I took this chip and put it on a breadboard with a 16mhz xtal and it's working fine. There aren't that many connections to configure to allow it to be programmed like a regular arduino board.

Sparkfun.com has a pretty decent tutorial section that shows how to do most of this work.

http://www.sparkfun.com/commerce/present.php?p=BEE-2-Code
Logged

Pages: [1]   Go Up
Jump to: