Tutorial: Burning the Sanguino Bootloader to the ATmega 644P Using an Arduino as ISP.

Tutorial Type:

Tutorial Difficulty

Parts Required

 

  • Arduino or Arduino Mega with FTDI USB interface. (pre Arduino UNO boards) Also any Arduino clone with an FTDI chip will work.
  • 16Mhz resonator
  • 0.1uf ceramic capacitor
  • 3x 5mm LEDs
  • 1x  1k resistor

 

 

 

Tools Required

 

  • USB Cable
  • Solderless Bread Board with at least 50 positions  on each side
  • 25 Jumper wires

 

Software needed

Burning the Arduino Bootloader Using Arduino as ISP ATmega 644p

DIY Electronics Tutorial on TheMakersWorkbench.com

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.

Burning the Sanguino Bootloader using Arduino as ISP ATmega644P

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
  • Make sure you have the correct board selected in Tools/Board/Your Arduino Board. Fig.2
  • Once that sketch is open click the “play” arrow to compile and upload the sketch to the Arduino. Fig. 3

Burning Sanguino Bootloader with Arduino as ISP

Fig.1

Burning the Sanguino Bootloader with Arduino as ISP

Fig. 2

Burning the Sanguino Bootloader using Arduino as ISP

Fig. 3

Click Images for High Resolution Versions.

 

The Schematic

Burning the Sanguino Bootloader using Arduino as ISP Schematic

Click for high resolution version.

Connections

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

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

Burning the Arduino Bootloader Using Arduino as ISP ATmega 644p

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

Burning the Sanguino Bootloader using Arduino as ISP

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
  • 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
  • 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
  • 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.)

Burning the Sanguino Bootloader using Arduino as ISP ATmega 644P

Fig. 5

Burning the Sanguino Bootloader using Arduino as ISP ATmega 644P

Fig. 6

Burning the Sanguino Bootloader using Arduino as ISP ATmega 644P

Fig. 7

Click Images for High Resolution Versions.

 

To test if you were successful at burning the Sanguino Booloader to the ATmega 644P you need to place the ATmega 644P into the socket on your Sanguino or Sanguinololu and upload one of the compatible RepRap firmware’s. If the firmware compiles and uploads with out error the you were successful. If you get an error, place the ATmega 644P back in the breadboard and check every connection again and try to burn the bootloader again.

 

The Sanguino development board is an extension of the popular Arduino board designed and developed by Zach Hoeken et.al. for the RepRap Research Foundation

Sanguinololu is a low-cost all-in-one electronics solution for Reprap and other CNC devices. It features an onboard Sanguino clone using the ATMEGA644P though a ATMEGA1284 is easily dropped in. Its four axes are powered by Pololu pin compatible stepper drivers. Sanguinololu was developed by Joe "Mosfet" Malone for the RepRap project.

Arduino as ISP for ATmega 644P was developed by Nils Vogels of XYZ Printers.

This tutorial was written by Charles Gantt of TheMakersWorkbench.com

 

Other Articles You Might Like

Review: Lulzbot AO-100 3D Printer part 1Lulzbot AO-100 / AO-101 reviewed

Tutorial: DIY Telescope to PC CableDIY Telescope to PC Cable

Project: LED Strip Bench LightingDIY RGB LED Strip Bench lighting

Review: ISO-TIP Portable  Soldering KitISO-Tip Portable Soldering Kit Review

Article: Arduino Due Overview

Project: 3D Printed Balloon Powered CarPrint a Balloon powered Jet Car with your 3D printer