Burning the Arduino Bootloader

An Arduino chip isn't ready to program straight from Atmel's factory (the company that makes the microcontrollers)! In order to get the ATMEGA328 to run any Arduino sketches, the Arduino firmware has to be loaded in a process known as bootloading (akin to loading an operating system such as Windows 7).



There are a few programmers you can buy - we use a USBtinyISP from Adafruit. You can also buy Atmel's official programmer (an AVR ISP) from digikey. If you never want to burn the bootloader yourself you can buy the surface mount ATMEGA328P already bootloaded.



Burning the bootloader is simple. First connect 5 pads on the Paperduino (GND, VCC, MOSI, MISO, SCK and DTR) to the programmer. Once connected, select the correct board type in Arduino IDE (an Arduino Pro Mini 328 at 5V), and then click "burn bootloader." If it works, the bootloader will be uploaded. If needed, additional help can be found here.



Uploading a sketch to the Paperduino

Our Arduino does not have an FTDI chip built on the board. The FTDI essentially bridges the gap between USB and the serial communication of the ATMEGA328 chip. What we need is the simple FTDI chip, which can be found packaged in a USB cable, and purchased from Sparkfun here. In future versions of the Paperduino we'll actually integrate an FTDI chip and make a paper USB connector to plug directly into a USB port on your computer.



Once you have the FTDI cable in hand, the connection is simple. Wire up the GND, VCC, TXD, RXD and DTR to the appropriate spots on the cable (we used our magnet-tipped cables from the Arduino Connection Kit). Once wired, all you have to do is upload a sketch. Uploading the blink example will blink the green surface mount LED.



We uploaded a simple sketch that changes the direction of our magnetic bi-direction LED component from blue to green. Using two digital outputs, the direction is changed easily by making output 6 low, and 7 high. And to reverse, make output 6 high and 7 low. Voila!