Idiots guide to flashing the ICe Tube

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
r17
 
Posts: 17
Joined: Mon Nov 09, 2009 3:54 am

Idiots guide to flashing the ICe Tube

Post by r17 »

Hi,

I am the aforementioned idiot :0.

I purchased an ICE Tube clock and much to my amazement actually managed to build it and have it work. I then decided the auto dimming feature looked like a great idea and so purchased the parts and a USBTiny from a UK reseller.

The problem occurs because I am a total amateur in electronics and would like to know how to flash the chip with the new firmware. I have the precompiled firmware available from this board, I have the USB tiny linked on R4 and R7, I have winavr installed but I dont know

a) the orientation of the 6 pin connector on the Ice Tube board I.e which is the pin 1, which I assume has the red marked wire from the USBtiny attached to it.

b) the command line for avrdude to transfer the .hex file to the internal microcontroller.

I am sure this is a particularly silly question but I cannot seem to find any information about how to complete this operation.

Many Thanks to any who can help.

Troubadix
 
Posts: 18
Joined: Fri Oct 09, 2009 1:09 pm

Re: Idiots guide to flashing the ICe Tube

Post by Troubadix »

a) There's a small on the silkscreen of the clock's PCB (look at the egde of the PCB between the connector and the microcontroller) Pin1 goes there.

b) avrdude -c usbtiny -p m168 -U flash:w:iv.hex or open the iv.c in Programmers Notepad and then click Tools --> [WinAVR] Program

User avatar
r17
 
Posts: 17
Joined: Mon Nov 09, 2009 3:54 am

Re: Idiots guide to flashing the ICe Tube

Post by r17 »

Thanks for the advice. I shall try and program the chip tonight

User avatar
chankster
 
Posts: 121
Joined: Mon Jul 06, 2009 12:59 am

Re: Idiots guide to flashing the ICe Tube

Post by chankster »

Make sure and disconnect the tube.

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

Re: Idiots guide to flashing the ICe Tube

Post by len17 »

Here's my procedure:
  • Install the USB power jumper on the USBtinyISP.
  • I found that I had to replace the USBtinyISP's R4 & R7 by jumpers to get it to work with the Ice Tube.
  • Before programming the clock, unplug the power supply and the vacuum tube.
  • Pin 1 on the ICSP connection is indicated by the red line on the cable and the dot on the clock board (as you guessed).
  • avrdude -p atmega168 -c usbtiny -B 1 -U flash:w:iv.hex

User avatar
r17
 
Posts: 17
Joined: Mon Nov 09, 2009 3:54 am

Re: Idiots guide to flashing the ICe Tube

Post by r17 »

Thanks for all the tips, do you have to remove the battery back up or is that not required ?

jsgf
 
Posts: 61
Joined: Mon Oct 26, 2009 1:21 am

Re: Idiots guide to flashing the ICe Tube

Post by jsgf »

r17 wrote:Thanks for all the tips, do you have to remove the battery back up or is that not required ?
I find I just have to remove the tube to program; I keep power and battery attached with no obvious problems. If I don't remove the tube the programmer can't detect the AVR.

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

Re: Idiots guide to flashing the ICe Tube

Post by len17 »

r17 wrote:Thanks for all the tips, do you have to remove the battery back up or is that not required ?
I've been leaving the battery in, with no problems.

User avatar
joerg_daehn
 
Posts: 30
Joined: Tue Oct 13, 2009 6:39 pm

Re: Idiots guide to flashing the ICe Tube

Post by joerg_daehn »

r17, you are by no means an idiot.

I am also. First time soldering, first time flashing ATMEGAs.

But today something great happened: the USBtiny arrived and after doing something for work I decided to reward myself: I threw it together, connected it to the Icetube clock-board, fired up avrdude using

Code: Select all

avrdude -c usbtiny -p atmega168  -B 1 -U flash:w:iv.hex 
trying to flash jsgf's firmware and got a loud beep and it told me

Code: Select all

avrdude: Setting SCK period to 1 usec
avrdude: initialization failed, rc=-1
         Double check connections and try again, or use -F to override
         this check.
Then I read a lot, especially: http://www.ladyada.net/make/usbtinyisp/help.html and altered "B 1" to "B 32":

Code: Select all

