HEEELP!! 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
KrunoslavH
 
Posts: 5
Joined: Sat Aug 02, 2014 7:53 am

HEEELP!! UsbTinyISP

Post by KrunoslavH »

Hi.
I tried programming my Atmega32 for a project. I cinnected from the 6-pin header to the chip on a breadboard (100% i connected it correctly). I installed WInAVR and usbtinyisp drivers.
I opened cmd and wanted to try if it works.
I entered: avrdude -c usbtiny -p m32
and recived:
avrdude: initialization failed, rc=-1
Double check connections and try again, or use -F to override
this check.

avrdude done. Thank you.
At first i thougt it was the programmer. I had a Attiny2313 and tried it out and it worked like a charm.
I also have an Arduino. I got the chip out and tried it out and it didn't work, same message.
Here if this helps:
Using Port : usb
Using Programmer : usbtiny
AVR Part : ATMEGA32
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 4 10 64 0 no 1024 4 0 9000 90
00 0xff 0xff
flash 33 6 64 0 yes 32768 128 256 4500 45
00 0xff 0xff
lfuse 0 0 0 0 no 1 0 0 2000 20
00 0x00 0x00
hfuse 0 0 0 0 no 1 0 0 2000 20
00 0x00 0x00
lock 0 0 0 0 no 1 0 0 2000 20
00 0x00 0x00
signature 0 0 0 0 no 3 0 0 0
0 0x00 0x00
calibration 0 0 0 0 no 4 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
Double check connections and try again, or use -F to override
this check.

I really hope i get help. This chip is new, never tasted voltage before so pls help me to fix this.
Thanks in adv.

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

Re: HEEELP!! UsbTinyISP

Post by adafruit_support_rick »

Did you attach a crystal? If not, are you sure it's set up for the internal oscillator?
That's why your Arduino chip didn't work - it's set up for an external crystal.

KrunoslavH
 
Posts: 5
Joined: Sat Aug 02, 2014 7:53 am

Re: HEEELP!! UsbTinyISP

Post by KrunoslavH »

I understand for the Arduino, but what's up with the Atmega32? I did not use a crystal? Should i add one? And what value?

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

Re: HEEELP!! UsbTinyISP

Post by adafruit_support_rick »

I'm just guessing. The rc=-1 means that the target processor is not responding. It could be a wiring error, or it could be the lack of a crystal. We have resonators in the shop:
https://www.adafruit.com/search?q=resonator

KrunoslavH
 
Posts: 5
Joined: Sat Aug 02, 2014 7:53 am

Re: HEEELP!! UsbTinyISP

Post by KrunoslavH »

I'm 100% sure about the wiring. But why do i need a crystal / resonator for and how do i wire it up? Btw. Thanks for your help so far.

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

Re: HEEELP!! UsbTinyISP

Post by adafruit_support_rick »

The factory default for the ATmega32 is an internal oscillator running at 1MHz. If your part is from the factory, then you shouldn';t need an external clock. However, if it has ever been programmed, then the default may have been changed.

Assuming your part is in the factory default state, then you don't need a crystal. Maybe you need to change the bit rate in avrdude to accommodate the slow internal clock rate. Try adding the option -B 32 to the avrdude command line.

KrunoslavH
 
Posts: 5
Joined: Sat Aug 02, 2014 7:53 am

Re: HEEELP!! UsbTinyISP

Post by KrunoslavH »

I tried that with the -B but it still didn't work. Would a new chip fix the problem maybe?

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

Re: HEEELP!! UsbTinyISP

Post by adafruit_support_rick »

I have no idea. I think I'd try one of the resonators.

KrunoslavH
 
Posts: 5
Joined: Sat Aug 02, 2014 7:53 am

Re: HEEELP!! UsbTinyISP

Post by KrunoslavH »

What valueshould be good and how do I wire it up? I tried with a 14.7456MHz crystal but no luck.

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

Re: HEEELP!! UsbTinyISP

Post by adafruit_support_rick »

Oh, you already tried a crystal? Then maybe you do need to try a different chip.

User avatar
nsayer
 
Posts: 59
Joined: Thu Aug 08, 2013 10:45 am

Re: HEEELP!! UsbTinyISP

Post by nsayer »

You need more than just a crystal on the two xtal pins. You also need two low-value capacitors to ground on each line. And the crystal has to have the correct capacitance. In practice, on a breadboard, just tossing in a crystal by itself may work, but it may be dodgy.

If your controller is fused for an external crystal, then it is required for programming. Depending on the controller and how it was fused, it may require the crystal be in a particular frequency range in order to work.

In a pinch, to recover a part where you don't have a proper crystal, you can try applying a multi-MHz square wave to one or the other xtal pin. That will often be enough to allow you to run avrdude to reset the fuses to the default internal oscillator. That done, you can remove the square wave and change the fuses to whatever you need.

If that doesn't work, or you suspect the fuses were set to an invalid value, then the only fix is HV programming mode, which requires a different programmer (and is beyond the scope of this forum). I've done HV programming once with an ATTiny85 because I didn't have any other PDIP ones handy. But my general opinion is that the controllers are cheap enough that replacing them is less expensive.

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

Return to “USBtinyISP”