problem to burn bootloader using usbtinyisp [solved]

I got a usbtinyISP, a breadboard and a blank ATMEGA328P-PN The driver for usbtinyISP is installed , it's connected to USB and visible as a device called USBtiny. And it's power led is on. I wired a little adapter to get Vcc, GND, MOSI, RESET, SCK and MISO from the ISP to the atmega. ( Just to control the correct plug orientation, I add a led+resistor to verify Vcc and GND ) According to nick's forum http://www.gammon.com.au/forum/?id=11637, I connected the signals to the atmega chip, which I want to run with the internal 8MHz ( no crystal ) Then I chose in Arduino IDE (1.0) Tools Board: LilyPad /w 328 Programmer: USBTinyISP and started Burn bootloader Verbose output gives this :

avrdude: Version 5.11, compiled on Sep  2 2011 at 19:38:36
         Copyright (c) 2000-2005 Brian Dean, http://www.bdmicro.com/
         Copyright (c) 2007-2009 Joerg Wunsch

         System wide configuration file is "C:\Program Files (x86)\arduino-1.0\hardware/tools/avr/etc/avrdude.conf"

         Using Port                    : lpt1
         Using Programmer              : usbtiny
avrdude: usbdev_open(): Found USBtinyISP, bus:device: bus-0:\\.\libusb0-0001--0x1781-0x0c9f
         AVR Part                      : ATMEGA328P
         Chip Erase delay              : 9000 us
         PAGEL                         : PD7
         BS2                           : PC2
         RESET disposition             : dedicated
         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    20     4    0 no       1024    4      0  3600  3600 0xff 0xff
                                  Block Poll               Page                       Polled
           Memory Type Mode Delay Size  Indx Paged  Size   Size #Pages MinW  MaxW   ReadBack
           ----------- ---- ----- ----- ---- ------ ------ ---- ------ ----- ----- ---------
           flash         65     6   128    0 yes     32768  128    256  4500  4500 0xff 0xff
                                  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  4500  4500 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  4500  4500 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  4500  4500 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  4500  4500 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
                                  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

         Programmer Type : USBtiny
         Description     : USBtiny simple USB programmer, http://www.ladyada.net/make/usbtinyisp/
avrdude: programmer operation not supported

avrdude: Using SCK period of 10 usec
CMD: [ac 53 00 00] [00 00 00 00]
CMD: [ac 53 00 00] [00 00 00 00]
avrdude: initialization failed, rc=-1
         Double check connections and try again, or use -F to override
         this check.


avrdude done.  Thank you.

What does "avrdude: programmer operation not supported" mean ? Why is the signature all 0 ? Is there sth. wrong with the chip?

Does your programmer supply power through the ISP connector to the device being programmerd? My AVRISP MKII does not, and I get similar message unless I also wire up power to the device in addition to the ISP connections.

The programmer has a jumper, which controls whether the USB 5V are “exported” to the Vcc Signal. I leave it in that default “export” setting.
I see those 5.09 V on the breadboard ( hava a contol led there, as described above ) and feed it to both pin 7 and pin 20 of my ATMEGA 328
(It drops to 5.07 V then, according to my meter). Add: I also connected GND to both 8 and 22, a pullup res. + Reset to Pin 1, and the 3 signal lines

I read these 5V are limited to 100mA . Is that too little for burning a bootloader (or writing to flash mem in general) ?
I read there’s a way to change that limit to allow the full 500mA, which USB is supposed to provide.
Did not find out how to, yet. Is that required ?
Very strange, if yes: (What’s the reason for having that supply option at all, if it does not work for the default use case of a programmer ?)

Thanks for your feedback so far, btw.

I rechecked the wiring of my 10pin cable between usbtiny and atmega chip and I hope this is correct:

atmega       usbtiny         atmega
pin                          pins
17    MOSI    1   2    +5V   7, 20
              3
 1   RESET    5
19     SCK    7
18    MISO    9  10    GND   8, 22

Then I got a standalone WinAVR-20100110-install.exe and ran this avrdude cmd, to simply read the signature:

C:\WinAVR-20100110\bin>avrdude -p m328p -c usbtiny -v -n -F -U signature:r:mysig.txt:h

