|
AVR_ISP_Programmer
AVR ISP Programmer (AVRdude-compatible)
Deprecated This firmware has been replaced by USBVirtualSerial_AVRISP which is an updated version of this firmware and twice as fast. IntroductionThe relevant source code for this firmware can be found in the older AVRopendous-2009-02-10b.zip release in the /AVRopendous/Firmware/AVRISPProgrammer directory. Firmware loading instructions are available if you do not want to bother compiling. The .hex files are in the above mentioned directory. There is also an .inf driver installation file for Windows users. See ISPProgrammingAnAVRopendous for more instructions on programming one AVRopendous board with another. Useful if you want to update the bootloader.
This firmware allows the AVRopendous to be used as an AVR ISP Programmer. It should work with any target AVR that is "In-System Programmable via SPI Port". It is based on Atmel's AVR910 low cost and Open Source programmer. This firmware has been tested on the AT90USB162, AT90USB1287, ATtiny24, ATtiny261, ATmega644 and ATmega2560 AVRs for programming and verifying Flash memory with AVRdude. UsageNote that as with USBtoSerialSPI firmware which this is based off of, you can change SPI settings by altering the serial port configuration. Changing "Baud-Rate" will change the SPI speed. Each step up in baud-rate will HALVE the clock speed: 19200 = 125kHz (Default in AVRdude), 9600 = 2Mhz (Default), 14400 = 1MHz, 38400 = 250kHz, 57600 = 500kHz, 115200 = 62.5kHz . However, not all AVRs support speeds greater than 125kHz. ConnectionsThe picture at the top of this page shows how an AVRopendous board is connected to an ATtiny261 AVR. Any of the AVRopendous boards can be used, as they all have their SPI pins on PortB. It is recommended you use 200-Ohm series resistors on all the signal lines. The connections are as follows:
Windows InstallationAfter programming the firmware (which can be found in the /AVRopendous/Firmware/AVRISP_Programmer directory), RESET your AVRopendous. On Windows, you will need to install drivers. You may need to be logged in as Administrator to do this. The /AVRopendous/Firmware/AVRISP_Programmer directory contains the firmware specific .inf file for the AVRISP_Programmer firmware. For more instruction on installing Windows Drivers, see USBtoSerial (which this firmware is based on). After plugging in the board, Windows' driver installation should begin. If it does not, you need to log in as Administrator to install the device.
You will want to install from a specific location:
The .inf file can be found in the /AVRopendous/Firmware/AVRISP_Programmer directory.
Linux InstallationCreate a udev rule to allow access to the USBtoSerial-AVRISP_Programmer device without being root: sudo gedit /etc/udev/rules.d/99-usbtoserial.rules and add the following: SUBSYSTEM=="usb", ACTION=="add", SYSFS{idVendor}=="03eb", SYSFS{idProduct}=="2044", MODE="660", GROUP="plugdev"
BUS=="usb", ACTION=="add", SYSFS{idVendor}=="03eb", SYSFS{idProduct}=="2044", MODE="660", GROUP="plugdev"The above should be the only contents in the file. All LUFA-based USBtoSerial-? firmware examples use the same USB VID and PID, so this one udev rule will work for all hardware loaded with USBtoSerial-? firmware. Determining Serial PortUnder Linux, run dmesg after plugging/resetting your AVRopendous board which has this firmware loaded. Look for something like cdc_acm 2-1:1.0: ttyACM0: USB ACM device. If the commands below are not working for you, try setting the Serial Port's speed: sudo stty -F /dev/ttyACM0 38400. Under Windows, find out where the AVRopendous AVR_ISP_Programmer device enumerated to by right-clicking on My Computer, then click Properties, then the Hardware tab, then Device Manager, then find USB Virtual Serial Port under "Ports (COM & LPT)". Note that on this system it has enumerated as COM7.
AVRdudeTesting Connectionavrdude -vv -F -P COM7 -c avr910 -p t261 on Windows avrdude -vv -F -P /dev/ttyACM0 -c avr910 -p t261 on Linux The -vv option outputs verbose error messages. -F ignores the target AVR's signature byte so as not to limit programming to the AVR910 programmer's internal list of target MCUs. Any MCU which AVRdude supports for ISP programming should be programmable. -P COM7 under Windows and -P /dev/ttyACM0 determine which port the programmer is connected to. See above for more information on determining serial port. -c avr910 selects programmer type and -p t261 selects target AVR type. For a list of target AVRs, mangle the -p t261, for example -p asdf. You should get output such as: avrdude: warning: selected device is not supported by programmer: t261 avrdude: AVR device initialized and ready to accept instructions Reading | ################################################## | 100% 0.00s avrdude: Device signature = 0x1e910c avrdude: safemode: lfuse reads as 62 avrdude: safemode: hfuse reads as DF avrdude: safemode: efuse reads as 1 avrdude: safemode: lfuse reads as 62 avrdude: safemode: hfuse reads as DF avrdude: safemode: efuse reads as 1 avrdude: safemode: Fuses OK avrdude done. Thank you. Remember to RESET the device after each programming session. Programming Flash Memoryavrdude -vv -F -P COM7 -c avr910 -p t261 -U flash:w:YOURPROG.hex on Windows avrdude -vv -F -P /dev/ttyACM0 -c avr910 -p t261 -U flash:w:YOURPROG.hex on Linux The -U command is the universal read/write/verify command and several can be chained. In this case flash:w:YOURPROG.hex will program the target ATtiny261 AVR with the YOURPROG.hex file and verify it automatically. You should get output such as: avrdude: warning: selected device is not supported by programmer: t261
avrdude: AVR device initialized and ready to accept instructions
Reading | ################################################## | 100% 0.00s
avrdude: Device signature = 0x1e910c
avrdude: safemode: lfuse reads as 62
avrdude: safemode: hfuse reads as DF
avrdude: safemode: efuse reads as 1
avrdude: NOTE: FLASH memory has been specified, an erase cycle will be performed
To disable this feature, specify the -D option.
avrdude: erasing chip
avrdude: reading input file "YOURPROG.hex"
avrdude: input file YOURPROG.hex auto detected as Intel Hex
avrdude: writing flash (1408 bytes):
Writing | ################################################## | 100% 25.02s
avrdude: 1408 bytes of flash written
avrdude: verifying flash memory against YOURPROG.hex:
avrdude: load data flash data from input file YOURPROG.hex:
avrdude: input file YOURPROG.hex auto detected as Intel Hex
avrdude: input file YOURPROG.hex contains 1408 bytes
avrdude: reading on-chip flash data:
Reading | ################################################## | 100% 1.43s
avrdude: verifying ...
avrdude: 1408 bytes of flash verified
avrdude: safemode: lfuse reads as 62
avrdude: safemode: hfuse reads as DF
avrdude: safemode: efuse reads as 1
avrdude: safemode: Fuses OK
avrdude done. Thank you.Remember to RESET the device after each programming session. User Usage ExampleCasainho put an AVRopendous programmed with AVRISP firmware into a MKII case and added 200 Ohm series resistors and an IDC cable to create the equivalent of a MKI AVR ISP Programmer. He was able to program an ATtiny24 AVR running at 2V Vcc with the AVRopendous set to 3.3V Vcc.
| ||||||||||||||