Do I need resistors in my USBTinyISP?

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

Moderators: adafruit_support_bill, adafruit

Please be positive and constructive with your questions and comments.
Locked
User avatar
jasonwebb
 
Posts: 111
Joined: Sat Sep 10, 2011 2:15 pm

Do I need resistors in my USBTinyISP?

Post by jasonwebb »

I am trying to program a new board with a built-in ATMega328 (32-TQFP package), but keep getting the Initialization rc=1 failure error.

I know that the "HELP!!" section says that I should check the MOSI/MISO/SCK pins are not loaded, and I know that MOSI pin has some circuitry on it. I'm just not sure if it qualifies as "loaded".

I've attached the schematic for my circuit - please check the MOSI pin (PB3) and see that is going to a MOSFET.

I didn't want to rip apart my USBtinyISP and add the resistors if I don't need to - I have a tendency to destroy PCBs when trying to desolder parts from them.
Attachments
schematic.png
schematic.png (44.63 KiB) Viewed 3045 times

User avatar
adafruit_support_mike
 
Posts: 67446
Joined: Thu Feb 11, 2010 2:51 pm

Re: Do I need resistors in my USBTinyISP?

Post by adafruit_support_mike »

The 1.5k resistors aren't necessary if you want to use the USBTinyISP as a general-purpose programmer.

If you want to remove them, don't worry about being graceful about it, just cut them off with a pair of flush-cut trimmers (like these: http://www.adafruit.com/products/152 ). Then you can mop up the no-longer-necessary joints with some solder wick and install a couple of jumpers. Heat the pad until the solder has melted, then push the remaining bit of lead wire out of the hole with your jumper wire.

WRT your circuit, the load on the MOSI pin consists of the 220R and 10k resistors between the MOSI pin and GND. The mosfet won't absorb enough current to make any difference. The 10k of resistance really shouldn't cause trouble either.. you'll lose about 3/4 of a volt with the 1.5k resistors in place, but that shouldn't be enough loss to hurt the connection.

Have you checked everything else? Is the chip getting power, are the pins connections correct, etc?

User avatar
jasonwebb
 
Posts: 111
Joined: Sat Sep 10, 2011 2:15 pm

Re: Do I need resistors in my USBTinyISP?

Post by jasonwebb »

Alrighty, so I do not need the resistors in order to program this board, correct? I don't want to attempt to replace the jumpers if I don't have to.

I've spent the last week checking everything I know how to check. All pins are firmly soldered the board. All VCC and GND pins are connected to the board and correctly to each other (no ground faults found anywhere). No pins are connected that shouldn't be.

The power LED that I placed on the board did not light up, however, but I may have soldered it on backwards (so easy to do!).

A bit stumped right now about what the problem is.

User avatar
adafruit_support_mike
 
Posts: 67446
Joined: Thu Feb 11, 2010 2:51 pm

Re: Do I need resistors in my USBTinyISP?

Post by adafruit_support_mike »

zenwebb wrote:Alrighty, so I do not need the resistors in order to program this board, correct? I don't want to attempt to replace the jumpers if I don't have to.
Correct.
zenwebb wrote:The power LED that I placed on the board did not light up, however, but I may have soldered it on backwards (so easy to do!).
Do check that out. Circuit problems tend to be interrelated.

For further debugging, the big question is, "what kind of test equipment do you have?" If you have access to an oscilloscope it should be fairly easy to pinpoint the trouble.

User avatar
jasonwebb
 
Posts: 111
Joined: Sat Sep 10, 2011 2:15 pm

Re: Do I need resistors in my USBTinyISP?

Post by jasonwebb »

There is definitely something very screwy going on.

I bought a new set of parts from Digikey and started to assemble a new board, because a pad lifted off my last board from too much soldering.

I have only installed a blank ATMEGA328 (http://www.digikey.com/product-detail/e ... ND/1832260), a 16 Mhz resonator and the male headers for the ISP connector.

I load up the Arduino IDE (using 1.0.5), select "Arduino Uno" from the Tools > Board type menu, and "USBtinyISP" from the Tools > Programmer menu, then click on Tools > Burn bootloader.

I immediately get the same error.

I do not have access to an oscilloscope, only a digital multimeter (Extech 410).

I'm at a loss for what could be going wrong - there are only two parts in the circuit! I've attached some photos.
Attachments
000_0012.JPG
000_0012.JPG (591.64 KiB) Viewed 2598 times
000_0010.JPG
000_0010.JPG (557.19 KiB) Viewed 2598 times

User avatar
jasonwebb
 
Posts: 111
Joined: Sat Sep 10, 2011 2:15 pm

Re: Do I need resistors in my USBTinyISP?

Post by jasonwebb »

Just realized that I didn't solder on the 10k pull-up resistor on the reset line. I added it and tried burning the bootloader again, but got the same result.

I turned on verbose output and this is what I got in the console:

Code: Select all

C:\Program Files (x86)\Arduino\hardware/tools/avr/bin/avrdude -CC:\Program Files (x86)\Arduino\hardware/tools/avr/etc/avrdude.conf -v -v -v -v -patmega328p -cusbtiny -e -Ulock:w:0x3F:m -Uefuse:w:0x05:m -Uhfuse:w:0xde:m -Ulfuse:w:0xff:m 

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\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] [ff ff ff ff]
CMD: [ac 53 00 00] [ff ff ff ff]
avrdude: initialization failed, rc=-1
         Double check connections and try again, or use -F to override
         this check.


