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?
USBTinyISP Problems.. Works 1 out of 20 times...
Moderators: adafruit_support_bill, adafruit
Please be positive and constructive with your questions and comments.
- drbogger
- Posts: 9
- Joined: Sun Nov 06, 2011 6:27 pm
- sdb
- Posts: 31
- Joined: Thu Jan 12, 2012 4:24 am
Re: USBTinyISP Problems.. Works 1 out of 20 times...
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.
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.
- drbogger
- Posts: 9
- Joined: Sun Nov 06, 2011 6:27 pm
Re: USBTinyISP Problems.. Works 1 out of 20 times...
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?
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?
- drbogger
- Posts: 9
- Joined: Sun Nov 06, 2011 6:27 pm
Re: USBTinyISP Problems.. Works 1 out of 20 times...
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)
As well as a 1000uF Cap in the Input (9v), and a 10uF Cap on the output (5v) side of the voltage regulator (LM7805)
- sdb
- Posts: 31
- Joined: Thu Jan 12, 2012 4:24 am
Re: USBTinyISP Problems.. Works 1 out of 20 times...
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.
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.
- drbogger
- Posts: 9
- Joined: Sun Nov 06, 2011 6:27 pm
Re: USBTinyISP Problems.. Works 1 out of 20 times...
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..
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
-
- Schematics
- 4x4x4_LED_Cube_Schematics.png (41.08 KiB) Viewed 5087 times
- drbogger
- Posts: 9
- Joined: Sun Nov 06, 2011 6:27 pm
Re: USBTinyISP Problems.. Works 1 out of 20 times...
Anyone have any idea?
- john444
- Posts: 443
- Joined: Sun Mar 04, 2012 2:42 pm
Re: USBTinyISP Problems.. Works 1 out of 20 times...
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
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
- drbogger
- Posts: 9
- Joined: Sun Nov 06, 2011 6:27 pm
Re: USBTinyISP Problems.. Works 1 out of 20 times...
I tried using different power sources, including a 9-volt battery, and a wall-wart, and still the same issue.
- drbogger
- Posts: 9
- Joined: Sun Nov 06, 2011 6:27 pm
Re: USBTinyISP Problems.. Works 1 out of 20 times...
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.
-
- Posts: 12151
- Joined: Thu Apr 06, 2006 4:21 pm
Re: USBTinyISP Problems.. Works 1 out of 20 times...
Hi Dr. Bogger,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.
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
-
- Posts: 12151
- Joined: Thu Apr 06, 2006 4:21 pm
Re: USBTinyISP Problems.. Works 1 out of 20 times...
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
Post up a clear photo with your soldering & we'll take a look
- drbogger
- Posts: 9
- Joined: Sun Nov 06, 2011 6:27 pm
Re: USBTinyISP Problems.. Works 1 out of 20 times...
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..
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..
-
- Posts: 12151
- Joined: Thu Apr 06, 2006 4:21 pm
Re: USBTinyISP Problems.. Works 1 out of 20 times...
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.
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.
- drbogger
- Posts: 9
- Joined: Sun Nov 06, 2011 6:27 pm
Re: USBTinyISP Problems.. Works 1 out of 20 times...
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...
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...
Please be positive and constructive with your questions and comments.