Electronic – arduino – an AVR programmer for Arduino

arduinoavrembedded

I'm a beginner with Arduino. I'm reading a book called Practical AVR Microcontrollers: Games, Gadgets, and Home Automation with the Microcontroller Used in the Arduino.

From the beginning, the book speaks about the AVR programmer. It says that the way to communicate and send code / compile code for the Arduino is by connecting your computer to the AVR programmer and then the AVR programmer to the Arduino.

The book is several years old so maybe things have changed. Do I need to have this extra component called the AVR programmer?

Best Answer

An Arduino is not an AVR. AVR is a family of microcontrollers made by Atmel, which includes 8-bit and 32-bit microcontrollers. Most common Arduino boards (UNO, duemilanove, etc.) use the ATMEGA328p, and new ones like Leo use the ATMEGA32u4 which is also in the AVR family. Arduino is a hardware and software platform built with an AVR. It sounds like your book is about the AVR and is referencing Arduino to draw attention. It's about Arduino as much as a book entitled "Practical Physics. Fun Physics experiments in the same field studied by Sheldon in The Big Bang Theory" is about Sheldon Cooper.

If you have just an AVR, you need something to program it. The most common way is through In-Circuit Serial Programming, or ICSP. Usually this is a 6 pin .100" pitch header. There are devices out there that speak this protocol on one end, and USB on the other. Atmel's AVRISP mkII is an example. There are many alternative products which do the same thing. This is what people often mean when they say "AVR programmer".

The Arduino platform canonically includes the same functionality that is in a device like the AVRISP mkII so that the AVR in the Arduino can be programmed with nothing more than an ordinary USB cable and the Arduino software. If your Arduino has a USB port on it, this is almost surely the case, and you do not need an extra AVR programmer. You just need a USB cable.

There are Arduino variants that omit this component to reduce cost. These Arduinos don't have USB ports. Instead, they have the ICSP header or something similar, and the electronics that would have been present on other Arduinos are instead available in a separate cable or device.

To summarize, if your Arduino has a USB port, you probably do not need an additional AVR programmer, because the programmer is on the Arduino. If your Arduino does not have a USB port, you probably do need an AVR programmer.

If you buy, for example, an ATMEGA328p and put in your Arduino board, it will not work, because it has to be programmed with the bootloader and appropriate fuses to work properly. This programming is done using the ICSP interface by the AVR programmer. This needs to be done just once, after this you can use it to upload sketches.