Some newb questions about getting started

I'm looking into learning about DIY electronics after enviously reading Makezine and wishing I could do all that cool stuff, but I've got some questions:

  1. I guess I'm still not too clear about the Arduino itself. Can you use it to program a chip and have it run on another board? Or does the bootloader only work on the Arduino board? I saw this and noticed that he used an Arduino board too, but he said he had to flash the chip, so I'm a bit confused.

  2. Can anyone suggest a good starting point just for DIY electronics? I've been reading this and understand the first volume, but I don't really see how this will in the end help me be able to make some nifty circuits

Sorry for my naive questions, any insight would be helpful. Thanks!

Those are good questions!

You have a few options if you want to use the chip from Arduino in other circuits (e.g. on a breadboard or in a PCB you design yourself). You can use the Arduino board as a programmer to burn a bootloader onto another chip (though this may be a bit tricky). You can buy chips that are burned with the Arduino bootloader. Or you can buy a cheap programmer (like the USBtinyISP: USBtinyISP AVR Programmer Kit (USB SpokePOV Dongle) [v2.0] : ID 46 : $22.00 : Adafruit Industries, Unique & fun DIY electronics and kits) and use it to burn the bootloader or just load sketches directly on the board (at the moment, support for the USBtinyISP isn't integrated into the Arduino software, but you could write your code in the Arduino environment and use the software for USBtinyISP to upload it).

So basically, I could either use the bootloader and program the chip with the Arduino environment, or use the Parallel Programmer to burn a compiled program onto the chip, and not use the bootloader?

Yes, basically.

The one caveat is that I haven't used a parallel programmer with the ATmega168. It works with the ATmega8, but the ATmega168 adds a few extras (like the extended fuse byte) that I'm not sure work with the parallel programmer. More specifically, I've only used a parallel programmer with uisp (a program for uploading programs to a microcontroller, used by Arduino 0008 and earlier), never with avrdude (a similar program that we use in Arduino 0009). uisp doesn't fully support the extended fuses (and only works with the ATmega168 at all if you patch it). avrdude can handle the extended fuses but I don't know how it handles parallel programmers. I think it should work, but I'm not sure.

i may be dumber than a hammer (or bag thereof)... but, i have a board and ordered two additional 128 chips... i figured that i could use the arduino as a programmer for chips and move to a breadboard... is this even possible?... i have no clue how to use any "programmer", and was hoping to avoid the cost of needing one... unfortunately, the hours i've spent reading up on the arduino have yet to establish a sound understanding of the need for the bootloader, or how to move prototyped projects from the board to a more permanent home... i've read about the need for a 16mhz clock, but don't understand that, really... have i jumped too far ahead of myself?...

i purchased the arduino because it uses a c-based language as compared to the basic stamp, and the atmega168 chips are only a couple of bucks...

please help, i need to make a robot to annoy my wife's cat :)..


Looks like you are getting a bit ahead of yourself.

The Arduino environment only works on ATmega8 and ATmega168 chips officially.
People are trying to port it to the ATmega32 and ATmega128 though.

If you do get extra chips, you will need to burn the bootloader on to them yourself.
The simplest is a parallel port plug with a few resistors. The most complex is a few hundred dollars.

As to moving them to a permanent home, you will need a clock (little thing which tells the chip how fast to go), a stable voltage supply (batteries cant provide stable power) and a few other little things.
Look at the Arduino schematic for details. You can ignore the serial stuff for your permanent projects.
Its not particulary difficult, you just need to know how to do it.

a stable voltage supply (batteries cant provide stable power)

Should that perhaps be "batteries can't provide stable power by themselves"? Just thought the rewording might clarify that slightly...


fortunately, i'm able to build a stable 5V supply, and have built quite a few circuits, but none with any microcontroller (though a few common ICs)... i mistakenly typed ATMega128 - it should read ATMega168, which is the same chip that came with the decimilia board i just received...

i guess i need to better understand the role of the bootloader, then i can move to actually burning it... i've also seen a tutorial that claims to program chips without requiring a bootloader... apparently, this offers an extra 4 bytes of addressable memory?

most of the tutorials i've found are great when describing how to do something, but my hope is to understand better the why part...

thanks, again..

idover -

I'm afraid that if you buy the chips from the store you'll quickly find yourself in a chicken/egg dilemma. You need the boot loader to burn sketches to the chip. You need a programmer to burn the boot loader to the chip FIRST. Without a boot loader or programmer... you have a very light paperweight.

AVR tutorial:

Limor (Ladyada) is "apparently" working on converting the Arduino into an ISP: Arduino Hacks

At the risk of confusing things more --

Buy a pre-wired board or kit. It works out of the box, and gives you a nice place to do the "hello world" and other familiarization with the Arduino environment.

Then pick-up a couple ATmega168's from someone like Adafruit; ones that already have the bootloader burned into them. Those you can socket right on that first Arduino to upload a sketch to, then stick on a breadboard to draft up your new project. There's a thread or two around here about the components for a "minimum" board (power regulator, oscillator, et al).

(I'm right in middle of that myself.)


You may not need to make up your own Arduino clone from scratch. Between the basic Arduino/Freedino with prototype shield, the bare bones and boArduinos, there is likely to be an existing PCB that will work well for you.

i guess i need to better understand the role of the bootloader, then i can move to actually burning it... i've also seen a tutorial that claims to program chips without requiring a bootloader... apparently, this offers an extra 4 bytes of addressable memory?

The bootloader just allows programs to be loaded on to the chip using the serial pins.
Makes it simpler because (with the Arduino at least) the serial pins are connected to USB so you just plug it in and you can program instantly.
Without the bootloader you need to program it using a programmer.

The bootloader only uses 1K of the 16K available but if your making a particularly big program then it can become a pain.
You have to be doing something rather complex to run out of space though.

thanks all for the answers... any suggestions about the first "real" project to build?... after understanding more the hardware, i'm thinking of an indoor/outdoor weather station... another is a simple alarm... my home is wired for adt, but i have no monitoring... can i use the already installed sensors?..

thanks, again..

Well atm I'm rigging up 5 LCDs, temperature, humidity, pressure and my computer together.
Should be fun. Lots of live stats to display. ;D
(Just FYI - All 5 LCDs will only be using 3 I/O)

awesome... are you using serial enabled lcds?...

Thats the cool thing. I'm not using serial LCDs. :wink:

i'm rather green at all of this, but everything i've read has me worried about tying up pins just to drive leds, etc... so i thought that the serial lcd was the only way to handle this... how are you doing it otherwise?... i've read about led/lcd drivers, but am not very familiar...

I'm using a 74HC595 chip which takes up 3 output pins and provides 8.
Then my LCDs are rigged up in 4 bit mode so they only need 7 outputs.
The last output is controlling the backlight.

The other LCDs are being shipped at the moment.
When I get them I'll rig up another 595 chip (they are daisy chain-able) to control the extra 'Enable' pins.
Then just by selecting the correct Enable pin and tying all the data pins together, i can control which LCD receives the signals.

The code controlling everything is pretty neat.
There is a copy posted on these forums somewhere.
The playground's LCD page has a link.