Need some help programming Ice Clock

For RTC breakouts, etc., use the Other Products from Adafruit forum

Moderators: adafruit_support_bill, adafruit

Please be positive and constructive with your questions and comments.
User avatar
jld
 
Posts: 69
Joined: Sun Jun 21, 2009 2:35 am

Need some help programming Ice Clock

Post by jld »

So I'm new to USBtinyISP and programming ice clock, and I'm having some trouble...

I installed avrdude, downloaded DigiSage's firmware from here: http://forums.adafruit.com/viewtopic.ph ... 764#p63721

Navigated to the firmware directory and ran this command:

Code: Select all

avrdude -c usbtiny -p atmega168  -B 32 -U flash:w:iv.hex
It did its thing, erased, wrote, and verified the flash, though I did get this output:

Code: Select all

avrdude: verifying ...
avrdude: verification error, first mismatch at byte 0x0ef9
         0x01 != 0x93
avrdude: verification error; content mismatch

avrdude: safemode: Fuses OK

avrdude done.  Thank you.
I didn't notice this at first and plugged the tube back in and plugged it in, but nothing happened. I reconnected to the usbtiny and tried to rewrite the flash again, but with a similar error:

Code: Select all

avrdude: verifying ...
avrdude: verification error, first mismatch at byte 0x0208
         0xf8 != 0xf0
avrdude: verification error; content mismatch
I then tried to slow down the transmission rate by decreasing the B flag:

Code: Select all

 avrdude -c usbtiny -p atmega168  -B 1 -U flash:w:iv.hex
and got this output:

Code: Select all

avrdude: initialization failed, rc=-1
         Double check connections and try again, or use -F to override
         this check.
Now whatever I do, I get that same error. Any thoughts as to what went wrong or if I broke it?

Thanks!
John

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

Re: Need some help programming Ice Clock

Post by adafruit »

try -B 10

User avatar
jld
 
Posts: 69
Joined: Sun Jun 21, 2009 2:35 am

Re: Need some help programming Ice Clock

Post by jld »

Code: Select all

avrdude -c usbtiny -p atmega168 -B 10 -U flash:w:iv.hex
yeilds the same thing.

Code: Select all

avrdude: initialization failed, rc=-1
         Double check connections and try again, or use -F to override
         this check.


avrdude done.  Thank you.

User avatar
jld
 
Posts: 69
Joined: Sun Jun 21, 2009 2:35 am

Re: Need some help programming Ice Clock

Post by jld »

If I run with flag -F, like it suggests, I get the following:

Code: Select all

avrdude: initialization failed, rc=-1
avrdude: AVR device initialized and ready to accept instructions
avrdude: Device signature = 0x000000
avrdude: Yikes!  Invalid device signature.
avrdude: Expected signature for ATMEGA168 is 1E 94 06
avrdude: NOTE: FLASH memory has been specified, an erase cycle will be performed
         To disable this feature, specify the -D option.

avrdude done.  Thank you.

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

Re: Need some help programming Ice Clock

Post by adafruit »

could be you connected the programmer incorrectly, the chip needs to be replaced?

User avatar
jld
 
Posts: 69
Joined: Sun Jun 21, 2009 2:35 am

Re: Need some help programming Ice Clock

Post by jld »

I'm curious in what way I could have connected the programmer incorrectly that would have caused this. I'm 99% sure I put the 6 pin cable in the correct way each time I connected it, but if I had put it in backwards would this have happened?

Or do you mean something different? Perhaps an issue inside the USBTiny?

Thanks for your assistance.

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

Re: Need some help programming Ice Clock

Post by adafruit »

no, more like the programmer connected incorrectly and or a cable or wire was not soldered causing the chip to, say, be programmed with incorrect fuses.

User avatar
len17
 
Posts: 394
Joined: Sat Mar 14, 2009 7:20 pm

Re: Need some help programming Ice Clock

Post by len17 »

Did you install resistors R4 and R7 in the USBtiny? I found I had to replace them with jumpers (as suggested in the instructions) for it to work.

User avatar
jld
 
Posts: 69
Joined: Sun Jun 21, 2009 2:35 am

Re: Need some help programming Ice Clock

Post by jld »

Yes, I have resistors in R4 and R7. Should I jump them? Is my 168 dead?

User avatar
stinkbutt
 
Posts: 593
Joined: Wed Feb 17, 2010 2:40 am

Re: Need some help programming Ice Clock

