Contacts

Programmer for AVR from the cord of phones. USB ISP programmer for AVR: one more step away from Ardulation. Programs for working with the programmer

Today I will tell, about the inexpensive and very simple programmer USBASP V.2.0 for AVR microcontrollers (based on the design of Thomas Phishla), you can flash AVR controllers via the ISP interface (without paying it from the board), and most importantly, you can flash the boot sector on Arduino controllers.

Technical specifications

Power supply: 5 V, DC
Interface: USB 2.0
Programming / Reading: ATMEL (AVR)
Dimensions: 70 mm x 18 mm x 10 mm
Support for operating systems: Windows XP / 7/8 / 8.1 / 10.

General

USBASP programmer applies and open source codeSo, if you wish, you can make it yourself by downloading the printed circuit board and firmware from the Thomas site, because of this in various online stores there are various variants of the programmer with the same functionality. In my case I will tell about usbasp v2.0 chinese manufacturer LC Technelogy.

The programmer is assembled on a blue printed circuit board, the USB connector required to connect to the computer is located on the left. The center is the ATMEGA8A controller, a quartz resonator is installed near 12 MHz and an electric strapping (resistors, capacitors). On the right there is a 10-pin connector (two rows, five conclusions, a pitch of 2.54 mm), which provides a data exchange with a microcontroller (ISP interface). The kit comes with a cable, on each side of which, the IDC connector (10 outputs) is installed, for simplicity of firmware of some boards (for example Arduino), I advise you to purchase an adapter adapter with a 10-pin to 6-PIN. Assigning the conclusions of the USBASP programmer can be viewed in the figure below, view on the programmer side.

Appointments:
1 - Mosi.
2 - VCC.
3, 8, 10 - GND
4 - TXD.
5 - Reset.
6 - RXD.
7 - SCK.
9 - Miso.

Light indication
Red LED G - Enabled
Red LED R - Data Exchange

Jumper
JP1 - POWERcontrols the voltage on the ISP VCC connector (output 2), you can set to + 3.3V, + 5V or remove the jumper if the programmable device has its own power source.
JP2 - SERVICE,uSBASP firmware updates.
JP3 - Slowlow speed programming, if a programmable device, operates at a frequency below 1.5 MHz, SCK (output 7) will reduce the frequency from 375 kHz to 8 kHz.

The conceptual scheme of the USBASP V2.0 programmer can be viewed in the figure below.

Supported list AVR microcontrollers:
Mega Series:
ATmega8, ATmega8A, ATmega48, ATmega48A, ATmega48P, ATmega48PA, ATmega88, ATmega88A, ATmega88P, ATmega88PA, ATmega168, ATmega168A, ATmega168P, ATmega168PA, ATmega328, ATmega328P, ATmega103, ATmega128, ATmega128P, ATmega1280, ATmega1281, ATmega16, ATmega16A, ATmega161, ATmega162, ATmega163, ATmega164, ATmega164A, ATmega164P, ATmega164PA, ATmega169, ATmega169A, ATmega169P, ATmega169PA, ATmega2560, ATmega2561, ATmega32, ATmega32A, ATmega324, ATmega324A, ATmega324P, ATmega324PA, ATmega329, ATmega329A, ATmega329P, ATmega329PA, ATmega3290, ATmega3290A, ATmega3290P, ATmega64, Atmega64a, atmega640, atmega644, atmega644a, atmega644p, atmega644pa, atmega649, atmega649a, atmega649p, atmega6490, atmega6490a, atmega6490p, atmega8515, atmega8535,
Tiny Series:Attiny12, attiny13, attiny13a, attiny15, attiny25, attiny26, attiny45, attiny85, attiny2313, attiny2313a
Classic Series:AT90S1200, AT90S2313, AT90S2333, AT90S2343, AT90S4414, AT90S4433, AT90S4434, AT90S8515, AT90S8535
CAN SERIES:AT90CAN128.
Pwn Series:AT90PWM2, AT90PWM3

Installing USBASP driver on Windows 8/10

We connect the programmer to the USB port on the computer, if everything is fine, the red LED will turn on the board. Next, the operating system will start searching the driver

Since there is no operating system valid Driver, in " Device Manager»A device will appear Usbasp."With an exclamation mark.

Download the archive with a digital signature, unzip and launch " Installdriver.exe »

Driver installed, in " Device Manager»Lost exclamation point from " Usbasp.».

Installing the driver on Windows XP and Windows 7 is similar, the programmer is ready for operation.

