USBTinyISP Problems.. Works 1 out of 20 times...
Moderators: adafruit_support_bill, adafruit

USBTinyISP Problems.. Works 1 out of 20 times...

by Dr. Bogger on Sun Mar 11, 2012 2:50 pm

Hi Everyone,

For some reason, when I was trying to program a Atmega16 chip, it attempts to program, and it always gets to 100%, but not without at least 1 Retry.. Sometimes it has over 20 retries.. And 99% of the time, the verification fails...

I have to sit here and re-program it like 20 times over and over again before i get a "verification success".

=============================
avrdude: verifying ...
avrdude: verification error, first mismatch at byte 0x0038
0x0c != 0x04
avrdude: verification error; content mismatch

avrdude: safemode: Fuses OK

avrdude done. Thank you.
=============================

I have sit here and re-do it like 20 times before i get a success...

And I know its not getting all the program, cuz I have it set to program a 4x4x4 LED Cube, and sometimes it will work, but it won't run through the entire program... Only like 1/4th of it before it loops...

And other times it won't display anything at all...

Do you think its a problem with noise? Maybe Clock issues? the Atmega16 is using a 14.7456 Crystal with 22pF Caps.

Once I get a verification success, the program and chip works fine! But if I have to sit here and re-program it like 20+ times to get a working chip, then something is wrong..

Any ideas?
Dr. Bogger
 
Posts: 9
Joined: Sun Nov 06, 2011 6:27 pm

Re: USBTinyISP Problems.. Works 1 out of 20 times...

by sdb on Sun Mar 11, 2012 7:03 pm

14.7456 megahertz?

What voltage and how are you powering your atmega16?

how is the power target jumper set on the usbtinyisp?

Ideally your atmega16 would be independently powered at 5v and you would disconnect target power from the usbtiny.

you are using the short 6pin cable from the usbtiny? A long cable or loose wires (e.g. a breadboard) can definitely pick up noise.
sdb
 
Posts: 31
Joined: Thu Jan 12, 2012 4:24 am
Location: USA, ID

Re: USBTinyISP Problems.. Works 1 out of 20 times...

by Dr. Bogger on Sun Mar 11, 2012 7:11 pm

Yes, it's 14.7456 MHz

The Atmega16 is powered using a LM7805 and a 9v Battery (So 5 Volts).

I tried setting the jumper to provide power, and I also tried self powering the atmega16, and removing the jumper.
Makes no difference between the two.

I made a PCB For it, so there's no breadboard involved.

I'm using the 10 Pin Header, and the USB Cable is just a normal sized cable, like 6 ft, and I also tried using 3 different USB Cables, and I tried like 4 different USB Ports. I also tried 2 different drivers.

The computer recognizes the device and everything, it just seems like it's not getting a proper signal... I have a Oscilloscope, maybe I should monitor the signal for noise?
Dr. Bogger
 
Posts: 9
Joined: Sun Nov 06, 2011 6:27 pm

Re: USBTinyISP Problems.. Works 1 out of 20 times...

by Dr. Bogger on Sun Mar 11, 2012 7:13 pm

Oh, I also have 3 Decoupling Caps (0.1uF) on the PCB Board..

As well as a 1000uF Cap in the Input (9v), and a 10uF Cap on the output (5v) side of the voltage regulator (LM7805)
Dr. Bogger
 
Posts: 9
Joined: Sun Nov 06, 2011 6:27 pm

Re: USBTinyISP Problems.. Works 1 out of 20 times...

by sdb on Sun Mar 11, 2012 7:49 pm

Sounds like a 'scope is your best next step. :(

Computer recognition and USB cables are probably not an issue. From the avrdude errors you quoted, the problem will be between usbtiny and your circuit, or in your circuit.

Another idea... The usbtiny by default has some series resistors in the communications lines. Those are really only for use with the POV project and should be shorted for general programmer use. (This improves the source/sink current and hence rise/fall time, especially important if the lines have more capacitance such as in the 10pin ISP cable with its interleaved ground lines.)

Also, does your circuit have anything else attached to the MISO/MOSI/SCK pins on the atmega16? If so, it might be interfering with programming. Atmel has some guidelines to prevent interference, but sometimes there are still problems. The most certain approach is to disconnect those pins from normal circuit usage when doing ISP.
sdb
 
Posts: 31
Joined: Thu Jan 12, 2012 4:24 am
Location: USA, ID

Re: USBTinyISP Problems.. Works 1 out of 20 times...

by Dr. Bogger on Sun Mar 11, 2012 7:58 pm

I already tried removing the resistors, and adding jumpers... Still didnt help any..

And no, there is nothing attached to MISO/MOSI/SCK.

I attached a picture of the schematics for the board I'm using so you can see..
Attachments
4x4x4_LED_Cube_Schematics.png
Schematics
4x4x4_LED_Cube_Schematics.png (41.08 KiB) Viewed 3898 times
Dr. Bogger
 