Post by stinkbutt »

From what I can see you programmed the chip twice.

The first time it appeared to work, sort of, but then your clock stopped working.
The second time (and all the subsequent times, I'm lumping the rest under this rubric,) programming never worked.

Let me ask you this:

1. For each of those times, R4 and R7 were in and not jumpered? Is that true for the first time? The second?
2. For each of those times, was the clock plugged in? Was the tube in the clock at the time? For the first? For the second?

I guess that's like, 6 questions, total.

User avatar
len17
 
Posts: 394
Joined: Sat Mar 14, 2009 7:20 pm

Re: Need some help programming Ice Clock

Post by len17 »

Here are some tips on programming the IceTube:
http://forums.adafruit.com/viewtopic.php?f=41&t=13310

Yes, you should replace R4 & R7 with jumpers. If that's your only problem, you didn't destroy anything.

User avatar
jld
 
Posts: 69
Joined: Sun Jun 21, 2009 2:35 am

Re: Need some help programming Ice Clock

Post by jld »

stinkbutt wrote:From what I can see you programmed the chip twice.

The first time it appeared to work, sort of, but then your clock stopped working.
The second time (and all the subsequent times, I'm lumping the rest under this rubric,) programming never worked.

Let me ask you this:

1. For each of those times, R4 and R7 were in and not jumpered? Is that true for the first time? The second?
2. For each of those times, was the clock plugged in? Was the tube in the clock at the time? For the first? For the second?

I guess that's like, 6 questions, total.
Hey stinkbutt, nice to smell you.

R4 and R7 are in, and always have been. I have done no jumpering, and I did all of the programming without the clock plugged in and with the tube out.

I guess at this point I should jumper R4 and R7 and try programming again?

Thanks everyone!

User avatar
jld
 
Posts: 69
Joined: Sun Jun 21, 2009 2:35 am

Re: Need some help programming Ice Clock

Post by jld »

I'll add that I built this USBtiny a few months ago but I can't remember ever programming anything else with it, though I've built/used other USBtinys before this one... So maybe it's not right.

Also, I seem to recall a way to test USBtinys, but I can't seem to find the page. Any hints on that?

User avatar
stinkbutt
 
Posts: 593
Joined: Wed Feb 17, 2010 2:40 am

Re: Need some help programming Ice Clock

Post by stinkbutt »

jld wrote:R4 and R7 are in, and always have been. I have done no jumpering, and I did all of the programming without the clock plugged in and with the tube out.

I guess at this point I should jumper R4 and R7 and try programming again?
Yes, I think you probably should. The reason you replace R4 and R7 is that with them removed the USBTinyISP can supply the power for the device (in this case the 168) being programmed. Otherwise you'll need to have the clock plugged in while programming it. Which is actually another alternative in a pinch, if you want to just get the damn thing working again in 5 minutes instead of reworking your USBTiny: Pull the tube, plug in the clock, and program with:

Code: Select all

avrdude -c usbtiny -p m168 -U flash:w:iv.hex
You can find the explanation for the R4 and R7 bits here, about a third of the way down the page.

Frankly, I'm a little surprised you managed to get the thing running at all without R4 and R7 jumpered. One would think it'd either always work or never work.

Oh, and one last thing: Regardless of how you program the clock, (plugged in or new jumpers for R4/7) I would try avrdude without the -B flag, at least at first. I can't recall that flag ever working properly. Someone might have a happy ending to a story that involves the -B flag, but I can't recall ever reading one.

User avatar
jld
 
Posts: 69
Joined: Sun Jun 21, 2009 2:35 am

Re: Need some help programming Ice Clock

Post by jld »

Frankly, I'm a little surprised you managed to get the thing running at all without R4 and R7 jumpered. One would think it'd either always work or never work.
No, you're right about this. I've never programmed the Ice Clock before. I got the full kit and assembled, but this was my first attempt at reflashing it.

So I plugged it into AC, connected to the USBtiny, and ran avrdude:

Code: Select all

avrdude -c usbtiny -p m168 -U flash:w:iv.hex
and got the same output...

Code: Select all

avrdude: initialization failed, rc=-1
         Double check connections and try again, or use -F to override
         this check.
I'm thinking either the 168 or my USBTiny is busted. I've got another 168 with me, that's in my arduino, so I'm tempted to put that in and try to reflash it again, but I don't want to burn up another one if it's my TinyUSB that is the problem.

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

Return to “Clock Kits (discontinued)”