avrdude: Version 5.10, compiled on Jan 19 2010 at 10:45:23
         Copyright (c) 2000-2005 Brian Dean, http://www.bdmicro.com/
         Copyright (c) 2007-2009 Joerg Wunsch

         System wide configuration file is "C:\WinAVR-20100110\bin\avrdude.conf"

         Using Port                    : lpt1
         Using Programmer              : usbtiny
         AVR Part                      : ATMEGA328P
         Chip Erase delay              : 9000 us
         PAGEL                         : PD7
         BS2                           : PC2
         RESET disposition             : dedicated
         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     5     4    0 no       1024    4      0  3600  3600 0xff 0xff
           flash         65     6   128    0 yes     32768  128    256  4500  4500 0xff 0xff
           lfuse          0     0     0    0 no          1    0      0  4500  4500 0x00 0x00
           hfuse          0     0     0    0 no          1    0      0  4500  4500 0x00 0x00
           efuse          0     0     0    0 no          1    0      0  4500  4500 0x00 0x00
           lock           0     0     0    0 no          1    0      0  4500  4500 0x00 0x00
           calibration    0     0     0    0 no          1    0      0     0     0 0x00 0x00
           signature      0     0     0    0 no          3    0      0     0     0 0x00 0x00

         Programmer Type : USBtiny
         Description     : USBtiny simple USB programmer, http://www.ladyada.net/make/usbtinyisp/
avrdude: programmer operation not supported

avrdude: Using SCK period of 10 usec
avrdude: initialization failed, rc=-1
avrdude: AVR device initialized and ready to accept instructions
avrdude: Device signature = 0x000000
avrdude: Yikes!  Invalid device signature.
avrdude: Expected signature for ATMEGA328P is 1E 95 0F

avrdude done.  Thank you.

programmer operation not supported Is this the root cause ? What does this mean ? avrdude: initialization failed, rc=-1 This is certainly bad ! avrdude: AVR device initialized and ready to accept instructions I do not get this, however ??? avrdude: Device signature = 0x000000 Which is certainly wrong.

I'm new to programmers in general, usbtinyISP, barebone atmega µc, bootloader ... The actual chip is new for me. What else can I do with it to test it or get it alive ? Should I rather forget/return it ? Or is it rather a problem between usbtinyISP and avrdude ? ( programmer operation not supported )

If this is a brand new chip, it comes from the factory with a clock speed of 1MHz, which means your avrdude command is communicating too fast. Try adding the following option to your avrdude command

-b 115200

I added the following to my .avrduderc file (it is called something different on Windows)

programmer
  id    = "avrisp";
  desc  = "Atmel AVR ISP";
  type  = stk500;
  baudrate = 115200;
;

programmer
  id    = "avrispv2";
  desc  = "Atmel AVR ISP V2";
  type  =  stk500v2;
  baudrate = 115200;
;

programmer
  id    = "avrispmkII";
  desc  = "Atmel AVR ISP mkII";
  type  =  stk500v2;
  baudrate = 115200;
;

programmer
  id    = "avrisp2";
  desc  = "Atmel AVR ISP mkII";
  type  =  stk500v2;
  baudrate = 115200;
;

I use and AVR ISP MKII, so you will need to mimic the above with the specs for your programmer!

Solution: the chips were fused to require an external crystal.

I had to take my only UNO from its project ( I don’t have other crystals, as I think 8MHz is fast enough ),
replace the chip with the other one, attach usbtinyISP to the UNO and ran my read signature cmd:

Works perfect. No need for -b 115200 option (which I don’t understand, btw), no need for -B250

lfuse was FF : changed fuses to recommendation by http://www.engbedded.com fuse calculator successfully

Moved modified chip to my minimal breadboard, attached usbtinyISP: works !


** **avrdude: programmer operation not supported** **
is just for fun, this message persists,
but
** **avrdude: initialization failed, rc=-1** **
is serious, the -F option suggestion is rather useless then.

(added this follow up just in case other newbies have the patience to read this thread to the end)

Just to add more to problem and solution

looks like, in my case, when I wrote fuse for 20MHz fuse on atmega328p, It did write properly, but programmer could not verify the write, cuz, the board atmega328 was sitting on, had 16MHz.

After mumbo jumbo google moogle, I realize, may be placing the atmega328 on 20MHz board would solve it, and it did.