■ FIGURE 8. ArduinoISP Fritzing PCB view.
Arduino Extra kit with three additional PCBs. This allows
you to spawn three PCBs (as in Figure 7) while still having
your breadboard proto shield to do future development.
Also note that while a single ATmega328P is listed in the
BOM, you'll want to get as many ATmega328Ps as you
think you'll need for your future Fritzingduino projects.
DESIGN YOUR OWN ARDUINOISP
PCB WITH FRITZING
It is simple enough to generate the PCB files for
the ArduinoISP design in Fritzing (shown in Figure 8). I
decided not to get a board fabricated for this design since
it is simple enough to wire this up on a proto shield PCB
as shown back in Figure 7. Plus, I only need one of them.
USING THE ARDUINOISP
Using the ArduinoISP is a little tricky because we have
to keep in mind that we are using the Arduino IDE to
upload two separate programs. First, we’ll upload the
ArduinoISP code to the Arduino, then we’ll use the
Arduino with the ArduinoISP application in it to upload
the bootloader to the raw ATmega328 using the ISP wires
in our hardware design. Let me repeat. First, upload the
ArduinoISP application from the PC to the Arduino.
Then, use that application to upload the bootloader from
the Arduino to the ATmega328 on the shield. Two steps —
Uploading the ArduinoISP Example
Recall that Figure 2 shows the Arduino IDE with the
70 June 2013
■ FIGURE 9. FTDI USB to TTL.
File/Examples/ArduinoISP highlighted. Click on that file
and it will appear in the text editor. You load this to the
Arduino like you do any other program. Make sure you've
selected your board, and then click on the Upload
button. Now it gets tricky.
Uploading the Bootloader to the
If you are loading a bootloader to an ATmega328P,
you open the Tools/Boards menu item and select an
appropriate board such as the 'Arduino Duemilanove
with ATmega328.' [Note that you aren't actually using an
Arduino Duemilanove — you are just telling that to the
IDE so that it will use the bootloader for the ATmega328.]
Next — also in the Tools menu — you click on the 'Burn
Bootloader' menu item as shown in Figure 9. It may take
a minute or two for the bootloader to be uploaded. FYI,
the OptiBoot bootloader is the one being uploaded it.
Can it be that simple?
Well, let's hope so. Unfortunately for me, I had a
bunch of ATmega328s NOT ATmega328Ps, and although
the menu items and tutorials for the ArduinoISP say
Atmega328, they really mean Atmega328P. In order to use
the ATmega328 with no P, you've got to work a bit harder.
You must add the ATmega328 to the arduino.conf file
located in ...Arduino-x.x/hardware/tools/avr
/etc/ arduino.conf. You must also add it to the boards.txt
file located at: …arduino-x.x/hardware/Arduino/boards.txt.
Of course, the arduino-x.x is whatever your version of
the Arduino IDE is; in my case, it is arduino-1.01 (at the
moment). You will add the ATmega328 to these two files
by copying blocks of text from a file I've provided and