Posts: 9
Joined: Sun Nov 06, 2011 6:27 pm

Re: USBTinyISP Problems.. Works 1 out of 20 times...

by Dr. Bogger on Fri Mar 16, 2012 1:55 pm

Anyone have any idea?
Dr. Bogger
 
Posts: 9
Joined: Sun Nov 06, 2011 6:27 pm

Re: USBTinyISP Problems.. Works 1 out of 20 times...

by john444 on Fri Mar 16, 2012 2:18 pm

I can imagine there may be lots of complicated possibilities but, consider this;

9v batteries do not have much energy in them and the internal resistance rises quickly during use.
In addition, the 7805 drops about 3v in order to regulate so you only have 1v of headroom.

You may be able to rule out the battery as the cause of the problem.
Try getting 9v from a different source like a bench supply.
Or put 5v directly to the board and see how it behaves.

Just a thought. Good luck
john444
 
Posts: 443
Joined: Sun Mar 04, 2012 2:42 pm
Location: Claremore, Ok

Re: USBTinyISP Problems.. Works 1 out of 20 times...

by Dr. Bogger on Fri Mar 16, 2012 2:33 pm

I tried using different power sources, including a 9-volt battery, and a wall-wart, and still the same issue.
Dr. Bogger
 
Posts: 9
Joined: Sun Nov 06, 2011 6:27 pm

Re: USBTinyISP Problems.. Works 1 out of 20 times...

by Dr. Bogger on Sun Mar 18, 2012 11:53 am

Well I guess help here pretty much doesn't exist... I'm just going to toss it in the trash and buy a USBASP Programmer.
Dr. Bogger
 
Posts: 9
Joined: Sun Nov 06, 2011 6:27 pm

Re: USBTinyISP Problems.. Works 1 out of 20 times...

by adafruit on Sun Mar 18, 2012 12:01 pm

Dr. Bogger wrote:Well I guess help here pretty much doesn't exist... I'm just going to toss it in the trash and buy a USBASP Programmer.


Hi Dr. Bogger,

Some kind folks in the forums have made suggestions, and we're catching up with the posts now. We'll be able to assist you :)

Thanks,
Adafruit support
User avatar
adafruit
 
Posts: 11718
Joined: Thu Apr 06, 2006 4:21 pm
Location: nyc

Re: USBTinyISP Problems.. Works 1 out of 20 times...

by adafruit on Sun Mar 18, 2012 12:02 pm

Hi there, Dr Bogger - it sounds like it works SOMETIMES but not ALL THE TIME right? By far the MOST COMMON reason for inconsistent behavior is power supply issues and mechanical issues - that includes soldering & loose wires. It is unlikely but it -could- be a bad chip.

Post up a clear photo with your soldering & we'll take a look
User avatar
adafruit
 
Posts: 11718
Joined: Thu Apr 06, 2006 4:21 pm
Location: nyc

Re: USBTinyISP Problems.. Works 1 out of 20 times...

by Dr. Bogger on Sun Mar 18, 2012 12:21 pm

I've been soldering for 5+ years... I double and triple checked the solder joints, they are all fine.. I've tested for bridges visually and with a DMM.. All is fine..

I get errors on avrdude no matter what... Each time I program it, it has to retry atleast 3 times.. sometimes upto 20+ times... and the verification always fails... except maybe once out of 20 times of repeated programming trying to get it to work..

I've tried every USB Port on my computer... I tried using it through a USB Hub like people have suggested elsewhere on this forum...

I tried removing the Resistors from the USBTinyISP, still no go..

I tried every single bitrate from 1 to 32, and still got nothing..

I also tried using it to program Atmega328 Chips and still have the same issue... even when the chip in on a Arduino Duemilanove Board...

So its not the chip, and its not the soldering... or else the arduino board would work fine..
So I have no idea what the issue is here..
Dr. Bogger
 
Posts: 9
Joined: Sun Nov 06, 2011 6:27 pm

Re: USBTinyISP Problems.. Works 1 out of 20 times...

by adafruit on Sun Mar 18, 2012 12:25 pm

Its certainly the first time we've seen this particular problem.
Maybe its the ISP cable?
Perhaps try with a new kit?
email support@adafruit with a link to this thread, we'll send you a new one.
User avatar
adafruit
 
Posts: 11718
Joined: Thu Apr 06, 2006 4:21 pm
Location: nyc

Re: USBTinyISP Problems.. Works 1 out of 20 times...

by Dr. Bogger on Thu Mar 22, 2012 7:12 pm

Hello,

I received the new kit today, soldered it together, and it works perfect!
There must have been something wrong with the old one, I'm going to guess either bad attiny chip, or the shift register is bad...
Dr. Bogger
 
Posts: 9
Joined: Sun Nov 06, 2011 6:27 pm