A few days ago I posted some intructions on how to use a standalone Atmega328 (or Atmega168) on a breadboard. This approach offer a good cost reduction for Arduino-based hobby projects by reusing the USB-to-TTL circuit between the projects. The cost saving can be close to $20, but there is a small tradeoff in convenience. Instead of the customary "plug in the USB cable and click 'Upload' ", we will need to hook-up a few wires; nothing too bad, though. Let's look at two different approaches: using FTDI adapter and an existing Arduino board.
There is no inherent benefit to either. If you already have an Arduino board with a removable chip (Arduino UNO, Duemilanove etc.), it makes sense to use it. Otherwise, $17 + shipping from Sparkfun ins't a bad deal.
Unless you already own a USB to serial adapter, I'd encourage you to stick with Sparkfun's FTDI cable or FTDI Basic board (either one works fine, so this is just a matter of preference). First of all, they are designed for Arduino Pro header pinout, so programming those (if you decide to get one in future) is as simple as plug-and-go. Additionally, they have auto-reset capability via DTR cable (most cheap USB-to-Serial adapters I've seen don't have this capability)
Using Arduino as USB-to-TTL Adapter
|Arduino uno used to upload code|
To start with, you need to remove the Atmega chip from Arduino's socket and create the basic Arduino circuit, as described in the last post. The proper way to do so it to use an IC puller, but with care you can do as good of a job with a flat screwdriver or tweezers. The key is to pull the chip straight out, without beding the leads. Once the chip is out of the socket, try to stabilize the board on or near your breadboard (I use a small piece of "gray" 3M double-sided tape to attach it to the breadboard). This prevents the board from flopping around (and releasing the magic smoke as a result of an accidental short).
There are four or five connections you will need to make:
- Arduino Pin 0 (Rx) to IC pin #2
- Arduino Pint 1 (Tx) to IC pin #3
- Arduino Reset to IC pin #1
- Arduino Ground to breadboards ground rail
- Arduino 5V (Vcc) to breadboard Vcc rail (if you want to power the breadboard from the Arduino board)
Using FTDI Adapter
|FTDI Basic (from Sparkfun) connected to Atmega328|
- FTDI Tx to IC pin #2 (Tx to Rx)
- FTDI Rx to IC pin #3 (Rx to Tx)
- FTDI DTR to IC pin 1 (via .1 uF cap)
- FTDI Gnd to breadboard ground rail
- FTDI 5V to breadboard Vcc rail (if you choose to temporary power the board)
The upload procedure is the same as with Arduino. The only caveat I'd add he is that shorting out 5V on the FTDI board can fry your USB port (most computers allegedly have protection, thoug)