Hello friends today we are going to discuss about what are the different ways you can program AVR microcontrollers. In this tutorial I am providing information based on ATMEL site and also provided different reference links. To program an AVR microcontroller you will need an AVR programming tool. Examples of AVR programmers made by Atmel are STK500, STK600, AVR Dragon, AVRISP mkII and JTAGICE mkII.
The computer software used to program the AVR is normally AVR Studio. AVR Studio is free of charge and can be downloaded from the above referred Tools & Software page. If you want to learn more about AVR Studio, please click here.
AVR Studio also has an integrated online AVR Tools User Guide where the users can learn more about how to use the AVR Tools. In the AVR Tools User Guide you can read more about how to program your AVR using a specific AVR Tool. Please click here to learn more about AVR Tools User Guide.
There exists three different AVR programming modes:
In-System Programming allows programming and reprogramming of any AVR microcontroller positioned inside the end system. Using a simple Three-wire SPI interface, the In-System Programmer communicates serially with the AVR microcontroller, reprogramming all non-volatile memories on the chip.
In-System Programming uses the AVR internal SPI (Serial Peripheral Interface) to download code into the flash and EEPROM memory of the AVR. ISP programming requires only VCC , GND, RESET and 3 signal lines for programming. No high voltage signals are required. The ISP programmer can program both the internal flash and EEPROM, fuses and lockbits.
The AVR can be programmed at the normal operating voltage, normally 2.7V-6.0V. Please note that the ISP frequency (SCK) must be less than 1/4 of the target clock. The ISP frequency is set in the programming dialog in AVRStudio.
AVR Tools that supports ISP programming are for instance STK600, STK500, AVRISP mkII, JTAGICE mkII and AVR Dragon.
If programming an AVR using ISP programming on a customer target board, please make sure that your ISP hardware design is compliant with the ‘Connecting ISP lines’ chapter in application note AVR042: AVR Hardware Design Considerations.
High Voltage Programming:
For High-Voltage programming a 12V programming voltage is applied to the RESET pin of the AVR device. All AVR devices can be programmed with High-Voltage programming, and the target device can be programmed while it is mounted in its socket.
Two different methods are used for High-Voltage programming: 8-pin parts use a serial programming interface, while other parts use a parallel programming interface.
The AVR Tools that supports high voltage programming is STK600, STK500 and the low-cost AVR Dragon.
Some devices have a JTAG interface, which can be used for both programming and debugging. The JTAG lines are shared with analog input and should be connected so that the JTAG programmer can get control of the lines. Though JTAG programming tools such as the JTAGICE mkII® can drive a resistive load (refer to AVR Studio help for details), capacitive load should in general be avoided. AVR’s that has the JTAG interface (Devices with 40 pins or more) can also be programmed using JTAG programming. The AVR Tools that supports JTAG programming is JTAGICE mkII, STK600 and the low-cost AVR Dragon.
The Program and Debug Interface (PDI) is an Atmel proprietary two-line interface that was introduced with the AVR XMEGA microcontroller family. As the name implies,this interface can be used for both In-System Programming and on-chip debugging of devices.
PDI is the new two-wire proprietary debug interface for ATxmega devices. It can, in-system, download code into the flash application and boot memories, EEPROM memory, fuses, lockbits and signature information. A minimum of four wires is needed to connect the AVR debugging Tool to the target board using the PDI interface. These signals are Vcc, GND, DATA and CLK. The CLK line is driven by the debugging Tool and the DATA line carries half-duplex communications between the debugging Tool and the target.
Fig shows the standard PDI connector supplied with Atmel programmers.
On how to use this programming modes with your AVR programmer, please see the AVR Tools User Guide.
The Tiny Programming Interface is featured on the Atmel® tinyAVR® devices with the lowest pin count. Fig shows the standard TPI connector supplied with Atmel programmers. Only three pins on the device are needed for use of this interface: RESET, TPICLK and TPIDATA. The two latter pins are multiplexed with regular I/O pins.
When you want to program a hex file into your AVR microcontroller connect your AVR programmer to your computer and to the AVR target board and power on the system. Then simply open AVR Studio and choose ‘Tools’ from the AVR Studio menu, then ‘Program AVR’ and Connect using the appropriate AVR tool.
The AVR Third Party support web-page lists a several of third party programming and software tools for AVR microcontrollers.
That’s for now. And don’t forget to bookmark this page and also please like it on facebook. Please drop in a comment if you like this or you have any doubt. Enjoy !!!