OpenOCD USB JTAG Adapter as AVR ISP Adapter
With avrdude an OpenOCD ARM JTAG adapter can be used as a programming adapter for AVR microcontrollers. The OpenOCD adapters internally use a FTDI FT2232 chip. Avrdude is used as the programming tool.
Pinout
On my OpenOCD USB JTAG adapter, the pins are occupied as follows:
ARM JTAG Adapter (20 pol) Pin | ARM JTAG Adapter (20 pol)Signal | FT232 Pin | FT232 Signal | AVR ISP (6 pol) Pin | AVR ISP (6 pol) Signal |
---|---|---|---|---|---|
4 | GND | 6 | GND | ||
5 | TDI | 23 | ADBUS1 | 4 | MOSI |
7 | TMS | 21 | ADBUS3 | 5 | RST |
9 | TCK | 24 | ADBUS0 | 3 | SCK |
13 | TDO | 22 | ADBUS2 | 1 | MISO |
You have to make an adapter cable based on the pin assignment and can then program the microcontroller with avrdude.
Flash AVR with avrdude
avrdude supports programming adapters with FTDI FT2232 chips directly. The avrdude programmer type is avrftdi. The OpenOCD USB Adapter is registered as a serial interface (/dev/ttyUSB0). The serial port must be passed as a parameter to avrdude.
Example:
sudo avrdude -B 100 -p m2560 -P /dev/ttyUSB0 -c avrftdi -U flash:w:test.hex