Thread: Being puzzled by the avrdude error

  1. #1
    Registered User
    Join Date
    May 2017
    Posts
    2

    Being puzzled by the avrdude error

    I purchased a "usbasp" programmer from AliExpress for use with my ATtiny84A AVR devices(ATtiny84A - 8-bit AVR Microcontrollers). This has the text "USBASP V2.0 LC Technology" screenprinted on the top of the PCB, and it looks very much like this:

    Being puzzled by the avrdude error-oopzb-jpg

    I have a C232HM (FTDI)(C232HM-DDHSL-0 - FTDI, Future Technology Devices International Ltd - Smart Cables - Kynix Semiconductor) cable that I have been using as an avrdude programmer successfully for some time, so I know my AVR devices are working and that I'm using the right pins on the ATtiny84.


    Unfortunately I have not been successful with this new programmer. After connecting VCC (with jumper J1 set for 5V), GND, MOSI, MISO, SCK and RESET (and triple-checking!), avrdude provides the following error:

    Code:
    $ avrdude -c usbasp -p attiny84 -vvvv 
    
    avrdude: Version 6.3, compiled on Sep 17 2016 at 02:19:28
             Copyright (c) 2000-2005 Brian Dean, http://www.bdmicro.com/
             Copyright (c) 2007-2014 Joerg Wunsch
    
    
             System wide configuration file is "/usr/local/Cellar/avrdude/6.3/etc/avrdude.conf"
             User configuration file is "/Users/me/.avrduderc"
             User configuration file does not exist or is not a regular file, skipping
    
    
             Using Port                    : usb
             Using Programmer              : usbasp
    avrdude: usbasp_open("usb")
    avrdude: seen device from vendor ->www.fischl.de<-
    avrdude: seen product ->USBasp<-
             AVR Part                      : ATtiny84
             Chip Erase delay              : 4500 us
             PAGEL                         : P00
             BS2                           : P00
             RESET disposition             : possible i/o
             RETRY pulse                   : SCK
             serial program mode           : yes
             parallel program mode         : yes
             Timeout                       : 200
             StabDelay                     : 100
             CmdexeDelay                   : 25
             SyncLoops                     : 32
             ByteDelay                     : 0
             PollIndex                     : 3
             PollValue                     : 0x53
             Memory Detail                 :
    
    
                                      Block Poll               Page                       Polled
               Memory Type Mode Delay Size  Indx Paged  Size   Size #Pages MinW  MaxW   ReadBack
               ----------- ---- ----- ----- ---- ------ ------ ---- ------ ----- ----- ---------
               eeprom        65     6     4    0 no        512    4      0  4000  4500 0xff 0xff
                                      Block Poll               Page                       Polled
               Memory Type Mode Delay Size  Indx Paged  Size   Size #Pages MinW  MaxW   ReadBack
               ----------- ---- ----- ----- ---- ------ ------ ---- ------ ----- ----- ---------
               flash         65     6    32    0 yes      8192   64    128  4500  4500 0xff 0xff
                                      Block Poll               Page                       Polled
               Memory Type Mode Delay Size  Indx Paged  Size   Size #Pages MinW  MaxW   ReadBack
               ----------- ---- ----- ----- ---- ------ ------ ---- ------ ----- ----- ---------
               signature      0     0     0    0 no          3    0      0     0     0 0x00 0x00
                                      Block Poll               Page                       Polled
               Memory Type Mode Delay Size  Indx Paged  Size   Size #Pages MinW  MaxW   ReadBack
               ----------- ---- ----- ----- ---- ------ ------ ---- ------ ----- ----- ---------
               lock           0     0     0    0 no          1    0      0  9000  9000 0x00 0x00
                                      Block Poll               Page                       Polled
               Memory Type Mode Delay Size  Indx Paged  Size   Size #Pages MinW  MaxW   ReadBack
               ----------- ---- ----- ----- ---- ------ ------ ---- ------ ----- ----- ---------
               lfuse          0     0     0    0 no          1    0      0  9000  9000 0x00 0x00
                                      Block Poll               Page                       Polled
               Memory Type Mode Delay Size  Indx Paged  Size   Size #Pages MinW  MaxW   ReadBack
               ----------- ---- ----- ----- ---- ------ ------ ---- ------ ----- ----- ---------
               hfuse          0     0     0    0 no          1    0      0  9000  9000 0x00 0x00
                                      Block Poll               Page                       Polled
               Memory Type Mode Delay Size  Indx Paged  Size   Size #Pages MinW  MaxW   ReadBack
               ----------- ---- ----- ----- ---- ------ ------ ---- ------ ----- ----- ---------
               efuse          0     0     0    0 no          1    0      0  9000  9000 0x00 0x00
                                      Block Poll               Page                       Polled
               Memory Type Mode Delay Size  Indx Paged  Size   Size #Pages MinW  MaxW   ReadBack
               ----------- ---- ----- ----- ---- ------ ------ ---- ------ ----- ----- ---------
               calibration    0     0     0    0 no          1    0      0     0     0 0x00 0x00
    
    
             Programmer Type : usbasp
             Description     : USBasp, http://www.fischl.de/usbasp/
    
    
    avrdude: usbasp_initialize()
    avrdude: usbasp_transmit("USBASP_FUNC_GETCAPABILITIES", 0x00, 0x00, 0x00, 0x00)
    avrdude: usbasp_spi_set_sck_period(0)
    avrdude: auto set sck period (because given equals null)
    avrdude: usbasp_transmit("USBASP_FUNC_SETISPSCK", 0x00, 0x00, 0x00, 0x00)
    avrdude: warning: cannot set sck period. please check for usbasp firmware update.
    avrdude: usbasp_transmit("USBASP_FUNC_CONNECT", 0x00, 0x00, 0x00, 0x00)
    avrdude: usbasp_program_enable()
    avrdude: usbasp_transmit("USBASP_FUNC_ENABLEPROG", 0x00, 0x00, 0x00, 0x00)
             <= [01] 
    avrdude: error: program enable: target doesn't answer. 1 
    avrdude: initialization failed, rc=-1
             Double check connections and try again, or use -F to override
             this check.
    
    
    avrdude: usbasp_close()
    avrdude: usbasp_transmit("USBASP_FUNC_DISCONNECT", 0x00, 0x00, 0x00, 0x00)
    
    
    avrdude done.  Thank you.
    It doesn't work with an external 5V supply (J1 removed), or with J1 set for 3.3V either.


    With my scope, I can see that the clock is running at about 92.6 kHz, but the MISO and MOSI signals are very low in amplitude - about 1.1V for MISO and 0.8V for MOSI. These voltages seem a bit low to me:

    Being puzzled by the avrdude error-9ow2b-png

    I read that J3 can be used to set the programmer to "slow" mode (note that the ATtiny84 I'm currently trying to program is already running at 8 MHz from internal oscillator). However when adding J3, I don't see any change to the clock rate - it still runs at about 92.6 kHz.


    From what I've read, the "Chinese" usbasp programmers tend to ship with some version of the software that enables clock speed detection. I'm not sure whether this translates to support for the "-B" option though, because no matter what -B value I provide, the scope shows the clock still running at 92.6 kHz.


    I have made sure there's no other circuitry interfering with the programmer. I've also tried a second, "fresh" ATtiny84 (so fuses still set for 1MHz) with no success either. Yet the C232HM programmer works fine.


    So nothing I've read seems to correlate with what I'm seeing with my device. I'm wondering if those MOSI/MISO voltages are too low (and why) and I'm also puzzled as to why neither J3 nor -B seems to affect the clock rate.


    What could be wrong? What else can I investigate?

  2. #2
    and the hat of int overfl Salem's Avatar
    Join Date
    Aug 2001
    Location
    The edge of the known universe
    Posts
    39,660
    I suppose the first question would be what voltages you see on your reference programmer that works.
    If you dance barefoot on the broken glass of undefined behaviour, you've got to expect the occasional cut.
    If at first you don't succeed, try writing your phone number on the exam paper.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Puzzled.
    By silhoutte75 in forum C Programming
    Replies: 13
    Last Post: 01-21-2008, 05:17 PM
  2. Puzzled
    By ninja101 in forum C++ Programming
    Replies: 6
    Last Post: 12-02-2007, 09:29 AM
  3. Puzzled
    By fkheng in forum C Programming
    Replies: 5
    Last Post: 06-22-2003, 09:56 PM
  4. Puzzled
    By sketchit in forum C Programming
    Replies: 3
    Last Post: 10-30-2001, 08:11 PM
  5. Still puzzled
    By sketchit in forum C Programming
    Replies: 1
    Last Post: 09-27-2001, 05:09 PM

Tags for this Thread