The program has developed " Bodnar Sergey"Works not only with the Chinese programmer USBASP V.2.0, but also by other programmers. First of all, you download the program, unzip and launch " AvrDadeProg.exe.».
As an example, I keep the Chinese board Arduino UNO R3 in which the ATMEGA328P chip is installed. In the program, click on the tab " Microcontrollers"And select ATMEGA328P.

Next, you need to select the firmware, in the string " Flash.»Press" . . . ", Go to the folder" C: \\ Program Files \\ Arduino \\ Hardware \\ Arduino \\ Avr \\ Bootloaders \\ ATMEGA"And choose" Atmegaboot_168_atmega328.hex", Press" Open»

We connect the programmer to the board " Arduino Uno R3."And press the button" Programming».

At the end, a dialog box will be released, about the successful end of programming.

ATMEL's microcontrollers managed to win wide popularity. Their programming can be performed directly in the boot of the finished device through a simple ISP cable connected to the LPT port. personal computer Or a cable slightly more complicated, connected to the COM port. But currently more and more motherboards produced without the other, and in LPT laptops disappeared long ago, replaced uSB interface. However, under this interface, programmers also exist and are available.

For a scale next to the usual 5 mm LED.
This USBASP programmer supports the following microcontrollers:

List of supported MK

Attiny11, attiny12, attiny13, attiny15, attiny22, attiny2313, attiny24, attiny25, attiny26, attiny261, attiny28, attiny44, attiny45, attiny461, attiny84, attiny85, attiny861
AT90S1200, AT90S2313, AT90S2323, AT90S2343, AT90S4414, T90S4433, AT90S4434, AT90S8515, AT90S8535
Atmega8, atmega16, atmega161, atmega162, atmega163, atmega164, atmega165, atmega168, atmega169, atmega32, atmega323, atmega324, ATMEGA325, and ATMEGA325,
ATmega3250, ATmega329, ATmega64, ATmega640, ATmega644, ATmega645, ATmega6450, ATmega649, ATmega6490, ATmega128, ATmega1280, ATmega1281, ATmega2560, ATmega2561, ATmega103, ATmega406, ATmega8515, ATmega8535
AT90CAN32, AT90CAN64, AT90CAN128
AT90PWM2, AT90PWM2B, AT90PWM3, AT90PWM3B
AT90USB1286, AT90USB162, AT90USB646, AT90USB647
AT89S51, AT89S52
AT86RF401.




Together with the programmer comes a 10-core towers with connectors.


The programmer is taken from the computer's USB port.


The programmer's board has a place to split the LDO voltage stabilizer by 3.V, but it is not smoky.
The programmer is supported by the AVRDEDE program. The program itself is console, but there is under it. The AvrDede utility can be found in the / Hardware / Tools folder / in the distribution Arduino IDE or download online.
Before you start working with the programmer, you will need to download the CO driver.
Also, the programmer is supported by the Arduino development environment.


For the programmer there is a firmware called, which turns it into STK500-compatible and perceived by the ATMEL AVR Studio branded development environment, but due to the high variability of Chinese iron, it is possible to use it only at your own peril and risk. I plan to buy +32. Add to favourites I liked the review +17 +42

Publikovano 23.02.2011

Nebolly review used in the practice of programors for AVR microcontrollers. AVR ISP PRORGAMMER. and USB AVR / 89S Compatible Programmer Compatible with AVR910.

AVR ISP PRORGAMMER.

Intrahemnaya programmer for programming ATMEL® microcontrollers, both under mass production and in the process of developing and debugging products.

The programmer supports the following family of crystals:

Tinyavr.

Attiny11l, attiny11, attiny12v, attiny12l, attiny13, attiny15l, attiny2313, attiny26l, attiny26, attiny28v, attiny28l

AT90S1200, AT90S2313, AT90LS2323, AT90S2323, AT90LS2343, AT90S2343, AT90LS4433, AT90S4433, AT90LS8515, AT90S8515, AT90LS8535, AT90S8535

Megaavr.

ATmega48, ATmega88, ATmega168, ATmega8, ATmega16, ATmega32, ATmega64, ATmega640, ATmega128, ATmega1280, ATmega1281, AT90CAN128, ATmega103, ATmega161, ATmega162, ATmega163L, ATmega169, ATmega8515, ATmega8535, ATmega2560, ATmega2561, ATmega325, ATmega3250, ATmega645, ATmega6450, ATMEGA329, ATMEGA3290, ATMEGA649, ATMEGA6490

