Monthly Archives: October 2013

Use Arduino as an ISP programmer to program non-Arduino AVR microcontrollers

After reading my recent tutorial on using Arduino code in non-Arduino microcontrollers, one of my readers asked me if it is possible to use Arduino as an ISP programmer to program these micro controllers, instead of using a separate dedicated AVR programmer.

The answer is a definite yes and I use it all the time, since I have a lot of Arduinos lying around. I thought of writing a tutorial, so that it will be useful for others who want to do this.

In this tutorial, I will show how you can program a non-Arduino AVR microcontroller like AtMega 16/16A using Arduino as an ISP programmer.

Loading Arduino ISP sketch

By default Arduino IDE comes with an ISP sketch. All you need to do is to open it up in your Arduino IDE (or using my Arduino makefile), then connect your Arduino to your computer and then upload the sketch to your Arduino.

You should not connect anything else to your Arduino at this point and you will find the Arduino ISP sketch in File -> Examples -> ArduinoISP

Installing Arduino core for your microcontroller

The next step is to find the Arduino core support for the microcontroller you want to program and then install it.

If you want program ATMega 16/16A, then you can use my “Arduino extra core“. I have also written a separate tutorial explaining how to use it. Or if you want to program ATtiny microcontrollers, then you can use the ATtiny core by David Mellis, one of the co-founders of Arduino.

Most of the time, you just have to place these core files inside /hardware directory in your sketchbook folder, but consult the documentation of the actual core library you are using.

Connect the circuit

The next step is to connect the microcontroller to your Arduino. The below diagram shows how to connect ATMega 16/16A. In general the principle remains the same for other micro controllers as well.

Program ATMega 16 using Arduino as ISP Programmer

Program ATMega 16 using Arduino as ISP Programmer

The following are the different pin connections

  • Arduino Pin 13 to ATMega 16 Pin 8 (or SCK of another microcontroller)
  • Arduino Pin 12 to ATMega 16 Pin 7 (or MISO of another microcontroller)
  • Arduino Pin 11 to ATMega 16 Pin 6 (or MOSI of another microcontroller)
  • Arduino Pin 10 to ATMega 16 Pin 9 (or RESET of another microcontroller)
  • Arduino 5+ to ATMega 16 Pin 10 (or Vcc of another microcontroller)
  • Arduino Gnd to ATMega 16 Pin 11 (or Gnd of another microcontroller)
  • 10 uF capacitor between Arduino Reset Pin and Gnd Pin (+ve leg of capacitor should go to Reset pin)
  • LED through proper resistor on any pin of the microcontroller, which you will be controlling through code

This is how my connection looks like

Program ATMega 16 using Arduino as ISP Programmer

Program ATMega 16 using Arduino as ISP Programmer

Burn bootloader/fuse

The next step is to burn the bootloader or/and fuses. For most cores, you don’t need to use the bootloader.

My Arduino extra core doesn’t need any bootloader, but only needs some fuses to be set.

You can burn the bootloader and/or the fuses, by selecting Tools -> Burn Bootloader. Make sure you have chosen the correct board type before you do that.

Upload your sketch

Now, everything is ready, and all you need to do is to write your sketch and then upload it. The ISP sketch that your burned into your Arduino, will take care of the rest.

To use serial monitor, with your microcontroller, you can use my other tutorial which shows how you can use another Arduino as a bridge.

Upload your sketch using makefile

My Arduino makefile also supports uploading sketches through Arduino ISP programmer. Follow all the normal instructions and then define ALTERNATE_CORE and ISP_PORT in your makefile and run make ispload target.

Happy Hacking 😉

Arduino announces two new boards

Recently in Maker Faire Rome, Arduino announced two new Linux based Arduino boards – Galileo in collaboration with Intel (Yes 😉 ) and Arduino TRE in collaboration with Texas Instruments (the company behind BeagleBoard). Together with Arduino Yun, now the total number of official Arduino Linux based boards is 2.

Intel Galileo

First Arduino certified board using Intel chip

First Arduino certified board using Intel chip

This board is created in collaboration with Intel and will be called Intel Galileo instead of Arduino Galileo. It is an Arduino certified board, the first one of this category and I guess that is the reason it is called Intel Galileo and not Arduino Galileo. This board was announced by Massimo Banzi along with Intel CEO Brian Krzanich in Maker Faire Rome.

Galileo is a microcontroller board based on the Intel® Quark SoC X1000 Application Processor, a 32-bit Intel Pentium-class system on a chip. And the Arduino website claims that this will be a great tool for prototyping simple interactive LED light displays and to create home automation solutions.

Intel Galileo will be available for purchase from November 19 – 2013, but the pricing information is still not available.

Arduino TRE

The most powerful Arduino till date

The most powerful Arduino till date

The second board which was announced (also in Maker Faire Rome) is Arduino TRE, which was developed in collaboration with Texas Instruments.

Arduino TRE is a combination of two Arduinos, which is quite clear if you look at the above image. One is based on the Texas Instruments Sitara AM335x ARM Cortex-A8 processor and the other is a AVR-based Arduino. This board will be able to run “full Linux”, not a stripped down version like Arduino Yun. Arduino website also claims that this is the “most powerful Arduino to date”.

Arduino TRE, based on the Texas Instruments Sitara AM335x ARM Cortex-A8 processor is the “most powerful Arduino to date” and the first that will be able to run “full Linux.”

Thanks to the 1-GHz Sitara AM335x processor, Arduino developers get up to 100 times more performance with the Sitara-processor-based TRE than they do on the Arduino Leonardo or Uno. This performance opens the doors to more advanced Linux-powered applications. The Sitara-processor-based Linux Arduino can run high-performance desktop applications, processing-intensive algorithms or high-speed communications.

Arduino TRE will be available for purchase from Spring 2014, but the pricing information is still not available.

How it compares with Raspberry Pi?

It is pretty clear, that both these boards and also Yun have been motivated by Raspberry Pi, but the real question is how does these boards compare with Raspberry Pi?

I would say that either Arduino Yun or TRE is comparable with Raspberry Pi, since both can run Linux. Intel Galileo falls into the class of Arduino Due, which are slightly different from Raspberry Pi.

I guess both cost and ease of programming would be crucial factors in deciding between Arduino and Raspberry Pi. Arduino Yun itself is priced at $69, so definitely Arduino TRE will cost more than that, which means Raspberry Pi is going to have a clear advantage here.

But I guess in the ease of programming perspective, Arduino might have an upper hand. I guess the Bridge library which was created for Arduino Yun will be extended for Arduino TRE as well. The Bridge library provides very simple Arduino friendly API’s to access and control Linux and I guess that may be a huge game changer.

So at this point, I guess we can only speculate. It would be really interesting to see how things unfold. But one thing is certain, the future for makers and tinkers is bright 🙂

Happy Hacking 😉