Ice Tube Clock Hacking

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.
Locked
User avatar
dougjohnson
 
Posts: 4
Joined: Fri Apr 12, 2013 2:09 pm

Ice Tube Clock Hacking

Post by dougjohnson »

I put my Ice Tube Clock together and it is working perfectly. I have the urge to fix that. :D
Can someone give me a summary of how to develop and debug the firmware? I have considerable, but long-ago experience with the gnu tools. Ive looked briefly at the Atmel Studio IDE. I think I understand the compiling and install process. But, how do you debug software running on the clock?
Thanks,
Doug

User avatar
jarchie
 
Posts: 615
Joined: Sun Jun 24, 2012 2:16 pm

Re: Ice Tube Clock Hacking

Post by jarchie »

I do everything at the command line and have never used the Atmel Studio IDE, so I can't offer any advice there.

But for hacking the Ice Tube Code, the AVR Libc documentation is tremendously helpful and has links to other projects for programming (avrdude) and debugging (AVaRICE): http://www.nongnu.org/avr-libc/

A while back, I posted an overview of how to compile and program alternative firmware, which may be helpful if you're already somewhat familiar with GCC: http://forums.adafruit.com/viewtopic.ph ... 82#p187282

Good luck and happy hacking!

User avatar
dougjohnson
 
Posts: 4
Joined: Fri Apr 12, 2013 2:09 pm

Re: Ice Tube Clock Hacking

Post by dougjohnson »

That's the pointer I was looking for. AVaRICE seems to require the Atmel JTAG ICE, which seems to cost $150 or so. Am I off base or is there a cheaper approach?
Thanks
Doug

User avatar
jarchie
 
Posts: 615
Joined: Sun Jun 24, 2012 2:16 pm

Re: Ice Tube Clock Hacking

Post by jarchie »

The Atmel AVR Dragon is much cheaper, and as a hobbyist, that's what I use. The disadvantage of the Dragon is that it's notoriously fragile. There is an excellent description of the Dragon by miamicanes in an AVR Freaks thread (quoted below).

Despite miamicanes' comments, I love my Dragon, and it has never failed me. But I only use it for high voltage programming and DebugWIRE, and I've always been careful with my Dragon. Most of the time, I reach for my Adafruit USBtinyISP.
I'd put it this way: when you need cheap Debugwire, the Dragon rocks... but buy the Dragon as your SECOND AVR programming device. Don't ever put yourself in a position where a Dragon is your one and only means of flashing an AVR for routine daily programming, because you'll either fry it or be frustrated & BANNED on a regular basis.

Basically, the Dragon has three design fla^h^h^h compromises made in the name of value engineering that are generally tolerable for a device that gets pulled out for special occasions (debugwire, high-voltage resurrection of a comatose fuse-scrambled AVR, etc), but are fairly serious for a device you depend on daily.

1. USB-powered. More often than not, it seems like there are lots of devices that are "USB-powered" where the engineers screamed that 500mA was suicidal, and management said "It'll be good enough for 98% of our users, and will save us the $3 or so a brick costs to buy, ship, and sort by country". First-gen Dragons have a particularly nasty outright flaw whereby attempting to do high-voltage programming from a PC (or especially a laptop) USB port instead of from a powered hub can (and eventually will) fry parts on the Dragon. Search AVRfreaks for "Dragon-Slayer", and you'll see this is the #1 cause of Dragon death.

2. Most decent AVR programmers practice "Safer Programming" and buffer themselves from the devices they're having intimate relations with. Not so with the Dragon -- it likes it raw & nasty. As in real life, this causes it to come down with everything from transitory ailments that go away when you disconnect it and leave it alone for a while all the way to maladies that will kill it outright.

Specifically, nearly everyone with a Dragon and some other programmer has seen situations where the Dragon couldn't reliably program the target -- or even read the chip's id -- but their other programmer yawned, flashed it, and metaphorically asked what the big deal was. The Dragon is finicky about things buffered programmers don't even notice. In a well-equipped corporate development lab staffed by real engineers, those problems rarely happen. In your bedroom working on hobby projects, they most certainly will.

3. The Dragon is kind of like a cat -- there are certain places it simply does NOT like to be touched... except instead of just giving you a nasty scratch (shock) that will heal, it'll kill itself instead if you touch it wrongly at a particularly inappropriate time. IMHO, there's no excuse. It's understandable that Atmel wanted to save the case costs to keep it more affordable. It's unforgivable that they didn't do a better job of designing its paper carton to BE the Dragon's de-facto enclosure. A little origami, some dotted lines, maybe the inclusion of a single-edged [Apparently Adafruit censors a word here, but the word starts with "ra" and ends with "zor".] blade to make cutting it easier. The point is, this is another major cause of DragonDeath.