Distinctive features:

- intrahemum programming (no additional transition panels are required, while programming conclusions are used in the project)

- Support programmer Popular compilers AvrStudio, IAR AVR, Image Craft AVR.

- Automatic verification (100% guarantee of conformity of the sewn code source)

- High programming speed, firmware serial number Crystal

i for a long time successfully used and keep using this reliable and simple programmerrunning through the LPT port.

Scheme of this simple, but reliable programmer:

A double-sided board is placed in the connector:


I needed the second programmer, and the USB programmer described below could not sew the microcontroller I need. Therefore, I decided to repeat this LPT programmer.



Computer trends are such that the LPT port will soon disappear. Therefore, it's time to look like an alternative.

AVR / 89S microcontroller programmer compatible with AVR910 (USB programmer)

Having visited several stores, I realized that the price of programmers are lurpp not modest, so it decided to freeze and make the programmer himself.
Surgoing the expanses of the Internet, found several implementations compatible commands with the original AVR910 ATMEL programmer.

Minus such a rework - the absence of a fuse. Although, as practice has shown, USB port with meekly closure is unlikely to succeed. At least, on my computer did not come out, but it is not worth experimenting.
The VL3 LED signals the power supply to the programmer through uSB port. LEDs VL1, VL2 signals read / write programmer.
Jumper J1 - (Modify) serves to program the microcontroller in the new programmer. When it is closed, an external programmer is connected to the ISP connector and loads in the MK program.
After this jumper, you must open and close the jumper J2 - Normal. We do not touch him anymore.
With the help of jumper J3 Low SCK it is possible to lower the clock frequency of the SPI programmer port of the programmer to ~ 20 kHz. With open jumper, the SPI frequency is normal, with a closed - reduced.
Remarkable feature, a meander with a frequency of 1 MHz for "revitalizing" MK has been displayed on the LED connector for the "revitalization" of MK, which have been erroneously programmed by FUU-bits responsible for tacting. Very useful thing!

Fuste Bits firmware
For the normal functioning of the controller in the circuit, it is necessary that the Spien, Ckopt, Sut0 and Boden bits are programmed (installed in "0"). Usually microcontrollers running from the factory, i.e. New, have already programmed Bit Spien. The remaining bits must be unspegrated (installed in "1").

Installation
Windows 2000 / XP / Vista / Seven 32-bit

Flash controller. Connect the freshly baked programmer to the PC via the free USB connector. The operating system will find a new device - AVR910 USB PROGRAMMER, when you offer to automatically find the driver, refuse, and specify the path to the INF file, depending on the operating system installed on your computer.
In the archive with the firmware there is a folder " AVR910.DRIVER "In which three directories are located for different options operating systems:
-“2k_xp_32. "- for operating systems Windows 2000 / XP 32-bit (Used using a regular USBSER.SYS driver)
-“vista_XP_32. "- for operating systems Windows XP / Vista / Seven 32-bit (USBSER.SYS + LOWBULK.SYS from Osamu Tamura)
-“vista_XP_64. "- for operating systems Windows XP / Vista / Seven 64-bit (USBSER.SYS + LOWBULK.SYS from Osamu Tamura)

Installation Features:

In principle, the installation does not differ from this for Windows XP, but there is one thing - the delay in the USBSER.SYS driver of this OS spoil the chain of commands from the PC to the programmer and, accordingly, the chain of the responses is back from the programmer to the PC ... Problem I I have not yet installed, but there is a solution. Of course, not the most beautiful, but it works securely 🙂 you need to replace the USBSER.SYS file in the system windows folders 2000 for similar from Windows XP. These are folders ... \\ WinNT \\ System32 \\ Drivers \\ and ... \\ winnt \\ system32 \\ dllcashe \\. The USBSER.SYS file from Windows XP SP1 can be taken here. Naturally, the driver will have to be replaced by booting under another OS (for example from the boot disk).

To use drivers on a 64 bit platform, you must disable the test of digital signatures of the drivers, clicking function key F8 During the start of the system boot.
The second option, using the program "Driver Signature Enforcement Overrider", which signs the driver as "testdriver" and activates "testmode", so you can download the driver without a real digital signature. You can find more detailed description On the program page, passing on the link above.

That's what happened to me:



Programmer I use with AvrProg v.1.4 programs from AvrStudio package. On Windows XP is working trouble-free.

The programmer is set as a virtual COM port. The only thing that needs to be considered, AvrProg checks the ports from 1 to 4. We will have to move the device to the port to the COM4, \u200b\u200bor in the AvrStudio settings, specify which port to search for the programmer.

