So you just finished soldering up your Sanguinololu 1.3A board and are ready to test it to see if everything is working properly, but before you can upload any firm ware to the board you need to burn a Bootloader to the ATmega 644P. In this tutorial I will cover using an Arduino or Arduino clone as your ISP programmer. … Class starts after the jump.

Before we get started with the tutorial make sure you have the following tools and discrete components on hand and ready to use.

What is a Bootloader?

In short a Bootloader is a small piece of code that is stored in the microcontroller’s program memory and allows the user to program and reprogram the microcontroller without using an In System Programmer (ISP). We won’t get into the full details of what a Bootloader does in this tutorial, but if you would like to know more check out this article on Emcelettronica.com

What is an ISP?

ISP is short for “In System Programmer”, a device that allows you to program a microcontroller without using a Bootloader. It can be used to burn Bootloaders, and program microcontrollers where a USB interface is not present. In our case we will be using an Arduino with an ATmega 328 to burn the Sanguino Bootloader to our ATmega 644p.

Setting up the Arduino

Before we can burn the Sanguino Bootloader we need to program to Arduino to act as an ISP. Follow the steps below and we can move on to breadboarding the ATmega 644P.

The first thing you need to do is connect your Arduino to the PC with a USB cable.

Next, In the Arduino IDE go to File/Examples/ArduinoISP . This will load the Arduino as ISP sketch into Arduino. Fig. 1

. This will load the Arduino as ISP sketch into Arduino. Fig. 1 Make sure you have the correct board selected in Tools/Board/Your Arduino Board . Fig.2

. Fig.2 Once that sketch is open click the “play” arrow to compile and upload the sketch to the Arduino. Fig. 3

Fig.1 Fig. 2 Fig. 3

Click Images for High Resolution Versions.

The Schematic

Click for high resolution version.

Connections

Arduino Pin D13 to ATmega 644p Pin 8 SCK Arduino Pin D12 to ATmega 644p Pin 7 MISO Arduino Pin D11 to ATmega 644p Pin 6 MOSI Arduino Pin D10 to ATmega 644p Pin 9 Reset Arduino Pin D9 to ATmega 644p LED1 Anode Arduino Pin D8 to LED2 Anode Arduino Pin D7 to LED3 Anode LED1, LED2, and LED3 Cathodes to R1 R1 to Arduino GND Arduino Pin Reset to C1 C1 to Gnd Arduino Pin 5v to ATmega 644p Pin 30 VCC Arduino Pin Gnd to Breadboard GND ATmega 644p Pin 30 VCC to ATmega 644p Pin 32 VCC ATmega 644p Pin 32 VCC to ATmega 644p Pin 10 VCC ATmega 644p Pin 31 to Breadboard Gnd Resonator Middle Pin to ATmega 644p Pin 11 Resonator Middle Pin to Breadboard Gnd Resonator Left Leg * to ATmega 644p Pin 12 Resonator Right Leg* to ATmega 644p Pin 13

* Resonator is not polarized so either outside leg can be used.

Installing Sanguino to Arduino 22

Now that you have the circuit Breadboarded with your Arduino and ATmega 644p double check every connection. We have done this many times and still manage to misplace a jumper wire every time.

If you have not yet downloaded the Sanguino software from then do so now.

Extract the contents of the Sanguino Zip file

Copy the contents of the extracted folder to arduino-0022/hardware/ You should end up with a folder hierarchy that looks like this arduino-0018/hardware/sanguino/ Fig.4

Fig. 4

Burning the Bootloader

Now that you have installed Sanguino files to the Arduino IDE and connected the ATmega 644p (double check again) we can finally burn the Sanguino Bootloader to the chip.

In the Arduino IDE go to Tools/Board/ and select Sanguino. Fig.5

and select Sanguino. Fig.5 Then make sure the correct COM port is selected by going to Tools/Serial Port and select the one that your Arduino is connected to Fig. 6

and select the one that your Arduino is connected to Fig. 6 Before we go any farther check every connection again and make sure everything is connected exactly the way shown in the schematic above. If you are confident in your connections then you are ready to burn the bootloader.

Go to Tools/Burn Bootloader and click w/ Arduino as ISP Fig.7

and click Fig.7 You will see the TX and RX LEDs flash on your Arduino for about 1-2 minutes. DO NOT UNPLUG THE USB CABLE or touch any part of the circuit at this time. Doing so may damage the ATmega 644P or Arduino beyond repair.

When the flashing is has stopped for more than 30 seconds you may unplug the USB cable from the Arduino and carefully remove the ATmega 644P from the breadboard. (Remember to wear an anti static wrist strap when handling bare ICs.)