Sketch stops and AVR not responding.

For makers who have purchased an Adafruit Starter Pack, get help with the tutorials here!

Moderators: adafruit_support_bill, adafruit

Please be positive and constructive with your questions and comments.
Locked
User avatar
Mixer
 
Posts: 12
Joined: Wed Dec 23, 2009 10:39 pm

Sketch stops and AVR not responding.

Post by Mixer »

Ok, so I have been using my Duemilanove from adafruit for about 2 weeks, all was working properly. I built a 3x3x3 cube and wrote a small sketch to run that, it works as expected for a little while (timeframe changes) and then stops running the sketch, led 13 on board starts blinking wildly and if I try to reset (via button) it does nothing, if I try to upload to it again, I get an AVR programmer not responding error.

After I unplug the USB cable and plug it back it, all works as expected, again for a little while, and then repeat above.

I can send my code, but it would not let me upload the .pde file.

adafruit
 
Posts: 12151
Joined: Thu Apr 06, 2006 4:21 pm

Re: Sketch stops and AVR not responding.

Post by adafruit »

probably some power issues. you may be overdriving the chip, shorting something, etc

User avatar
Mixer
 
Posts: 12
Joined: Wed Dec 23, 2009 10:39 pm

Re: Sketch stops and AVR not responding.

Post by Mixer »

ok well, I am a noob, and I am trying to self learn, so I am sure that there is a BUNCH of stuff I don't know. So lets go with my assumptions first. I would assume that if I had a short it would either be intermittent or be shorted from the start, I have visually checked for shorts and do not see any at this time. It is important to note that this anomaly only shows up after 4 iterations of my loop code, it does this every time.

I would think that would lead more to a code issue, is it possible to "overdrive" the chip with code? I have attached my code for review as well. I'm sure that my code is ugly, but lets try and focus on bugs in the code that might cause this problem, and not on my style of writing code. Thank you in advance.
Attachments
ledcube.txt
(3.08 KiB) Downloaded 348 times

adafruit
 
Posts: 12151
Joined: Thu Apr 06, 2006 4:21 pm

Re: Sketch stops and AVR not responding.

Post by adafruit »

well what happens when you upload the blink sketch?

User avatar
Mixer
 
Posts: 12
Joined: Wed Dec 23, 2009 10:39 pm

Re: Sketch stops and AVR not responding.

Post by Mixer »

well it appears that it is a software to hardware related thing. If I comment out the bottom section that has the clearCube() functions with the delays and the allOn() function, then it will run correctly for a much longer time, and then it fails in a different way.
The first time it failed it just stopped all together, now when it fails just a single LED will continuously blink, but unlike the first time, if I push the reset, it resets and starts over.

So I am going to play with the delays and such and see if that alleviates the issue, im thinking maybe that it takes the LED a much longer time to come on and go off than it does the chip to send the next signal and maybe it is too fast.

Oh BTW the blink script seemed to work as expected, and along with the other findings I don't necessarily think it is a hardware issue per se' .

adafruit
 
Posts: 12151
Joined: Thu Apr 06, 2006 4:21 pm

Re: Sketch stops and AVR not responding.

Post by adafruit »

sounds like your arduino is fine.

mtbf0
 
Posts: 1645
Joined: Sat Nov 10, 2007 12:59 am

Re: Sketch stops and AVR not responding.

Post by mtbf0 »

Mixer wrote:well it appears that it is a software to hardware related thing. If I comment out the bottom section that has the clearCube() functions with the delays and the allOn() function, then it will run correctly for a much longer time, and then it fails in a different way.
i would guess that allOn is killing the sketch, but you don't say how you wired your cube. looks like maybe you copied the one that was in the make: weekend project a long, long time ago. each layer with the cathodes wired in common? do you have current limiting resistors on the colPins? what value? to run a cube built in this manner you need to use a technique called multiplexing. light one level at a time and bring the cathode for that level low, leaving the others high, then repeat for the other two levels. allOn definitely isn't working like that.

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

Return to “Arduino Starter Pack”