Scheme, fee, firmware and driver can be downloaded.

P.S. When I needed to flash PWM controllers (AT90PWM3), I had to do this using the old good AVR ISP PRORGAMMER (via LPT port), AvrProg v.1.4 does not know AT90PWM3. Not a specific situation is also made with ATMEGA64. Therefore, I have the main working programmer, I have a false AVR ISP PRORGAMMER.

P.S.P.S. Not so long ago I bought a friend this usbasp programmer

Drivers and for it look here: http://www.fischl.de/usbasp/
It works, while the absence of bugs seen from AVR / 89S compatible with AVR910 (USB) programmer has deliberately.

The article describes how to work with these and other programmers.

In my case, this is an absolute record holder for delivery speed - about 5 months of careless wandering is incomprehensible where. Despite the monstrous time delay, I still got the package, which is not enough, not looking at the shortcomings, about which I will tell below. Since I have very bad memory, you needed to combine the found useful information Somewhere in one place in the form of a memo, to collect it in the grains in different cattle of the network turned out to be non-trivial, so I will decide all this with a separate post.
USB ISP is the cheapest AVR controller programmer, which can be found on sale, was taken to expand the horizons and more in-depth study of AVR.
The overview includes: a description of the programmer, how to connect it to the chip, configuring its operation in the AvrDude Prog, Khazama, Atmel Studio 7, and not only.

Of course, instead of it, Arduino Uno can be used with the arduinoisp sketch stitched into it, but it is not convenient, it's not only alone with wires, especially if Uno is just alone, beat back enthusiasm. It was easier to be chained separately such a programmer, more precisely two. For two reasons:
1) Even before buying, from the reviews it was clear that the quality of the soldering of these devices suffers, and some more and with split stabilids they came. It was decided to progress, ordering two.
2) One programmer can be sewn to the other by rearning the jumper on the driven device.

Specifications

Supported OS: Windows, MacOS, Linux
CPU: ATMEGA8A.
PC connection interface: USB
Programming Interface: ISP (intrahemnoe)
Programming voltage: 5V or 3.3B (depending on the jumper position JP2)
Programming frequency: 375kHz (default) and 8kHz (with a closed jumper JP3)
Supported controllers: All AVR with SPI interface
Description:

List of supported microcontrollers

ATMEGA Series

ATMEGA8 ATMEGA48 ATMEGA88 ATMEGA168 ATMEGA328
ATMEGA103 ATMEGA128 ATMEGA1280 ATMEGA1281 ATMEGA16
ATMEGA161 ATMEGA162 ATMEGA163 ATMEGA164 ATMEGA169
ATMEGA2560 ATMEGA2561 ATMEGA32 ATMEGA324 ATMEGA329
ATMEGA3290 ATMEGA640 ATMEGA644 ATMEGA64 ATMEGA649
ATMEGA6490 ATMEGA8515 ATMEGA8535

Tiny Series

ATTINY12 ATTINY13 ATTINY15 ATTINY26 ATTINY25
ATTINY45 ATTINY85 ATTINY2313.

Classic series

AT90S1200 AT90S2313 AT90S2333 AT90S2343 AT90S4414
AT90S4433 AT90S4434 AT90S8515
AT90S8535

CAN Series

AT90CAN128.

PWM Series

AT90PWM2 AT90PWM3.

Appearance

Delivery set Minimum - programmer + loop without gum. In my case in double quantities.

The culture of execution is really chromas, I immediately rushed crooked rowing. Everywhere where you can - there are traces of flux, and with oxides, apparently, the programmers have long been lying around in stock, and their assembly was produced with the inherent speed.















Some holes are not entirely filled with the solder



SMD elements are also crooked soldes



The comb a little later leveled, it's hard to look unpleasant to such a squeezing, the elements are released, and then I washed my feet



Sizes of the board are a few more USB-TTL converter on CP2102



The length of the plume is about 30cm, there is an opinion that the shorter the train, the better. Some of it specially shortened. If you order an original USBASP - there is a complete train already 50cm.



Controls on the board

