Updating the firmware of an avrusb500-key kit programmer

Overview

Atmel has as of avrstudio 6 withdrawn the support for the avrisp_2 type of programmer. This affects Atmel's own customers who had and original programmer from Atmel and people who had been using the avrusb500 from tuxgraphics. The "avrusb500-key kit" version can be updated to avrusb500v2-1.5. The problem is solved in that version by emulating now a different programmer type (STK500_2). You know that you have a problem with the avrstudio compatibility if you get the error "The signature of the attached tool is AVRISP_2, which is unexpected". STK500_2 and AVRISP_2 are essentially the same except that STK500_2 has to emulate an additional oscillator and a topcard daughter board.

Instead of updating the programmer firmware you may as well consider to use avrdude instead of the programming button in avrstudio 6. There is a way of installing a drag and drop button for avrdude under windows.

To update the firmware you will need a suitable linux system such as systemrescuecd-x86-2.8.1.iso (from http://www.sysresccd.org, available for download at http://images.tuxgraphics.org/iso/sysresccd.org/ ).

Updating the firmware

  1. Download the avrusb500v2-1.5.tar.gz package from http://tuxgraphics.org/common/src2/article07052/ and save it on a USB key

  2. Make a CD from the iso image systemrescuecd-x86-2.8.1.iso and boot on it

  3. Wait until the system has fully booted and then insert your USB key with the avrusb500v2-1.5.tar.gz software.

  4. Type "dmesg | tail -25" to see the name of the disk that the USB key is connected to (sda1, sdb1, sdc1,...)

    root@sysresccd /root % dmesg | tail -25
    [   88.429682] ftdi_sio: v1.6.0:USB FTDI Serial Converters Driver
    [  113.499043] usb 2-1.2: new high-speed USB device number 4 using ehci_hcd
    [  113.589441] usb 2-1.2: New USB device found, idVendor=13fe, idProduct=3600
    [  113.589451] usb 2-1.2: New USB device strings: Mfr=1, Product=2, SerialNumber=3
    [  113.589457] usb 2-1.2: Product: USB DISK Pro
    [  113.589462] usb 2-1.2: Manufacturer:
    [  113.589466] usb 2-1.2: SerialNumber: 90B70500E94F10E8
    [  115.402609] Initializing USB Mass Storage driver...
    [  115.402805] usb-storage 2-1.2:1.0: Quirks match for vid 13fe pid 3600: 4000
    [  115.402861] scsi6 : usb-storage 2-1.2:1.0
    [  115.403145] usbcore: registered new interface driver usb-storage
    [  115.403154] USB Mass Storage support registered.
    [  116.426626] scsi 6:0:0:0: Direct-Access              USB DISK Pro     PMAP PQ: 0 ANSI: 0 CCS
    [  116.428685] sd 6:0:0:0: Attached scsi generic sg2 type 0
    [  117.167611] sd 6:0:0:0: [sdb] 7831552 512-byte logical blocks: (4.00 GB/3.73 GiB)
    [  117.168857] sd 6:0:0:0: [sdb] Write Protect is off
    [  117.168867] sd 6:0:0:0: [sdb] Mode Sense: 23 00 00 00
    [  117.170074] sd 6:0:0:0: [sdb] No Caching mode page present
    [  117.170080] sd 6:0:0:0: [sdb] Assuming drive cache: write through
    [  117.175213] sd 6:0:0:0: [sdb] No Caching mode page present
    [  117.175222] sd 6:0:0:0: [sdb] Assuming drive cache: write through
    [  117.191274]  sdb: sdb1
    [  117.195893] sd 6:0:0:0: [sdb] No Caching mode page present
    [  117.195903] sd 6:0:0:0: [sdb] Assuming drive cache: write through
    [  117.195910] sd 6:0:0:0: [sdb] Attached SCSI removable disk
    #
    

    The disk (or device) is in the above example sdb1

  5. Make a mount-point and mount the usb key:
    mkdir /mnt/usbka
    mount /dev/sdb1 /mnt/usbka
    Copy the avrusb500v2-1.5.tar.gz file from the usb key to /root:
    cp /mnt/usbka/avrusb/avrusb500v2-1.5.tar.gz /root
    Un-mount the usb key and then take it out:
    umount /mnt/usbka

  6. Un-pack avrusb500v2-1.5.tar.gz:
    cd /root
    tar zxvf avrusb500v2-1.5.tar.gz
    Go into the directory that was created while unpacking:
    cd avrusb500v2-1.5

  7. Insert the avrusb500 key in the usb port of your computer and insert a wire bridge in the avrusb500 key to enable flashing of the firmware:


  8. Test that flashing would work by checking if the fuses can be read (command make rdfuse):
    root@sysresccd /root/avrusb500v2-1.5 make rdfuse
    ./bin/uisp_bbpg -dprog=bbpg --rd_fuses -dt_sck=1000
    OK: bitbang mode on
    NOTE: bbpg is a bit slow. Be patient....
    Atmel AVR ATmega8 is found.
    
    Fuse Low Byte      = 0xae
    Fuse High Byte     = 0xc9
    Fuse Extended Byte = 0xff
    Calibration Byte   = 0xa9  --  Read Only
    Lock Bits          = 0xff
        BLB12 -> 1
        BLB11 -> 1
        BLB02 -> 1
        BLB01 -> 1
          LB2 -> 1
          LB1 -> 1
    
    disabling bitbang mode...
    For correct operation of the avrusb500 v2 the fuses should be set
    as follows. Please compare them with the above readings from your
    atmega8:
    Low Byte      = 0xae (factory default=0xe1)
    High Byte     = 0xc9 (factory default=0xd9)
    Extended Byte = 0xff (default)
    Lock Bits     = 0xff (default)
    #
    


  9. Flash the firmware (command make load_pre takes about 30min):
    root@sysresccd /root/avrusb500v2-1.5 make load_pre
    ./bin/uisp_bbpg --erase  -dprog=bbpg -v=3
    OK: bitbang mode on
    NOTE: bbpg is a bit slow. Be patient....
    SCK Delay (t_sck): 50
    Reset inactive time (t_reset) 1000 us
    AVR Direct Parallel Access succeeded after 31 retries.
    Vendor Code: 0x1e
    Part Family: 0x93
    Part Number: 0x07
    Atmel AVR ATmega8 is found.
    Page Write Enabled, size=64
    FLASH Write Delay (t_wd_flash): 12500 us
    EEPROM Write Delay (t_wd_eeprom): 25000 us
    Erasing device ...
    Reinitializing device
    AVR Direct Parallel Access succeeded after 31 retries.
    Vendor Code: 0x1e
    Part Family: 0x93
    Part Number: 0x07
    Atmel AVR ATmega8 is found.
    Page Write Enabled, size=64
    FLASH Write Delay (t_wd_flash): 12500 us
    EEPROM Write Delay (t_wd_eeprom): 25000 us
    disabling bitbang mode...
    ./bin/uisp_bbpg --upload if=avrusb500_pre.hex -dprog=bbpg -v=3 --hash=8 --verify -dno-poll -dt_sck=1000
    OK: bitbang mode on
    NOTE: bbpg is a bit slow. Be patient....
    SCK Delay (t_sck): 1000
    Reset inactive time (t_reset) 1000 us
    AVR Direct Parallel Access succeeded after 31 retries.
    Vendor Code: 0x1e
    Part Family: 0x93
    Part Number: 0x07
    Atmel AVR ATmega8 is found.
    Page Write Enabled, size=64
    FLASH Write Delay (t_wd_flash): 12500 us
    EEPROM Write Delay (t_wd_eeprom): 25000 us
    Uploading: flash
    ###############################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################
    (total 4720 bytes transferred in 715.27 s (7 bytes/s)
    Verifying: flash
    ###############################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################
    (total 4720 bytes transferred in 703.15 s (7 bytes/s)
    disabling bitbang mode...
    echo "OK: set high fuse to 0xc9 (full swing cryst)..."
    OK: set high fuse to 0xc9 (full swing cryst)...
    ./bin/uisp_bbpg -dprog=bbpg --wr_fuse_h=0xc9
    OK: bitbang mode on
    NOTE: bbpg is a bit slow. Be patient....
    Atmel AVR ATmega8 is found.
    
    Fuse High Byte set to 0xc9
    disabling bitbang mode...
    echo "OK: set lower fuse to 0xAE (external crystal and BOD on atmega8)..."
    OK: set lower fuse to 0xAE (external crystal and BOD on atmega8)...
    ./bin/uisp_bbpg -dprog=bbpg --wr_fuse_l=0xae
    OK: bitbang mode on
    NOTE: bbpg is a bit slow. Be patient....
    Atmel AVR ATmega8 is found.
    
    Fuse Low Byte set to 0xae
    disabling bitbang mode...
    Please disconnect the usb cable and re-connect again
    #
    


  10. That's it. Take the avrusb500 key out and remove the wire bridge. Reboot your PC.


© Guido Socher, version 2012-08-26