avrdude done.  Thank you.

User avatar
adafruit_support_rick
 
Posts: 35092
Joined: Tue Mar 15, 2011 11:42 am

Re: Do I need resistors in my USBTinyISP?

Post by adafruit_support_rick »

The avrdude log is telling you that it is not communicating with the target chip. It's trying to read from the target and getting no response.

http://learn.adafruit.com/usbtinyisp/help

User avatar
jasonwebb
 
Posts: 111
Joined: Sat Sep 10, 2011 2:15 pm

Re: Do I need resistors in my USBTinyISP?

Post by jasonwebb »

I'm totally at a loss for why. The circuit is about as simple as it gets, and the parts came straight out of the bag from Digikey. I've checked everything in the help section and it seems to check out just fine, but I can't program the chip. Any ideas?

User avatar
adafruit_support_rick
 
Posts: 35092
Joined: Tue Mar 15, 2011 11:42 am

Re: Do I need resistors in my USBTinyISP?

Post by adafruit_support_rick »

If the silkscreen on your board is to be believed, you've got the ICSP header upside down and backwards.

Pin 1 (MISO) on the ribbon cable is indicated by the red wire. That will be the pin above the one labeled MISO on the board.
I've labeled your picture with the signals coming out of the ribbon:
ICSP.png
ICSP.png (251.73 KiB) Viewed 2515 times
If you simply turn the ribbon socket around, it still won't work.

However, if you can re-solder your header so that the pins extend out of the bottom of the board, you will then be able plug in the ribbon with the correct orientation.

User avatar
jasonwebb
 
Posts: 111
Joined: Sat Sep 10, 2011 2:15 pm

Re: Do I need resistors in my USBTinyISP?

Post by jasonwebb »

Oh. My. God. lol.

I used the 2x3 lock SPI AVR programming header included in Sparkfun's Connectors library, and assumed that it was correct (I mean, it's Sparkfun!).

I just checked my PCB again and made sure that my header is not rotated or mirrored.

I whipped up the attached schematic and board file to compare the Adafruit 2x3 AVR ICSP header to the Sparkfun header and found that they are identical. Are these headers meant to be installed on the underside of PCBs? What did I do wrong to make my header come out flipped so weirdly?

Is the pinout of the 6-pin header coming from the USBtinyISP mirrored compared to the PCB footprint header?
Attachments
pcb-test.png
pcb-test.png (16.69 KiB) Viewed 2496 times
schematic-test.png
schematic-test.png (13.22 KiB) Viewed 2496 times

User avatar
adafruit_support_rick
 
Posts: 35092
Joined: Tue Mar 15, 2011 11:42 am

Re: Do I need resistors in my USBTinyISP?

Post by adafruit_support_rick »

Okay, now you've got me confused. I hate ribbon cables.

Upon further review, I think you've got it right after all. The key is underneath the ribbon cable in your first picture, so Pin 1 is indeed connected to MISO. Sorry 'bout that, Chief. :oops:

So, why doesn't it work? All I can suggest is that you check for the usual suspects. Have you got power going to the target? Make sure you've got the power jumper installed in the USBTiny.

If you've got a scope, make sure you've got a clock on the ATMega. Also have a look at MOSI, MISO, SCK and RST to make sure those lines are wiggling as expected.

The pinout on the USBtiny's 6-pin header is identical to the pinout of J1 in the schematic you posted.
The eagle files with schematic and board layout are linked here:
http://learn.adafruit.com/usbtinyisp/download

User avatar
jasonwebb
 
Posts: 111
Joined: Sat Sep 10, 2011 2:15 pm

Re: Do I need resistors in my USBTinyISP?

Post by jasonwebb »

It turns out that I somehow tricked myself into labeling the wrong net. I named the wrong net "MOSI", and then moved the net name to the "correct" net. Essentially I connected the ICSP MOSI pin to a completely different pin of the ATMega. I have no idea how I did this, but I did :P

I cut the incorrect trace and soldered a wire from the ICSP header MOSI pin to the right ATMega pin and tried programming it again, and it worked perfectly! Hooray for stupid errors!
Attachments
ffffffuuuuuu.png
ffffffuuuuuu.png (109.91 KiB) Viewed 2407 times

Locked
Please be positive and constructive with your questions and comments.

Return to “USBtinyISP”