On the board there are three jumpers that specify different modes of the programmer:
JP1 - closes in the case of updating the firmware of the programmer itself
JP2 - Triple jumper, it is selected here, which voltage will be fed to the flashable microcontroller, or 5B (left position) and 3.3B (right position)
JP3 - If you closure, the programming of the controller will occur with a reduced frequency, however, the Chinese did not get into the ridge here, because On this firmware it is not required
The programmer, as you can see, is built on the basis of ATMEGA8 with quartz at 12 MHz. The most right upper element, signed F1, with a turned outfit 4 - self-repairing fuse, protects the USB port of the PC / laptop if on the flashing board suddenly happened short circuit. Under the jumper JP2. LDO-stabilizer is located 662K.Lowering voltage from 5V to 3.3V if the jumper is installed in the right position.

Installation of drivers

To start using the programmer, you must first put the drivers on it. I insert any programmer to the USB port of the PC, the signal of new equipment sounds, the LED is lit on the device itself, but automatic search Drivers do not happen.
note. Before installing the driver, you must disable digital signature check in Windows
1) Download, unpack in a comfortable place.
2) Go to "Device Manager", for example, bring the cursor to main button (Win10), Press the PCM and select the Device Manager item.

3) In the branch "Other devices" can be seen unidentified device USBASP with orange triangle -\u003e Hold the cursor on it, press PCM -\u003e "Update drivers ..."

4) Specify the path to an early unpacked folder with drivers - "libusb_1.2.4.0", click "OK"

5) "Anyway to install this driver"

6) Ready, now orange triangles disappeared, drivers are delivered



Firmware female

I have already been known before that the Chinese sell these programmers with not the most firmware. I decided to upper the firmware at one of them first, and then for the sake of interest to compare both programmer in your work. To do this, connect the loop of both devices, on the host (which insert into the USB port) no jumpers are touching, and on the slave programmer (on which we will update the firmware) I rearranged the jumper with JP2. on the JP1:



I go to the Khazama Avr Programmer program, I choose from the ATMEGA8 drop-down list and first consider Flash memory through the "Command" menu item -\u003e "Read Flash to Buffer" to dry the Chinese factory firmware. Just in case.

At the same time, this error will periodically fall, closing the window, the program will continue to work.

It is read, which is completed by the pop-up window about successful reading Flash memory in the buffer

Now you need to save the contents of the buffer: "File" -\u003e "Save Flash Buffer AS ...". Choose a comfortable place where old firmware Save, give a name (I, for example, called it firmware_1) and add the extension * .hex - if you do not write, then it will save as simply a file without expansion.


Download the firmware for the programmer from the page, archive usbasp.2011-05-28.tar.gz. (In the same archive there are drivers for Windows, unpacking the contents at a convenient place.
Meanwhile, in Khazama, download the downloaded firmware into the buffer. "File" -\u003e "Load Flash File To Buffer". I choose the firmware where ATMEGA8 is written in the title, since the firmware programmer on this chip.

As can be seen, here are three firmware - for ATmega8, 48 and 88. In our case, Atmega 8 - I choose it.

I stitched. "Command" -\u003e "Write Flash File To Buffer". An error occurs again, but after the process ending with success.



Since in the usual understanding to "program" means to set 1, then when working with fuses, everything is exactly the opposite, from which the confusion occurs and in this case it is possible to block the controller by negligence and then it will be impossible to flash it. The Khazama Avr Programmer program is convenient to watch the FUU-BIT - there is clearly visible and scheduledwhich ones are installed, and which are not.

They are on the way "Command" -\u003e "Fuses and Lock Bits ..." will open:

Where by clicking the "READ AL" button, fuses and lok-bits are considered, and the notorious error will have time to get out of 5 times in a row. Errors roll on the factory Chinese firmware. But if you insert a newly stitched programmer into the USB port, the firmware downloaded on the link above, then these errors will not be closed, but the bugs will get out elsewhere, but they are later.

Communication with Pro Mini (ATMEGA 168, 3.3V / 8MHZ)

In this case, the conclusions of the programmer are connected to the outputs of the board Pro mini.As illustrated on a schematic figure below. Jumpers are not rearranged, i.e. It remains in position 5B.
Although pro. Mini is signed as 3.3B, on the 168th Atmada can be served 5V. The AMS1117 stabilizer by 3.3v, by the way, is at all falling out of the board.



AVRDEDE PROG 3.3.
Console program for the firmware of chips, its graphic interface does not have in stock runs from command lineBut the enthusiasts were written a lot of shells on her, for the convenience of working with her. One of these shells is called Avrdude Prog, created by Russian-speaking developers. This shell, in my opinion it is convenient for Flash-flashing MK. After it starts, the controller is selected, in this case, ATMEGA168 and the type of programmer - USBASP. After that, you can engage in memory recording / reading. What is on the factory firmware, that on a new one - in both cases, no problems with ATMEGA168 did not occur. I was silent for the sake of interest Arduin standard blink-sketch exported to a binary hex file. Everything is smooth.




Khazama Avr Programmer
Here it is enough to choose a microcontroller from the drop-down list and you can already work with memory / bits.
However, if the programmer itself is installed factory firmware, the errors will be raised periodically, about whom it has already been mentioned, on new firmware - There are no data errors.


Communication with ATTINY13A controller in SOIC8 housing

Compound according to the scheme below. But here everything is a little more interesting.

Since a naked chip in SOIC8 SMD package, in this case I placed it in the SOIC8-DIP8 adapter for convenience of connecting to the programmer in the future. An overview for this adapter can be read.

AVRDEDE PROG 3.3.
Here is selected from the list of the same name controller, the USBASP programmer and, if the programmer flashes the factory chinese firmwareAll operations pass smoothly and smoothly. However, it is worth replacing the programmer to another, with an updated firmware, then an error occurs at any operation.

It appears due to the fact that neither the program nor the programmer can automatically go to the slow programming mode necessary for attiny13. But there are at least two outputs:
1) Iron: Close the jumper Jp3.

