Users Guide (Ac PG Usbasp Ug v2.0)
Users Guide (Ac PG Usbasp Ug v2.0)
User Guide
Version 2.0
18 January 2012
AC-PG-USBASP-UG
AC-PG-USBASP USBASP AVR Programmer User Guide Version 2.0 18 January 2012
TABLE OF CONTENTS
1. OVERVIEW ................................................................................................................ 1 1.1. Introduction .................................................................................................... 1 1.2. References .................................................................................................... 1 1.2.1. Referenced Web Pages .......................................................................... 1 1.2.2. Acronyms and Abbreviations .................................................................. 1 1.3. Supported Microcontrollers ............................................................................ 2 1.4. Warnings........................................................................................................ 3 2. LAYOUT .................................................................................................................... 4 2.1. USB Type A ................................................................................................... 4 2.2. ISP 10 pin IDC ............................................................................................ 4 2.3. JP1 Supply Target ...................................................................................... 5 2.4. JP2 Self Program ........................................................................................ 5 2.5. JP3 Slow SCK ............................................................................................ 5 2.6. LEDs .............................................................................................................. 5 3. CIRCUIT DIAGRAM ..................................................................................................... 6 4. USING THE PROGRAMMER .......................................................................................... 7 4.1. Connecting the programmer to your computer .............................................. 7 4.1.1. Windows 7 (32 and 64 Bit) ...................................................................... 7 4.1.2. Windows Vista (32 Bit) .......................................................................... 10 4.1.3. Windows XP (32 bit) ............................................................................. 13 4.1.4. Other operating systems ....................................................................... 16 4.2. Downloading firmware to your microcontroller ............................................. 17 4.2.1. Required Items...................................................................................... 17 4.2.2. Assumptions ......................................................................................... 17 4.2.3. Procedure ............................................................................................. 17 4.2.4. More information ................................................................................... 18 4.3. Upgrading your USBasp .............................................................................. 18 4.3.1. Required Items...................................................................................... 18 4.3.2. Assumptions ......................................................................................... 19 4.3.3. Procedure ............................................................................................. 19 5. COMMENT AND QUESTIONS ...................................................................................... 20
iii
AC-PG-USBASP USBASP AVR Programmer User Guide Version 2.0 18 January 2012
TABLE OF TABLES
Table 1. Referenced Documents ........................................................................................................... 1 Table 2. Acronyms and Abbreviations ................................................................................................... 2 Table 3. Supported Microcontrollers ...................................................................................................... 3
TABLE OF FIGURES
Figure 1. Device Layout ........................................................................................................................... 4 Figure 2. 10 Pin ISP pinout ..................................................................................................................... 4 Figure 3. LEDs ......................................................................................................................................... 5 Figure 4. Circuit Diagram ........................................................................................................................ 6 Figure 5. Driver Installation on Windows 7 System Tray Message ..................................................... 8 Figure 6. Driver Installation on Windows 7 Installing Device Driver Software ..................................... 8 Figure 7. Driver Installation on Windows 7 No Driver found ................................................................ 8 Figure 8. Driver Installation on Windows 7 Device Manager ............................................................... 9 Figure 9. Driver Installation on Windows 7 Update Driver Software .................................................... 9 Figure 10. Driver Installation on Windows 7 Browse for Driver Software .......................................... 10 Figure 11. Driver Installation on Windows 7 Confirmation ................................................................. 10 Figure 12. Driver Installation on Vista 32 bit Found new hardware ................................................... 11 Figure 13. Driver Installation on Vista 32 bit - Found New Hardware USBasp ................................. 12 Figure 14. Driver Installation on Vista 32 bit Windows couldnt find driver software for your device . 12 Figure 15. Driver Installation on Vista 32 bit Browse for driver software ........................................... 13 Figure 16. Installation on Vista 32 bit Confirmation ........................................................................... 13 Figure 17. Installation on Windows XP New Hardware Wizard ......................................................... 14 Figure 18. Installation on Windows XP Insert CD or install from specific location............................. 15 Figure 19. Installation on Windows XP Specify Location................................................................... 15 Figure 20. Installation on Windows XP Driver installation ................................................................. 16 Figure 21. Installation on Windows XP Installation Confirmation ....................................................... 16 Figure 22. AVRdude writing a flash image to the microcontroller ......................................................... 18
iv
AC-PG-USBASP USBASP AVR Programmer User Guide Version 2.0 18 January 2012
1.
1.1.
Overview
Introduction
USBasp is a USB in-circuit programmer for Atmel AVR controllers. It simply consists of an ATMega8 and a few passive components. The programmer uses a firmware-only USB driver, no special USB controller is needed. Some of the key features include: a. b. c. Works under multiple platforms. Linux, Mac OS X and Windows are tested, Programming speed is up to 5kBytes/sec, and Slow SCK option to support targets with low clock speed (< 1.5MHz).
1.2.
References
AC-PG-USBASP USBASP AVR Programmer User Guide Version 2.0 18 January 2012
Description According to Atmel, AVR stands for nothing, it's just a name. Others say it stands for Advanced Virtual RISC. However, the inventors of the AVR series chips are named Alf Egil Bogen and Vegard Wollan, so you be the judge. Insulation Displacement Connector In System Programmer Light Emitting Diode Reduced Instruction Set Computing Serial Clock Single in Line Serial Peripheral Interface Universal Serial Bus
1.3.
Supported Microcontrollers
Table 3 lists the microcontrollers that are supported by the USB AVR Programmer.
AC-PG-USBASP USBASP AVR Programmer User Guide Version 2.0 18 January 2012
Supported Microcontrollers Mega Series ATmega8 ATmega48PA ATmega168 ATmega328P ATmega1281 ATmega163 ATmega169 ATmega2561 ATmega324P ATmega329PA ATmega64A ATmega644PA ATmega6490A Tiny Series ATtiny12 ATtiny26 Classic Series AT90S1200 AT90S4433 AT90S8535 Can Series AT90CAN128 PWN Series AT90PWM2 AT90PWM3 AT90S2313 AT90S4434 AT90S2333 AT90S8515 ATtiny13 ATtiny45 ATtiny13A ATtiny85 ATmega8A ATmega88 ATmega168A ATmega103 ATmega16 ATmega164 ATmega169A ATmega32 ATmega324PA ATmega3290 ATmega640 ATmega649 ATmega6490P ATmega48 ATmega88A ATmega168P ATmega128 ATmega16A ATmega164A ATmega169P ATmega32A ATmega329 ATmega3290A ATmega644 ATmega649A ATmega8515
ATmega48A ATmega88P ATmega168PA ATmega128P ATmega161 ATmega164P ATmega169PA ATmega324 ATmega329A ATmega3290P ATmega644A ATmega649P ATmega8535 ATtiny15 ATtiny2313 AT90S2343
ATmega48P ATmega88PA ATmega328 ATmega1280 ATmega162 ATmega164PA ATmega2560 ATmega324A ATmega329P ATmega64 ATmega644P ATmega6490
1.4.
Warnings
Some of the components discussed in this document are very sensitive to electrical static discharges. The reader should take precautions to ensure that components are protected against these discharges. Whilst the voltages typically seen in microcontroller circuits are low, the reader should be aware of the risk of working with electrical circuits and take necessary precautions.
AC-PG-USBASP USBASP AVR Programmer User Guide Version 2.0 18 January 2012
2.
Layout
2.1.
USB Type A
The USB end of the programmer connects directly into your computers USB port.
2.2.
The 10 pin ISP connection provides an interface to the microcontroller. This interface uses a 10 pin IDC connector and the pinout is shown in Figure 2
AC-PG-USBASP USBASP AVR Programmer User Guide Version 2.0 18 January 2012
2.3.
This jumper controls the voltage on the ISP VCC connector. It can be set to +3.3V, +5V or disable this jumper if the target device has its own power source.
2.4.
This jumper is used to update the firmware of the USBasp programmer. In order to update the firmware you will need 2 programmers. One to be programmed and the other to do the programming.
2.5.
When this jumper is selected, the slow clock mode is enabled. If the target clock is lower than 1.5 MHz, you need to set this jumper. Then SCK is scaled down from 375 kHz to about 8 kHz.
2.6.
LEDs
The USBASP programmer has 2 LEDs near the ISP connection. These have the following functions: a. b. LED R Programmer communicating with target device LED G Power
Figure 3. LEDs Whilst you might assume that LED R is red and LED G is green, they do vary depending on the batch. The one I use for instance has 2 red LEDs.
AC-PG-USBASP USBASP AVR Programmer User Guide Version 2.0 18 January 2012
3.
Circuit Diagram
AC-PG-USBASP USBASP AVR Programmer User Guide Version 2.0 18 January 2012
4.
4.1.
Connecting the programmer to your computer comprises of 2 steps: a. b. Physically connecting the programmer to the USB port, and Installing drivers in order for it to work.
Whilst the USBasp programmer will work on a wide variety of operating systems, this procedure will focus on Widows Vista 32 bit and Windows XPs
Items required to run this procedure are: a. b. c. USBasp programmer Computer with USB port and Windows 7 installed USBasp drivers downloaded and unzipped from (1) (2) http://www.protostack.com/download/USBasp-win-driver-x86-x64-ia64v1.2.5.zip or http://www.protostack.com/download/USBasp-win-driver-x86-x64-ia64v1.2.5.rar . Some people have problems with the zip file so rar file is available as well Assumptions
4.1.1.2.
This procedure assumes that: a. The logged in user has sufficient privileges to install device drivers Procedure
4.1.1.3.
To install the USBasp programmer: a. Insert the programmer into an available USB port
AC-PG-USBASP USBASP AVR Programmer User Guide Version 2.0 18 January 2012
b.
A message will appear in the system tray, as shown below. Click on Click here for status to see what is going on.
AC-PG-USBASP USBASP AVR Programmer User Guide Version 2.0 18 January 2012
e. f.
At this point, go into device manager and find the entry for the USBASP programmer. It should be displayed with a yellow alert icon next to it. Right click on the device and select Update Driver Software
AC-PG-USBASP USBASP AVR Programmer User Guide Version 2.0 18 January 2012
h.
Select the folder where you unzipped the driver files then click Next
Figure 10. Driver Installation on Windows 7 Browse for Driver Software i. When the installation is complete, a confirmation screen will be displayed. Click close to close it.
Figure 11. Driver Installation on Windows 7 Confirmation j. your programmer is now ready for use.
Items required to run this procedure are: a. b. USBasp programmer Computer with USB port and Windows Vista 32 Bit installed
10
AC-PG-USBASP USBASP AVR Programmer User Guide Version 2.0 18 January 2012
c.
USBasp drivers downloaded and unzipped from (1) (2) http://www.protostack.com/download/USBasp-win-driver-x86-x64-ia64v1.2.5.zip or http://www.protostack.com/download/USBasp-win-driver-x86-x64-ia64v1.2.5.rar . Some people have problems with the zip file so rar file is available as well Assumptions
4.1.2.2.
This procedure assumes that: a. The logged in user has sufficient privileges to install device drivers Procedure
4.1.2.3.
To install the USBasp programmer: a. b. Insert the programmer into an available USB port When the Found New Hardware dialog opens, select Locate and install driver software (recommended)
Figure 12. Driver Installation on Vista 32 bit Found new hardware c. d. Wait while Windows Vista attempts to locate a driver When the Found New Hardware USBasp dialog box is displayed, select I dont have the disc. Show me other options
11
AC-PG-USBASP USBASP AVR Programmer User Guide Version 2.0 18 January 2012
Figure 13. Driver Installation on Vista 32 bit - Found New Hardware USBasp e. On the next screen select Browse my computer for driver software (advanced)
Figure 14. Driver Installation on Vista 32 bit Windows couldnt find driver software for your device
12
AC-PG-USBASP USBASP AVR Programmer User Guide Version 2.0 18 January 2012
f.
Click Browse and select the folder where you unzipped the USBasp drivers, then click Next
Figure 15. Driver Installation on Vista 32 bit Browse for driver software g. When the installation is complete, a confirmation screen will be displayed. Click close to close it.
Figure 16. Installation on Vista 32 bit Confirmation h. Your programmer is now ready for use
Items required to run this procedure are: a. b. c. USBasp programmer Computer with USB port and Windows XP 32 bit installed USBasp drivers downloaded and unzipped from
13
AC-PG-USBASP USBASP AVR Programmer User Guide Version 2.0 18 January 2012
(1) (2)
http://www.protostack.com/download/USBasp-win-driver-x86-x64-ia64v1.2.5.zip or http://www.protostack.com/download/USBasp-win-driver-x86-x64-ia64v1.2.5.rar . Some people have problems with the zip file so rar file is available as well Assumptions
4.1.3.2.
This procedure assumes that: a. The logged in user has sufficient permissions to install device drivers Procedure
4.1.3.3.
To install the USBasp programmer: a. b. Insert the programmer into an available USB port When the New Hardware Wizard dialog box is displayed, select No, not this time then click Next
Figure 17. Installation on Windows XP New Hardware Wizard c. On the next page select Install from a list of specific location (Advanced) then click Next
14
AC-PG-USBASP USBASP AVR Programmer User Guide Version 2.0 18 January 2012
Figure 18. Installation on Windows XP Insert CD or install from specific location d. On the Search and Installation options page (1) (2) (3) Ensure that Include this location in the search is checked, Click Browse and select the folder where you unzipped the USBasp drivers, then Click Next
15
AC-PG-USBASP USBASP AVR Programmer User Guide Version 2.0 18 January 2012
e.
Figure 20. Installation on Windows XP Driver installation f. When the installation is complete, a confirmation screen will be displayed. Click close to close it.
Figure 21. Installation on Windows XP Installation Confirmation g. Your programmer is now ready for use
16
AC-PG-USBASP USBASP AVR Programmer User Guide Version 2.0 18 January 2012
4.2.
4.2.2. Assumptions
This procedure assumes that a. b. AVRdude is in the path, and USBasp drivers have already been installed.
4.2.3. Procedure
To download the firmware to your microcontroller: a. b. c. d. Insert the programmer into an available USB port Connect the programmer to the microcontroller via a 10 pin ISP cable (see Required items d & e), Open a command prompt Enter the following command where (1) (2) <FILE> is the filename of the precompiled binary file , and <DEVICE> is the micro controller type you are programming (eg ATMEGA8). The full list of device codes is listed at http://www.nongnu.org/avrdude/usermanual/avrdude_4.html#Option-Descriptions
17
AC-PG-USBASP USBASP AVR Programmer User Guide Version 2.0 18 January 2012
-U flash:w:<FILE>
4.3.
18
AC-PG-USBASP USBASP AVR Programmer User Guide Version 2.0 18 January 2012
4.3.2. Assumptions
This procedure assumes that a. b. c. The precompiled firmware filename is main.hex, AVRdude is in the path, and USBasp drivers have already been installed.
4.3.3. Procedure
To download a new copy of the firmware to a USBasp progammer: a. b. c. d. e. Insert the active programmer into an available USB port Set the JP2 jumper on the target programmer If there is no header on JP2, then solder one on Connect the 10 pin ISP cable from the active to the target programmer Open a command prompt Enter the following command
avrdude -p atmega8 -P usb -c usbasp -U flash:w:main.hex
19
AC-PG-USBASP USBASP AVR Programmer User Guide Version 2.0 18 January 2012
5.
If you have any questions or comments regarding this documentation or any of our products, please contact us via http://www.protostack.com/index.php?main_page=contact_us.
20