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.
Idiots guide to flashing the ICe Tube
Moderators: adafruit_support_bill, adafruit
Please be positive and constructive with your questions and comments.
-
- Posts: 18
- Joined: Fri Oct 09, 2009 1:09 pm
Re: Idiots guide to flashing the ICe Tube
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
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
- r17
- Posts: 17
- Joined: Mon Nov 09, 2009 3:54 am
Re: Idiots guide to flashing the ICe Tube
Thanks for the advice. I shall try and program the chip tonight
- chankster
- Posts: 121
- Joined: Mon Jul 06, 2009 12:59 am
Re: Idiots guide to flashing the ICe Tube
Make sure and disconnect the tube.
- len17
- Posts: 394
- Joined: Sat Mar 14, 2009 7:20 pm
Re: Idiots guide to flashing the ICe Tube
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
- r17
- Posts: 17
- Joined: Mon Nov 09, 2009 3:54 am
Re: Idiots guide to flashing the ICe Tube
Thanks for all the tips, do you have to remove the battery back up or is that not required ?
-
- Posts: 61
- Joined: Mon Oct 26, 2009 1:21 am
Re: Idiots guide to flashing the ICe Tube
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.r17 wrote:Thanks for all the tips, do you have to remove the battery back up or is that not required ?
- len17
- Posts: 394
- Joined: Sat Mar 14, 2009 7:20 pm
Re: Idiots guide to flashing the ICe Tube
I've been leaving the battery in, with no problems.r17 wrote:Thanks for all the tips, do you have to remove the battery back up or is that not required ?
- joerg_daehn
- Posts: 30
- Joined: Tue Oct 13, 2009 6:39 pm
Re: Idiots guide to flashing the ICe Tube
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
trying to flash jsgf's firmware and got a loud beep and it told me
Then I read a lot, especially: http://www.ladyada.net/make/usbtinyisp/help.html and altered "B 1" to "B 32":
And got:
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
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
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.
Code: Select all
avrdude -c usbtiny -p atmega168 -B 32 -U flash:w:iv.hex
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.
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.
- joerg_daehn
- Posts: 30
- Joined: Tue Oct 13, 2009 6:39 pm
Re: Idiots guide to flashing the ICe Tube
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
J. Daehn
-
- Posts: 12151
- Joined: Thu Apr 06, 2006 4:21 pm
Re: Idiots guide to flashing the ICe Tube
great work guys! if you want to program faster, you can try smaller values for -B
- r17
- Posts: 17
- Joined: Mon Nov 09, 2009 3:54 am
Re: Idiots guide to flashing the ICe Tube
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
- mcsarge
- Posts: 32
- Joined: Sat Oct 17, 2009 2:19 pm
Re: Idiots guide to flashing the ICe Tube
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
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
-
- Posts: 17
- Joined: Mon Dec 17, 2007 4:02 pm
Re: Idiots guide to flashing the ICe Tube
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 !
$(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 !
- mcsarge
- Posts: 32
- Joined: Sat Oct 17, 2009 2:19 pm
Re: Idiots guide to flashing the ICe Tube
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
Matt
Please be positive and constructive with your questions and comments.