2) Software: edit the file "Program.ini" in the folder with the program AVRDEDE PROG 3.3


Make there four code lines and save. (Taken)
PROGISP \u003d JTAG2PDIPORTPROG \u003d COM1PORTENABLED \u003d 1 PROGISP \u003d USBASP -B 3 portprog \u003d USB portenabled \u003d 0

Note. Here the "-B" key is applied, which is engaged in the transfer of the programmer to the reduced frequency of programming. The value "3" - time in microseconds

After that, start the AVRDEDE PROG 3.3 again and select USBaspspeed in the programmer drop-down list. Now work with attiny13 on the programmer with a new firmware will already be without errors, and the jumper JP3 is no longer needed in this case.

Khazama Avr Programmer
The controller is selected from the list and almost the same situation.

The programmer with the factory firmware works normally with attiny13, except for constantly emerging windows with an error, which early has already told.
But with the programmer on the new firmware, another error appears with the inability to read the signature ( digital signature) Controller.

But it is worth closing a jumper Jp3.and you can safely work


Or simply set the frequency of work from the drop-down list on the way "Command" -\u003e "Program Options", I set the frequency of 187.5kHz.

Note. The programming frequency should be less than the clock frequency of the chip flashing at least 4 times. But if you look at the fusion read with attiny13, then on the last line int.rc.osc. Specified 9.6 MHz.
At a minimum, the newcomer will have a question - why on the 1.5 MHz displayed in Khazame - the same error appears? And also why, if in AtmelStudio, you can write an LED flashing code with a frequency of once per second and in the macro to register:
#Define F_CPU 9600000 That downloads the code on the attiny13, the LED will blink very slowly?
- Let's look at the penultimate line where Divide Clock By 8 Internally - This is the included frequency offset, which divides these 9.6 MHz to 8, and therefore the real frequency of the chip here is 1.2 MHz. Therefore, when choosing a frequency of 187.5kHz or less, errors disappear and you can work normally with the controller.

Note 2. The method with a frequency choice in Khazame in the speed of operation several times wins from the method with a physical closure of jumper JP3, because in the latter case the frequency drops to 8 kHz.

Integration of the programmer in Atmel Studio 7

Atmel Studio - development environment from ATMEL, but directly work with USBASP, especially Chinese, it cannot. However, thanks to the same AVRDUDE program, which is part of the AVRDUDE PROG 3.3 package, which will play the role of an intermediary, you can build a "crutch", and already in the environment then add the ability to flash MK connected via USBASP.

First you need to start the environment, it is assumed that some code has already been written and assembled. In my example, this is a simple flasher LED - blink.

On the top toolbar to choose "Tools" - "External Tools ..."

Opens small window, Press "Add"

In the highest field "Title:" Enter any convenient name, I wrote "ATMEGA168", because The configuration that I will give a little below specifically to this controller, and for any other controller it is configured individually.
In the large field at the top, the tool name will be automatically duplicated.

Second line, field "Command:" - Here you need to specify the path to the "AvrDude.exe" file, which is located in the folder with the above program

Third row, field "Arguments:" You must enter the self-configuration itself.

Configuration for ATmega168.

