stand-alone basis — this is all you need to deploy a project
into the “wild.” When I built my first one, I couldn’t
believe that this was all I needed to get a microcontroller
project up and running. Of course, we need to be able to
program the MCU, so these final few steps will get that
Open Channels of
When I tackled my first breadboard Uno, I
underestimated the challenges involved in being able to
talk to it. It took a fair amount of research, twiddling, and
hair pulling (which unfortunately, I can ill afford!) to get
the right components in place to program my project. I
was using an ATmega328P-PU loaded with the Optiboot
bootloader — the same configuration as the Uno. The
bootloader (refer to the sidebar) allows us to program the
MCU over a serial connection .
The first USB-serial converter I bought was an FTDI
basic breakout board from SparkFun (see Resources.txt). It
was also the last one I bought — not because it was bad,
but because it’s given me all that I’ve needed over the
past few years.
The FTDI board has five pins that need to be
connected in order to get it working.
Pin 1: Reset
Before we start uploading a sketch to the
microcontroller, we need to reset it in order to fire up the
bootloader. The FTDI board sends a “low” signal over the
“DTR” pin before it starts transmission. Therefore, we need
to connect this to the RESET pin on the ATmega328P. The
low pulse “overpowers” the 10K pull-up resistor on the
RESET pin and causes the microcontroller to enter the
One of the problems I encountered was the range of
opinions on whether or not a capacitor is needed on the
reset line. On my first attempt, I couldn’t get the
microcontroller to enter a reset state and accept the
sketch being uploaded. When I added a 0.1 µF capacitor,
the programming worked perfectly. The Atmel design
notes state that they aren’t required, but can filter out
noise. In your build, test it out and see what works best.
Pins 2 and 3: Tx and Rx
As any corporate coach (or marriage counselor, for
that matter) will tell you, communication is a two-way
process. The same applies to the microcontroller — it
needs to receive (RXD) and to transmit (TXD). It makes
sense that the transmission of one party is received by the
other. Therefore, we connect the TXO pin of the FTDI
board to the RXD pin (pin 2) of the microcontroller, and
the RXI pin of the FTDI to the TXD pin (pin 3) of the
These are often connected incorrectly, which is why
SparkFun added an “O” to the Tx pin (to specify output)
and an “I” to the Rx pin (to specify input).
Pin 4: GND
This is straightforward — connect the GND pin from
the FTDI to the GND rail on the breadboard. Regardless
of whether you choose to power the board from the FTDI
board, you still need to connect the GND.
Pin 5: Power
If you want to power your MCU from the FTDI board
(I often do), then connect the 5V pin (or the 3V3 pin,
depending on the model you have) to the +ve power rail.
We’re Finally There
We’re done with the wiring now — we have a fully
functioning (simplified) Arduino on a breadboard (Figure
When I completed this for the first time, I couldn’t
wait to test it out. So, of course, I uploaded the “Hello
World” of microcontrollers: a sketch that blinks an LED.
The great thing about having created a project that is
effectively Arduino compatible was that I could use the
Arduino IDE to upload a sketch. I could take things step
by step rather than jumping off a precipice!
42 March 2015
Bootloaders and Serial
"What the heck is a bootloader?" That was my first question as I
started on my learning curve to programming stand-alone
microcontrollers. In generic terms, a bootloader is a program that
runs when a PC or microcontroller starts up. In the world of
microcontrollers, the function of the bootloader is to transfer a
sketch (over the serial port) onto it.
If no sketch is available to be transferred over the serial port,
then the bootloader transfers execution to the sketch currently
loaded on the microcontroller.
What this means to you and me is that we're able to upload
sketches to a microcontroller without needing a dedicated hardware
programmer — all we need is a way to allow the PC to communicate
serially with the MCU. For that, we'll use a USB-to-serial converter
— the most common being an FTDI cable or board that works great
for programming microcontrollers.
SparkFun's FTDI Breakout Board: