AVRProgrammers: Unterschied zwischen den Versionen

aus Metalab Wiki, dem offenen Zentrum für meta-disziplinäre Magier und technisch-kreative Enthusiasten.
Zur Navigation springenZur Suche springen
(Die Seite wurde neu angelegt: = WTF? = We have a small selection of AVR programmers lying around. This is an attempt to document how to use them. = General information == == 10-pin ISP header pin...)
 
 
(27 dazwischenliegende Versionen von 3 Benutzern werden nicht angezeigt)
Zeile 4: Zeile 4:
 
This is an attempt to document how to use them.
 
This is an attempt to document how to use them.
  
= General information ==
+
= General information =
  
 
== 10-pin ISP header pinout ==
 
== 10-pin ISP header pinout ==
Zeile 15: Zeile 15:
 
|3  ||N/C  
 
|3  ||N/C  
 
|-
 
|-
|4  ||TX  
+
|4  ||TX or GND
 
|-
 
|-
 
|5  ||CS  
 
|5  ||CS  
 
|-
 
|-
|6  ||RX  
+
|6  ||RX or GND
 
|-
 
|-
 
|7  ||SCK  
 
|7  ||SCK  
Zeile 53: Zeile 53:
  
 
== RS-232 programmer (ATtiny2313) ==
 
== RS-232 programmer (ATtiny2313) ==
 +
 +
[[Bild:avrprog-rs232.jpg|thumb|200px|RS-232 (ATTiny2313) programmer]]
  
 
This programmer has a DB-9 serial port in one end and a 10-pin ISP header in the other end.
 
This programmer has a DB-9 serial port in one end and a 10-pin ISP header in the other end.
  
Programmer type: avr910 ?
+
Programmer type: avr910<br/>
Speed: 19200?
+
Speed: 115200
  
avrdude command lines:
+
'''NB!''' This programmer uses non-standard device codes for atmega48/88/168 (0x06, 0x07 and 0x08).<br/>
  avrdude -c avr910 -p atmega168
+
To make it work, edit avrdude.conf:
 +
part
 +
    id              = "m168";
 +
    avr910_devcode =  0x08;
 +
 
 +
Note: This programmer requires the target to be self-powered.
 +
 
 +
=== avrdude command lines ===
 +
 
 +
Check connection:
 +
  avrdude -P <serialport> -c avr910 -b 115200 -p atmega168
  
 
== USBasp programmer (stripboard) ==
 
== USBasp programmer (stripboard) ==
 +
 +
[[Bild:avrprog-usbasp.jpg|thumb|200px|USBasp stripboard programmer]]
  
 
This is a USB programmer built on a stripboard. It has a USB-B connector in one end an a 10-pin ISP header in the other end.
 
This is a USB programmer built on a stripboard. It has a USB-B connector in one end an a 10-pin ISP header in the other end.
  
Programmer type: usbasp
+
Programmer type: usbasp<br/>
 
Speed: default
 
Speed: default
  
avrdude command lines:
+
=== avrdude command lines ===
 +
Check connection:
 
  avrdude -c usbasp -p atmega168
 
  avrdude -c usbasp -p atmega168
 +
 +
Example: Program Arduino NG bootloader:
 
  avrdude -c usbasp -p atmega168 -e -u -U lock:w:0x3f:m -U efuse:w:0x00:m -U hfuse:w:0xdf:m -U lfuse:w:0xff:m
 
  avrdude -c usbasp -p atmega168 -e -u -U lock:w:0x3f:m -U efuse:w:0x00:m -U hfuse:w:0xdf:m -U lfuse:w:0xff:m
 
  avrdude -c usbasp -p atmega168 -U flash:w:ATmegaBOOT_168_ng.hex:i -U lock:w:0x0f:m
 
  avrdude -c usbasp -p atmega168 -U flash:w:ATmegaBOOT_168_ng.hex:i -U lock:w:0x0f:m
  
== [[AVRProg-metaboard]] ==
+
== [[Avrprog-metaboard]] ==
 +
 
 +
[[Bild:avrprog-metaboard.jpg|thumb|200px|Metaboard AVRprog programmer]]
  
 
A [[Metaboard]]-based programmer.
 
A [[Metaboard]]-based programmer.
  
Programmer type: usbasp
+
This programmer behaves exactly like the USBasp stripboard programmer.
Speed: default?
+
 
 +
In the current incarnation, this programmer is not as stable as the USBasp version.
 +
We need to figure this out, e.g. ask [[User:cs|Christian]] for advice.
 +
Symptoms are aborted operation during read or write. Usually it helps to try again and to run verify as a separate step.
 +
avrdude: error: wrong reading bytes b8
 +
 
 +
Note: This programmer has a bootloader on it, so it can be updated over USB. There is a jumper to enable the bootloader. This jumper must be '''off''' when using it as a programmer and '''on''' when accessing the bootloader.
 +
 
 +
== [http://www.ladyada.net/make/usbtinyisp USBTinyISP] ==
 +
 
 +
The USBTinyISP from Lady Ada.
 +
FIXME: Safe vs. unsafe
 +
 
 +
Check connection:
 +
avrdude -c usbtiny -p atmega168
 +
 
 +
 
 +
== Any Arduino Board ==
 +
 
 +
see [[Benutzer:Mihi/Programming-attiny45-mit-arduino]]
 +
 
 +
= Troubleshooting =
 +
 
 +
Sometimes, the following happens:
 +
<tt>
 +
avrdude: erasing chip<br/>
 +
avrdude: error: programm enable: target doesn't answer. 1
 +
</tt>
 +
 
 +
This has shown to be caused by wrong crystal fuse settings, typically an issue when programming fresh chips.
 +
To fix, program all fuses first, before erasing the chip.
  
avrdude command lines:
 
avrdude -c usbasp -p atmega168
 
  
[[Kategorie:WhateverLab]]
 
 
[[Kategorie:Arduino]]
 
[[Kategorie:Arduino]]

Aktuelle Version vom 21. Januar 2013, 22:26 Uhr

WTF?

We have a small selection of AVR programmers lying around. This is an attempt to document how to use them.

General information

10-pin ISP header pinout

1 MOSI
2 Vcc
3 N/C
4 TX or GND
5 CS
6 RX or GND
7 SCK
8 GND
9 MISO
10 GND

6-pin ISP header pinoout

Note that some boards have a non-standard pinout for the 6-pin headers.

1 MISO
2 Vcc
3 SCK
4 MOSI
5 CS/RST
6 GND

Programmers

RS-232 programmer (ATtiny2313)

RS-232 (ATTiny2313) programmer

This programmer has a DB-9 serial port in one end and a 10-pin ISP header in the other end.

Programmer type: avr910
Speed: 115200

NB! This programmer uses non-standard device codes for atmega48/88/168 (0x06, 0x07 and 0x08).
To make it work, edit avrdude.conf:

part
    id              = "m168";
    avr910_devcode =  0x08;

Note: This programmer requires the target to be self-powered.

avrdude command lines

Check connection:

avrdude -P <serialport> -c avr910 -b 115200 -p atmega168

USBasp programmer (stripboard)

USBasp stripboard programmer

This is a USB programmer built on a stripboard. It has a USB-B connector in one end an a 10-pin ISP header in the other end.

Programmer type: usbasp
Speed: default

avrdude command lines

Check connection:

avrdude -c usbasp -p atmega168

Example: Program Arduino NG bootloader:

avrdude -c usbasp -p atmega168 -e -u -U lock:w:0x3f:m -U efuse:w:0x00:m -U hfuse:w:0xdf:m -U lfuse:w:0xff:m
avrdude -c usbasp -p atmega168 -U flash:w:ATmegaBOOT_168_ng.hex:i -U lock:w:0x0f:m

Avrprog-metaboard

Metaboard AVRprog programmer

A Metaboard-based programmer.

This programmer behaves exactly like the USBasp stripboard programmer.

In the current incarnation, this programmer is not as stable as the USBasp version. We need to figure this out, e.g. ask Christian for advice. Symptoms are aborted operation during read or write. Usually it helps to try again and to run verify as a separate step.

avrdude: error: wrong reading bytes b8

Note: This programmer has a bootloader on it, so it can be updated over USB. There is a jumper to enable the bootloader. This jumper must be off when using it as a programmer and on when accessing the bootloader.

USBTinyISP

The USBTinyISP from Lady Ada. FIXME: Safe vs. unsafe

Check connection:

avrdude -c usbtiny -p atmega168


Any Arduino Board

see Benutzer:Mihi/Programming-attiny45-mit-arduino

Troubleshooting

Sometimes, the following happens: avrdude: erasing chip
avrdude: error: programm enable: target doesn't answer. 1

This has shown to be caused by wrong crystal fuse settings, typically an issue when programming fresh chips. To fix, program all fuses first, before erasing the chip.