P M168 -C USBASP -P USB -U Flash: W: $ (ProjectDir) Debug \\ $ (targetname) .hex: a
-p - name of the controller
-C - what programmer
-P - the port through which firmware will be poured
-U - What operation with which memory will be produced (in this case, record in Flash)
If you need to configure for another MK, the "M168" parameter must be changed to the appropriate controller that will flash. For example, "M8" for ATMEGA8 or "M328P" if ATMEGA328P. Parameters for other MK see - also there will find the descriptions of the AvrDeDe keys.

Configuration for attiny13


After filling the fields, click "Apply" and "OK". Window closes

Now, if you click on "Tools" again, there will be just created tool there. And by clicking on it, the compiled code will automatically flash in the controller.

But this operation occurs in two clicks, which is not very convenient. It is necessary to take this tool to the main toolbar to be always in sight.
To do this, go to "Tools" again, then click on the Customize ... »
The following window opens:

Go to the "Commands" tab - Press the "Add Command ..." button

Another window will appear. In it - in the left column, select "Tools", and in the right column allocate "EXTERNAL COMMAND 1". Press "OK"

"EXTERNAL COMMAND 1" will be at the top of the list, and, pay attention to the toolbar itself - the "ATMEGA168" point appeared in the interface.

But it seems to me, the place is not entirely successful, it is desirable to move it to the right, for this, the "Move Down" button is pressed (one press \u003d shift to one position to the right). After that, you can close the window along the "Close" button and sew chip directly from the studio into one click through the promined programmer.


When flashing a chip, the AvrDede console window appears for a second. But it may be necessary to somehow save this log to further view it - then in the "External Tools" window you need to check the "USE Output Window".

And now the log will be displayed in the output window, which is at the bottom of the ATMEL Studio program. This daw can be set separately for each controller added to "External Tools".

Addition to fuses programmer

From the Readmi document, which is included with the driver and firmware for USBASP, later it turned out that the developer recommends setting a certain configuration of FUU-bits that determine the operation of an external resonator.
The minus Khazam "It is that the hex values \u200b\u200bof the bits are not displayed in the window with fuses. It can already be viewed in Avrdude Prog. Factory fuses put out the Chinese look like this ( be sure to put the "Inverse" point - allocated a blue rectangle):

It is necessary to remove the two daws with Boden and Sut1 (highlighted in red oval),
Put two tanks on the "ckopt" and "sut0" (highlighted by a green rectangle),
On the right in the column, the hex values \u200b\u200bof the changed bits will be displayed (highlighted in a fat red rectangle): Lock BYTE: 3F., Fuse High Byte: C9., Fuse Low Byte: EF..

If everything converges, you can press "programming"

ATTENTION. Angry FUU-BIT Rstdisbl. - Do not touch in no case, otherwise it will block the controller and flash it later through USBASP it will be impossible.
_____________________________________

conclusions

Tested, works. If Khazam is not planned to be used, then in updating the firmware for the programmer - there is no sense, good and so great works, and in the case of Attiny13, no edit and jumpers are required. Last firmware - For some reason turned out to be more capricious in this regard. The only one, after receiving, the fee must be loosen and washed.

List of links

In this article we will describe "step by step" stages of manufacture USBASP programmer for AVR microcontrollers. In individual articles, we give a description of the installation of drivers for operating windows systems XP and Windows 7 (x64 / x86). At the end of the post there is a reference with the necessary documentation for the manufacture of the USBASP programmer with your own hands.

The USBASP programmer, due to its simplicity in the manufacture and use of inexpensive and widely available elements, has become very popular among radio amateurs. His work parameters are not inferior to professional and expensive AVR microcontrollers.

The main characteristics of the USBASP programmer

  • Works with several operating systems - Linux, Mac OS X and Windows - including Windows 8!
  • Does not require external food.
  • Knows how to program with speed up to 5kb / s
  • There is an option (Switch 2) reduction programming speed - for quartz processors less than 1.5 MHz
  • Provides voltage for programming (Switch 1) 5 volts
  • Specifying the programmer's work using the LED

Before starting work, it is worth familiar with the sequence of all the actions performed, namely:

  1. Selection of scheme / drawing pCB
  2. Transferring PCB drawing on foil fiberglass
  3. Packing PCB in chlorine iron solution
  4. Drilling holes
  5. Installation of elements (soldering)
  6. Programming atmaga8 programmer
  7. Connecting a programmer to a computer
  8. Installing Drivers - Windows XP, Windows 7
  9. USBASP Support Program Selection

There are many versions of the USBASP programmer, but they are all based on the main scheme, the author of which is Thomas Fischl. The firmware of the microcontroller programmer is also its authorship.