In summary, if you own a Dragon as your SECOND programming device, you'll love it and be glad you have it when the need arises. If you buy one to be your one & only programmer, you'll regret it. And right now, for a little more than you'd spend for a Dragon and AVRISPmkII if you factor in two overnight shipping charges, you can buy a JTAGICE2 and enjoy the best of all possible worlds.

User avatar
jarchie
 
Posts: 615
Joined: Sun Jun 24, 2012 2:16 pm

Re: Ice Tube Clock Hacking

Post by jarchie »

Wait... SERIOUSLY?!?!

I just realized that Adafruit censors the word "ra"+"zor". But the phrase "raw & nasty" is completely OK!

User avatar
adafruit_support_mike
 
Posts: 67446
Joined: Thu Feb 11, 2010 2:51 pm

Re: Ice Tube Clock Hacking

Post by adafruit_support_mike »

It's a commercial spam filter, not a propriety filter. When HTC starts paying S.E.O. critters to astroturf the new "Raw&Nasty" phone, we'll probably filter that character sequence. ;-)

User avatar
jarchie
 
Posts: 615
Joined: Sun Jun 24, 2012 2:16 pm

Re: Ice Tube Clock Hacking

Post by jarchie »

Ah, that makes sense. And I apologize if my previous comment seemed more like a complaint. I only intended to highlight what I thought was amusing behavior. :-)

User avatar
adafruit_support_mike
 
Posts: 67446
Joined: Thu Feb 11, 2010 2:51 pm

Re: Ice Tube Clock Hacking

Post by adafruit_support_mike »

Not a problem.. you're hardly the first person to wonder why one byte pattern was flagged while another wasn't. From the 10,000 foot view, it's mildly interesting to see which keywords the vermin want to exploit over time.

User avatar
dougjohnson
 
Posts: 4
Joined: Fri Apr 12, 2013 2:09 pm

Re: Ice Tube Clock Hacking

Post by dougjohnson »

I'm think I'm finally ready to take this off the back burner. I've been reading a number the other threads on hacking the Ice Tube clock, but I'm still not clear on one thing. Will the Atmel AVR Dragon and WinAVR allow me to debug the Ice Tube clock AVR in the clock? -- Doug

User avatar
jarchie
 
Posts: 615
Joined: Sun Jun 24, 2012 2:16 pm

Re: Ice Tube Clock Hacking

Post by jarchie »

To be honest, I've never used DebugWIRE on the Ice Tube Clock or under Windows. I think it should work, however.

If no one gives you a definitive answer within the next few days, I'll try to find time to play with my Dragon and let you know what I discover.

My favorite debugging method for the Ice Tube Clock is to output text and numbers via USART and view the data on a computer with an Adafruit FTDI friend connected with IC hooks and jumper wire. I know that method is quite primitive, but it works well for me.

User avatar
dougjohnson
 
Posts: 4
Joined: Fri Apr 12, 2013 2:09 pm

Re: Ice Tube Clock Hacking

Post by dougjohnson »

The Wikipedia entry for DebugWIRE
http://en.wikipedia.org/wiki/DebugWIRE
claims it works with the Dragon, but I'd sure appreciate confirmation.
Thanks,
Doug

User avatar
jarchie
 
Posts: 615
Joined: Sun Jun 24, 2012 2:16 pm

Re: Ice Tube Clock Hacking

Post by jarchie »

If your question is "will DebugWIRE work with the Dragon?", the answer is "yes." Although I don't really use Windows, AVR Studio runs on Windows and is the Atmel-supported way to do DebugWIRE via the Dragon. If your goal is to buy a device capable of DebugWIRE, the Dragon fits the bill.

Unfortunately, I managed to convince myself not to try DebugWIRE on the Ice Tube Clock: Since the clock uses the microcontroller to regulate a boost circuit, breakpoints risk leaving the inductor connected to +5v, shorting the circuit. Less worryingly, the IV-18 display was designed to be multiplexed, and a triggered breakpoint would continuously drive a single digit--probably okay but pushing the limits of the display. Although DebugWIRE might technically work with the Ice Tube Clock, breakpoints might not be such a good idea, and that dramatically limits the usefulness of any debugger.

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

Return to “Clock Kits (discontinued)”