USBTinyISP Problems - initialization failed

USB AVR Programmer and SPI interface. Adafruit's USBtinyISP.

Moderators: adafruit_support_bill, adafruit

USBTinyISP Problems - initialization failed

Postby jamie » Fri Mar 07, 2008 9:43 pm

Hey There,

LadyAda just commented on my website here:
http://www.noiselandarcade.net/index.ph ... a-bigpita/

I'm trying to follow the instructions here:
http://www.evilmadscientist.com/forum/v ... wtopic=385

I can't get my USBTinyISP to communicate with my AVR chip. I've read through just about every post regarding this here, and I've given up and decided to post about it. I hope I'm not posting too much info but not sure what's important and what's not.

I can solder well, so I don't think I have any setup problems. I checked continuity with a meter from the pins on the 6 pin header on USBTinyISP, through the cable, through the header on my EvilMadScientist.com peggy board, and to the corresponding pins on the ATMega164p controller chip. Everything checks out connection wise.

Here's a pic of it hooked up:
Image

I am running:
Windows XP
AVRDude 5.5, with the 5.3 patch
1.12 USBTinyISP drivers (I've tried 1.10 as well)

The gist of what's going on is I do a "make all" from DOS, followed by a "make install". The make install fails with:
Code: Select all
avrdude: Using SCK period of 10 usec
avrdude: initialization failed, rc=-1
         Double check connections and try again, or use -F to override
         this check.


I've tried this with a "-B 32" and "-B 25" in the avrdude line inside the make file. I've tried powering the board externally, and also via the J3 jumper on USBTinyISP.

Heres a log of the output from the call to "make all":
Code: Select all
C:\AVR_code\peggy_scanline>make all
avr-gcc -g -Wall -Os -mmcu=atmega164p     -c -o peggy.o peggy.c
avr-gcc -g -Wall -Os -mmcu=atmega164p   -Wl,-Map,peggy.map -o peggy.elf peggy.o

avr-objdump -h -S peggy.elf > peggy.lst
avr-objcopy -j .text -j .data -O ihex peggy.elf peggy.hex
avr-objcopy -j .text -j .data -O binary peggy.elf peggy.bin
avr-objcopy -j .text -j .data -O srec peggy.elf peggy.srec

C:\AVR_code\peggy_scanline>


And here is the complete output from "make install":
Code: Select all
C:\AVR_code\peggy_scanline>make install
avrdude -p m164 -c usbtiny        -P usb                 -v -e -b 115200  \
         -U lfuse:w:0xE2:m \
         -U hfuse:w:0xD9:m \
         -U efuse:w:0xff:m \
     -U flash:w:peggy.hex

avrdude: Version 5.3.1, compiled on Apr  8 2007 at 17:05:38
         Copyright (c) 2000-2005 Brian Dean, http://www.bdmicro.com/

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


         Using Port            : usb
         Using Programmer      : usbtiny
         Overriding Baud Rate  : 115200
found 5 busses
         AVR Part              : ATMEGA164
         Chip Erase delay      : 9000 us
         PAGEL                 : PD7
         BS2                   : PA0
         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  Max
W   ReadBack
           ----------- ---- ----- ----- ---- ------ ------ ---- ------ ----- ---
-- ---------
           eeprom        65    10   128    0 no        512    4      0  9000  90
00 0xff 0xff
           flash         33     6   128    0 yes     16384  128    128  4500  45
00 0xff 0xff
           lock           0     0     0    0 no          1    0      0  9000  90
00 0x00 0x00
           lfuse          0     0     0    0 no          1    0      0  9000  90
00 0x00 0x00
           hfuse          0     0     0    0 no          1    0      0  9000  90
00 0x00 0x00
           efuse          0     0     0    0 no          1    0      0  9000  90
00 0x00 0x00
           signature      0     0     0    0 no          3    0      0     0
0 0x00 0x00
           calibration    0     0     0    0 no          1    0      0     0
0 0x00 0x00

         Programmer Type : USBTINY
         Description     : USBtiny simple USB programmer

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


avrdude done.  Thank you.

make: *** [install] Error 1

C:\AVR_code\peggy_scanline>


I was thinking of taking the AVR out of the peggy board, and wiring it up directly to the programmer to see if that helps, but maybe there is a simpler fix?

Thanks for the help!
jamie
 
Posts: 4
Joined: Fri Mar 07, 2008 9:27 pm

Postby adafruit » Fri Mar 07, 2008 10:53 pm

is the peggy board powered up and on?
User avatar
adafruit
 
Posts: 10491
Joined: Thu Apr 06, 2006 3:21 pm
Location: nyc

Postby jamie » Fri Mar 07, 2008 10:58 pm

Yup. When I did that last attempt, it was plugged in via an ac adapter and on and all the LEDs were lit. I've tried it plugged in and off, and when I do that the call to "make install" turns the LEDs on.

I've also tried it with no plug, powered via the USBTinyISP.
jamie
 
Posts: 4
Joined: Fri Mar 07, 2008 9:27 pm

Postby adafruit » Fri Mar 07, 2008 11:15 pm

i dont understand what you mean by
"AVRDude 5.5, with the 5.3 patch
1.12 USBTinyISP drivers (I've tried 1.10 as well) "

are you using avrdude 5.5 or 5.3
User avatar
adafruit
 
Posts: 10491
Joined: Thu Apr 06, 2006 3:21 pm
Location: nyc

Postby jamie » Fri Mar 07, 2008 11:23 pm

If I remember correctly, I installed the 1.12 driver, and the latest version of WinAVR, which I think gives me avrdude 5.5. I then got errors from avrdude saying it couldn't find the USBTinyISP. I then read the second bullet below from the download page, and followed those instructions:

# The latest version of WinAVR has avrdude v5.5 with usbtinyisp support so just install that! (Detailed instructions are here)
Make sure that if you're using Dec 20, 2007 (20071220) release, you must have the v1.10 driver installed not the v1.12 or you'll have problems.
# Alternately, you can simply download Windows binary of avrdude 5.3.1 and replace whatever you got with WinAVR. These binaries are built against the v1.12 drivers, so if you have that driver and you dont want to replace it with the older version, try this.
To install, Copy avrdude.exe avrdude.conf and libusb0.dll into C:\WinAVR\bin (Assuming you have WinAVR installed)
(I couldn't get windows HID stuff working so avrdoper support was commented out, I'll try to get this fixed but it doesn't seem likely anytime soon)


Over the coarse of messing with this, I've tried v1.10 drivers, and avrdude 5.5 without copying those older files from bullet #2 above, but always seemed to get the same result. The last test I did was on 1.12 drivers, and with those avrdude 5.3.1 files copied into the winavr\bin folder.
jamie
 
Posts: 4
Joined: Fri Mar 07, 2008 9:27 pm

Yeah, me too.

Postby oskay » Sat Mar 08, 2008 6:48 am

The problem seems to be in the difference between USBTinyISP v 1.0 and USBTinyISP v 2.0.

I had two reports (Jamie's included) of people being unable to program their Peggys, both with the USBTinyISP v 2.0, so I just got one to try out and I put it together this evening.

Here is what I see:
1. The USBTinyISP v 2.0 basically works correctly; I can use it to program the same chip (ATmega164P) on a minimal target board.
2. The Peggy also basically works correctly. I can program it in circuit with USBTinyISP v 1.0.
3. The USBTinyISP v 2.0 cannot program the Peggy. ("avrdude: initialization failed, rc=-1")

(This is exactly consistent with what I saw in the other non-Jamie report as well.)

So, it's looking like the Peggy is only borderline compatible with the 74AHC125 as it's arranged now. The Peggy draws a maximum of about 3.5 mA on any of the MCU lines that go to the transistor array, so that doesn't seem like enough to prevent the reset from occurring properly, *except* that the logic thresholds of the 74AHC125 are so damned weird. (Everything's running at 4.5 V here.)

So... I have two hacks to describe. Either of these lets me program dear Peggy with USBTinyISP v. 2.0. (And Ada, before I go telling everyone else either of these ideas, I'd like your opinions please).

#1: Kludge galore: "Downgrade" to 1.0 by taking the buffer out of the equation. (Right way:remove the buffer chip and add wires 2-3, 5-6, 8-9, and 11-12. Ever-so-wrong but actually workable way: don't take the chip out but short circuit-- ala solder bridge-- 2-3 and 8-9 anyway.)

#2: Practically justifiable solution: Replace the 1.5 k's (R6 & R7) with something lower. I mean, hey-- you already put a low-ish current buffer *at the target board voltage* there, so is there a good reason to demand quite so much resistance? I tried shorting across both resistors with a wire (that worked). I also tried adding a 1k resistor in parallel with each, bringing the net value of R6 and R7 down to 600 ohms; that works too. Maybe a 500 ohm spec would be a good choice.


We could probably also add an independent buffer to the Peggy, but that would kinda suck. :)

Can you think of any other (hopefully less invasive) mods that we could try either with the peggy or the v 2.0 to make this work?
Last edited by oskay on Sun Mar 09, 2008 5:48 pm, edited 2 times in total.
oskay
 
Posts: 19
Joined: Tue Jul 31, 2007 3:03 am

Postby Russ Nagel » Sat Mar 08, 2008 9:12 am

Jamie

I am working on getting my USBtinyISP going as well. See my post on this forum just before yours. I haven't tested mine yet (soon) but I had the same question you did. That is about AVRdude v5.5, and where do I get it. The instructions on downloading the drivers and the files on this website have AVRdude v5.3.1 as a windows binary file. I believe this is a patched version of AVRdude 5.3.1 and works without needing additional patches.

You may have already figured that out though.

My first project isn't nearly as ambitious as your though. I am working on the lesson at:
http://imakeprojects.com/Projects/avr-tutorial/

I like the KISS (Keep It Simple Stupid) principal in a situation like this.

Russ
Russ Nagel
 
Posts: 18
Joined: Fri Mar 07, 2008 8:10 pm

Re: Yeah, me too.

Postby adafruit » Sat Mar 08, 2008 9:51 am

oskay wrote:The problem seems to be in the difference between USBTinyISP v 1.0 and USBTinyISP v 2.0.

Can you think of any other (hopefully less invasive) mods that we could try either with the peggy or the v 2.0 to make this work?


! you are correct. hmmm

id say replace the 1.5k resistors with wires. its the easiest mod by far.
User avatar
adafruit
 
Posts: 10491
Joined: Thu Apr 06, 2006 3:21 pm
Location: nyc

Postby jamie » Sat Mar 08, 2008 1:48 pm

You guys rock! Thanks for the help. :) I pulled R6 and R7 and put wires in there places, and its working great now. I didn't like R6 and R7 anyway.

Image

resistance is futile.
jamie
 
Posts: 4
Joined: Fri Mar 07, 2008 9:27 pm

R6 and R4 swapped on silk screen?

Postby ddribin » Mon Mar 31, 2008 1:00 am

Hey,

I followed the instructions in this thread (short out R6 and R7), but ran into an issue where avrdude wouldn't work at times. Unless it's late and I'm seeing things, R4 and R6 on the USBtinyISP silk screen are labeled incorrectly: their swapped. Thus if you want to short out R6, as described, you need to short out what's labeled R4. I tried this out, and my avrdude problems seem to have disappeared. Just for sanity sake, can someone else verify that the R4 and R6 silk screen are swapped?

Thanks,

-Dave
ddribin
 
Posts: 2
Joined: Mon Mar 31, 2008 12:18 am

Postby adafruit » Mon Mar 31, 2008 1:13 am

the resistors to short are R4 and R7 according to the silkscreen
User avatar
adafruit
 
Posts: 10491
Joined: Thu Apr 06, 2006 3:21 pm
Location: nyc

Postby bjh » Mon Mar 31, 2008 11:24 pm

GAH! Now to fix my fix, looks like it really is (by the silkscreen) *R4*... (It's a damn good thing R4 and R6 are the same value, as I built the thing entirely by the silkscreen and the parts list...)
bjh
 
Posts: 1
Joined: Mon Mar 31, 2008 11:20 pm

Postby ddribin » Tue Apr 01, 2008 11:53 am

If you shorted out what's labeled as R6, be sure to put a 1.5K resistor back. Otherwise the red LED is hooked up to an I/O pin without a current limiting resistor. It's not a huge deal, as the red LED only goes on for a short period of time while programming, but probably best to have it there.

I posted more information on my blog about this issue, for those interested.

-Dave
ddribin
 
Posts: 2
Joined: Mon Mar 31, 2008 12:18 am

Postby wtfwtfdef » Wed May 28, 2008 12:12 am

what chips are affected by this? I dont understand whats the problem? the 1.5Kohm resistors are limiting current/voltage for the atmega168? Im planning on programming an atmega88 and am wondering if its needed to do this mod and if ladyada is going to make this officially a hw revision to be done for all chips. it still programs my attiny2313's fine.

So will this be needed to test other chips or is this mod just for this situation? using board power and not the USbTinyISP on chip power 5v just for the atmega164? If this is a needed mod im so screwed, i hot glued my usbtiny into the case so I can have it open without it falling out. :oops:
wtfwtfdef
 
Posts: 12
Joined: Sat Dec 15, 2007 1:35 am

Postby adafruit » Thu May 29, 2008 9:36 pm

it has nothing to do with the chip and everything to do with what the target is connected to. the peggy board has a lot of LEDs driven from the programming pins. usually i dont connect anything to programming pins (just for safety)
the 1.5k output resistors are, essentially, only for spokepov kit programming. if you arent using this with a spokepov, then you can just jumper the resistors and be done with it
User avatar
adafruit
 
Posts: 10491
Joined: Thu Apr 06, 2006 3:21 pm
Location: nyc

Next

Return to USBtinyISP

Who is online

Users browsing this forum: No registered users and 0 guests

Stuff to buy from the Adafruit store and links to product documentation!


New Products [108]

Raspberry Pi[80]
 
FLORA[23]
 
Bunnie Studios[9]
 
FPGA[1]
 
mbed[11]
Arduino[60]
 
NETduino[14]
 
BeagleBone[24]
 
Android[6]
 
XBee[10]
More Dev Boards[31]


 
BoArduino[8]
 
SpokePOV[4]
 
TV-B-Gone[4]
 
MiniPOV[3]
 
SIM reader[3]
 
Microtouch[5]
 
Clocks & Watches[18]
 
Drawdio[4]
 
Brain Machine[1]
 
Game of Life[2]
 
MintyBoost[2]
More DIY Kits[16]


 
MaKey MaKey[3]
 
Tweet-a-Watt[5]
 
Young Engineers[33]
 
Discover Electronics[2]
 
Snap Circuits[4]
 
littleBits[3]
 
Project packs[8]


 
Breakout Boards[34]
LCDs & Displays[48]
Components & Parts[70]
Batteries & Power[49]
EL Wire/Tape/Panel[52]
LEDs[111]
 
Wireless[14]
Cables[62]
 
Lasers[6]
Sensors/Parts[145]
 
Enclosures/Cases[11]
 
Solar[11]
 
RFID / NFC[13]
Prototyping[70]
 
iDevices[13]
Tools[71]
 
Wearables[39]
 
CNC[37]
 
Robotics[29]
 
3D printing[1]
 
Materials[24]


 
Stickers[41]
 
Skill badges[55]
 
Books[25]
 
Circuit Playground[7]
 
Gift Certificates[4]