Original programmer scheme:

In this case, the original scheme was chosen as the basis. Since the use of jumpers in the original scheme is not entirely convenient, it was decided to use the DIP switches. Some values \u200b\u200bof resistors were also changed.
Moreover, in the original TXD and RXD line diagram, the ISP connector is displayed, although it is not necessary (more precisely is not used in practice).

Below is a scheme with amended:

Construction usbasp programmer

There are many versions of the printed circuit board of this programmer, some can be found on the official USBASP website. However, it was made on the basis of the above scheme.

Unfortunately, due to the use of DIP switches, the card pattern has become a little more difficult, which led to the use of 2 short jumpers, with the aim of the printed circuit board is still one-sided.

Below the result of the printed circuit board:

As can be seen in the figure, SMD elements did not apply in the programmer. Empty space on the "flood" board of the mass of the mass, mainly in order not to etch a large number of copper, as well as reduce the impact of the programmer.

List of elements used in USBASP programmer:

  • R1: 10K.
  • R2: 180.
  • R3: 100.
  • R5, R6: 68
  • R7: 2K2.
  • C1, C2: 22P
  • C3: 10MK
  • C4: 100N
  • LED1: Red LED on 20mA
  • LED2: Green LED on 20mA
  • D2, D3: Stabilians by 3.6V
  • X1: USB connector, type B
  • SV1: Nest under IDC-10 connector
  • Q1: quartz 12mgz, housing HC49-S
  • SW1: Dip switch three-position
  • IC1: ATMEGA8 ( Note: You should not use the ATMEGA8 - PU microcontroller due to its maximum limit clock frequency up to 8 MHz!)

Transferring a USBASP programmer printed circuit board on a fiberglass is made using the LUT () method. How to do this will not be described, because there is a lot of information on the network.

In briefly, let's say that first the pattern on the scale of 1: 1 is printed on glossy paper, then it is superimposed on the cleaned and degreased copper side of the fiberglass and fixed with the help of paper tape. Next, the paper side is carefully smoothed by an iron on a 3-ke. After all this business is soaked in water and neatly cleaned from paper.

The next stage is the etching of the board in the solution of chlorine iron. During etching, it is desirable to maintain a solution temperature not lower than 40 C, so the jar with a solution is immersed in hot water:


After completion of the etching process, it is necessary to remove toner acetone.

It is now only to drill holes. After completing the process of manufacturing the board, you can proceed to the solder of the USBASP programmer elements, starting with the jumpers.

Ready for printing (in pDF format) The pattern of the printed circuit board is at the end of the article. You can also find several options on the official website of the project.

First launch USBASP programmer

Now that all the details are fasting, it remains only to "flash" the Microcontroller atmegęn of the programmer itself. To do this, you need a separate programmer, it may be, for example, STK 200 (LPT port), STK500, etc. LPT programmer connects to USBASP via IDC-10 connector.

Please note that the distribution of pins in the connector of the original programmer (USBASP) is on the right, while in the version described in this article - on the left:

The distribution shown in the figure on the right corresponds to those that ATMEL applies in its original programmers. Such a distribution reduces the risk of interference during programming in the case of the use of long wires from the programmer to the controller, since each signal line is shielded by mass, except MOSI.

On programming time, turn on the SELF mode by switching the DIP switch number 3 to the ON position. Due to this, it is possible to program ATMEGA8. After programming is completed, the switch position (3) must be translated in the OFF state.

The latest version of the firmware can be downloaded from the official site. We recommend a version for ATMEGA8, which is in the archive: USBASP.2011-05-28.tar.gz.

Please note that the ATMEGA8 programming is needed to set fuses that have the following values:

  • # for atmega8: hfuse \u003d 0xc9 lfuse \u003d 0xef
  • # for atmega48: hfuse \u003d 0xdd lfuse \u003d 0xff

In case of successful programming, we connect the programmer to the USB computer connector, while the red LED should turn around, and the computer must notify the discovery of new equipment.

Installing USBASP driver drivers

The method of installing the programmer drivers is described in separate articles, there are also the driver themselves. Below are direct links to these articles:

  • Installing Drivers for USBASP Under Windows XP
  • Installing drivers for USBASP Windows 7 x64 / x86 programmer

USBASP programmer software

The most popular program supporting the USBASP programmer is console program AvrDude. There are also many derived programs, the use of which is much more convenient. They are presented in the article Comparison of programs to support the USBASP programmer.



Did you like the article? Share it