#22
Busy As A
by Joe Pardue
BeAVR
Follow along with this
series! Joe’s book & kits
are available at
www.nutsvolts.com
Recap
Last month, we finished busting up the Arduino and
began reassembling the resulting ruins as the
BreadboArduino. We learned to use it with the regular
free Atmel tools AVRStudio/WinAVR and a helper tool
that I provided: AVRUP to ease the use of AVRDude. Now
we can move on to more capable software and hardware
(okay, IMHO) without forever trying to explain the word
Arduino. Keep in mind that I love the Arduino for
beginners, and wrote the book, An Arduino Workshop that
along with the Arduino Projects Kit (both available from
Nuts & Volts) are, in my totally unbiased opinion, the
absolute all-time best possible starting point for beginners.
But enough of my public display of humility. This month, I
introduce the BeAVR (Breadboard enabled AVR). The
hardware version shown in Figure 1 looks suspiciously like
the BreadboArduino on steroids. That’s because the
BreadboArduino uses the 28-pin ATmega328 and the
BeAVR uses the 40-pin ATmega644. That’s twice the
memory and 12 more I/O pins! You can’t be too rich, too
thin, have too much memory, or too many I/O pins. And,
yes, we are going to be as busy as a BeAVR.
So Why a BeAVR?
BeAVR is an open source design concept for AVR
hardware and software. The hardware schematics can be
implemented on a breadboard (as we will see first) or on a
PCB which we will introduce next month. We’ve seen
most of the software in earlier workshops; the main
addition will be to use a bootloader for the ATmega644.
So, what’s a bootloader?
Baron Munchhausen and the Bootloader
In the early part of the 18th century, the exact date is
unknown; Baron Munchhausen saved himself from
drowning in a shipwreck by pulling himself out of the sea
by his own bootstraps. A particularly miraculous feat since
(as you may have noticed from his bust shown in Figure 2)
he had no arms. In homage to this great man, computer
folks have used the term ‘bootstrapping’ to mean the
emergence of a complex system by starting with simple
components and progressively developing greater complexity
on top of them. In our case, a bootstrapper (a.k.a., bootloader)
70 May 2010
■ FIGURE 1. BeAVR prototype.
■ FIGURE 2. Baron
Munchhausen.
is a small simple
program that can be
used to load and run a
large complex program.
I like to brag about
how many years ago, I
wrote an 81 byte
machine code bootstrap
program for the 8051
that I input by hand (my
hand, to be exact) using
DIP switches into an
SRAM chip powered by
a lantern battery. Note
that SRAM is volatile
memory and forgets everything the moment power is
removed. This tiny program allowed me to download a
hex file to the 8051 from an original IBM PC over an RS-
232 connection. I learned a lot — mainly how difficult it
was to input a lousy 81 bytes using DIP switches — and I
tended to do things the hard way for some (yet to be
explained) reason. I also invented several new words when
I knocked the alligator clips off the battery in the midst of
one of my test runs causing the SRAM to immediately
forget everything I’d told it. After finding where I had thrown
all the pieces, I joined the rest of the world and started
using non-volatile memory in the form of an EPROM
(Erasable Programmable Read Only Memory) which has
memory that will remember what you told it if the power
has been removed. The EPROMs I used were kind-of cool
because the IC had a transparent window in the top showing