avrdude -c usbtiny -p atmega168  -B 32 -U flash:w:iv.hex
And got:

Code: Select all

avrdude: Setting SCK period to 32 usec
avrdude: AVR device initialized and ready to accept instructions

Reading | ################################################## | 100% 0.01s

avrdude: Device signature = 0x1e9406
avrdude: NOTE: FLASH memory has been specified, an erase cycle will be performed
         To disable this feature, specify the -D option.
avrdude: erasing chip
avrdude: Setting SCK period to 32 usec
avrdude: reading input file "iv.hex"
avrdude: input file iv.hex auto detected as Intel Hex
avrdude: writing flash (9324 bytes):

Writing | ################################################## | 100% 40.78s



avrdude: 9324 bytes of flash written
avrdude: verifying flash memory against iv.hex:
avrdude: load data flash data from input file iv.hex:
avrdude: input file iv.hex auto detected as Intel Hex
avrdude: input file iv.hex contains 9324 bytes
avrdude: reading on-chip flash data:

Reading | ################################################## | 100% 25.31s



avrdude: verifying ...
avrdude: 9324 bytes of flash verified

avrdude: safemode: Fuses OK

avrdude done.  Thank you.
So it worked. Flawless!

Hope you get it done, too.

@jsgf:

jsgf, you are awesome! (well, not as awesome as limor, but close) I have to thank you very much for your excellent firmware which crashes no more and has very nice scolling and logical menues.
With the briteness options for day and night I am even reconsidering doing the fotoresistor mod.

Best regards from Hannover,

J. Daehn
Last edited by joerg_daehn on Wed Dec 02, 2009 12:01 pm, edited 2 times in total.

User avatar
joerg_daehn
 
Posts: 30
Joined: Tue Oct 13, 2009 6:39 pm

Re: Idiots guide to flashing the ICe Tube

Post by joerg_daehn »

Ah, well and I didn't have to remove any resistors anywhere. Just took apart the clock, took out the battery, set the USBtiny jumper to power USB and voila, it worked. Hurray!

J. Daehn

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

Re: Idiots guide to flashing the ICe Tube

Post by adafruit »

great work guys! if you want to program faster, you can try smaller values for -B

User avatar
r17
 
Posts: 17
Joined: Mon Nov 09, 2009 3:54 am

Re: Idiots guide to flashing the ICe Tube

Post by r17 »

I flashed jgsf firmware to the clock this morning with great success. Thanks all for the information it made the entire job easy and thanks to all the 3rd party firmware devs, its great to see such interesting features being added

User avatar
mcsarge
 
Posts: 32
Joined: Sat Oct 17, 2009 2:19 pm

Re: Idiots guide to flashing the ICe Tube

Post by mcsarge »

If anyone is using Eclipse with the AVR Eclipse Plugin ( http://avr-eclipse.sourceforge.net) then you need to set the "JTAG ICE Bitclock" setting in the project properties (under AVR) to 32. This is the same thing as using the -B 32 in the avrdude command line. Here is a screen shot:

http://picasaweb.google.com/lh/photo/T6 ... directlink

After I did that I could use the plugin to program the clock.

I programmed it with the USBTinyISP with the power jumper OFF, the clock plugged in and the display tube removed.

Matt

vpapanik
 
Posts: 17
Joined: Mon Dec 17, 2007 4:02 pm

Re: Idiots guide to flashing the ICe Tube

Post by vpapanik »

and what about the fuses ? default is 1 Mhz clock but in Makefile it says CKDIV8 = 1 (8 Mhz clock) !

$(AVRDUDE) $(AVRDUDE_FLAGS) -u -U lfuse:w:0xE2:m -u -U hfuse:w:0xc6:m

does it play a significant role on the clock performance ? I left it default (1 Mhz) and the clock
works ok (but the initial beep is longer !!!).

Please help on this ! Thanks !

User avatar
mcsarge
 
Posts: 32
Joined: Sat Oct 17, 2009 2:19 pm

Re: Idiots guide to flashing the ICe Tube

Post by mcsarge »

I think Limor needs to answer this, but I think you need to make sure you are using the external clock, since it is using the special crystal. I have left the fuses alone on my unit and just changed the programming...

Matt

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

Return to “Clock Kits (discontinued)”