Black Lives Matter - Action and Equality. ... Adafruit is open and shipping.
0

Another Ice Tube Clock Design for the Holidays
Moderators: adafruit_support_bill, adafruit

Please be positive and constructive with your questions and comments.

Re: Another Ice Tube Clock Design for the Holidays

by Russell 27 on Fri Nov 08, 2013 6:31 pm

Any chance you can just post that hex?

I can still use transistor Push Pulls with this YES?
Russell 27
 
Posts: 240
Joined: Thu Sep 12, 2013 3:59 pm

Re: Another Ice Tube Clock Design for the Holidays

by jarchie on Fri Nov 08, 2013 7:22 pm

It's generally better to compile the firmware yourself, so you can customize the compile-time options (which includes whether-or-not to use the "to-spec" hack). Check out config.h to see the available compile-time options.

But I have attached a compiled firmware version using the default configuration settings for the xmas-icetube hardware revision. It can be programmed with an Adafruit USBtinyISP and avrdude:

Code: Select all | TOGGLE FULL SIZE
avrdude -B 4 -P usb -c usbtiny -p atmega328p -u -U lfuse:w:0x62:m -u -U hfuse:w:0xD1:m -u -U efuse:w:0x06:m -U flash:w:icetube_flash.hex:i -U eeprom:w:icetube_eeprom.hex:i -U lock:w:0x2B:m
Attachments
xmas-bede7b3d84.zip
Compiled xmas-icetube firmware for the xmas-icetube hardware revision. These files are *not* compatible with the Adafruit Ice Tube Clock kit.
(26.69 KiB) Downloaded 142 times
Last edited by jarchie on Sat Nov 09, 2013 3:31 pm, edited 1 time in total.
--John <www.jarchie.com/email>

jarchie
 
Posts: 595
Joined: Sun Jun 24, 2012 2:16 pm
Location: Santa Cruz, California, United States

Re: Another Ice Tube Clock Design for the Holidays

by Russell 27 on Sat Nov 09, 2013 3:10 pm

Thanks

I understand your sentiment, but I don't fully understand how to compile the way you do, and I have to sit down and work that out, this is second nature to you. I'm sure this will benefit others in the same place. Often times a compiled .hex is in the code, and I just wanted to flash easily and give a try, besides I know it's done right. I also like to flash manually, Installing the fuse bits, flash and eeprom from the designated file myself. I don't have what I consider decent P channel mosfets, so I'm just going to use transistors. The rest I'll go by your circuit.


Russell
Last edited by Russell 27 on Sun Nov 10, 2013 9:24 am, edited 1 time in total.
Russell 27
 
Posts: 240
Joined: Thu Sep 12, 2013 3:59 pm

Re: Another Ice Tube Clock Design for the Holidays

by phild13 on Sat Nov 09, 2013 5:35 pm

Yes you can still use the transistors if desired for the push pull as R7 and R8 places are still there. To use with the transistors, populate R7 and R8, to use with FETs jumper R7 and R8.

Compiling your own .hex files is really easy and this is basically the way I do it.

The environment
I installed WinAVR and Cygwin as John described. Installing WinAVR will install AVRDude and make the proper system links. I also installed avrdudess as a graphical interface to AVRDude (be aware that it uses it's own avrdude and not the one from WinAVR).
Cygwin will enable the use of perl scripts which the firmware uses at compile time.
Since Windows does not come with a standard set of Unix/Linux tools, you'll need to install those as well. I recommend Cygwin. When the installer prompts you with a list of packages to install, change the Perl group from "Default" to "Install." Why? Both Adafruit's firmware and xmas-icetube use Perl scripts during compilation, and other alternative firmwares probably do the same.

More info on the entire process here:
viewtopic.php?f=41&t=42047#p209831


Open config.h in notepad++ (text editor) and decide on options you want to enable or disable and save the file.
Open the Cygwin terminal window and change to the directory where your icetube firmware files are located
enter the command Make and wait until it is done. This compiles the .hex files: icetube_flash.hex and icetube_eeprom.hex
If the environment is setup correctly the files will compile without errors

properly connect the usbtinyisp to the clock.
Now enter the commands to install the firmware to the chip (they can be both done at once, but lets do it the easy way first:
Enter make install-fuse and press return
Avrdude should go to work and return an indication that each command was successful

Enter make install or make install-all if you want to set the lock bits
Avrdude should go to work and return an indication that it was successful

You can also usethe avedude graphical interface avrdudess (it is cool to mess with as you can copy the commands it generates) to install the icetube_flash.hex and the icetube_eeprom.hex, but I find it simple to just use the command line to install the firmware.

Have fun with the new firmware.

Edit: most firmware comes with default .hex files the author compiled for you. Those can be uploaded and will work but may have options not enabled/disabled you may want/not want. If you want to make option changes, you need to alter the config.h file, and recompile the firmware which will overwrite the precompiled hex files.

phild13
 
Posts: 247
Joined: Mon Sep 10, 2012 1:05 pm

Re: Another Ice Tube Clock Design for the Holidays

by Russell 27 on Sun Nov 10, 2013 9:42 am

Thanks

I had already installed Cygwin and Notepad ++, I still like plain old notepad for viewing.

So All I have to do once I make changes to config .h, which I understand, is type make file command. Any chance you could Print out an example command line. I read all the other stuff you had suggested earlier on John's page, there is a big line of commands there and that's where I wasn't sure how to type the actual command. Being a windows user my command line skills are lacking.
Russell 27
 
Posts: 240
Joined: Thu Sep 12, 2013 3:59 pm

Re: Another Ice Tube Clock Design for the Holidays

by jarchie on Sun Nov 10, 2013 6:36 pm

Russell 27 wrote:So All I have to do once I make changes to config.h, which I understand, is type make file command.

If you downloaded and unzipped the firmware to C:\Users\jarchie\Downloads\xmas-icetube-master\firmware\, you would open the Cygwin Terminal and type:

Code: Select all | TOGGLE FULL SIZE
cd /cygdrive/c/Users/jarchie/Downloads/xmas-icetube-master/firmware/
make
make install-all

But you will see the command prompts ("$ "), the commands you typed, the commands make executed for you, and the output of those commands:

Code: Select all | TOGGLE FULL SIZE

jarchie@andromeda ~
$ cd /cygdrive/c/Users/jarchie/Downloads/xmas-icetube-master/firmware/

jarchie@andromeda /cygdrive/c/Users/jarchie/Downloads/xmas-icetube-master/firmware
$ make
avr-gcc -c -I. -mmcu=atmega328p -std=gnu99 -Os -Wall -DF_CPU=8000000  -o icetube.o icetube.c
avr-gcc -MM -I. -mmcu=atmega328p -std=gnu99 -Os -Wall -DF_CPU=8000000  icetube.c > icetube.d
avr-gcc -c -I. -mmcu=atmega328p -std=gnu99 -Os -Wall -DF_CPU=8000000  -o system.o system.c
avr-gcc -MM -I. -mmcu=atmega328p -std=gnu99 -Os -Wall -DF_CPU=8000000  system.c > system.d
./util.pl time | xargs avr-gcc -c -I. -mmcu=atmega328p -std=gnu99 -Os -Wall -DF_CPU=8000000  -o time.o time.c
./util.pl time | xargs avr-gcc -MM -I. -mmcu=atmega328p -std=gnu99 -Os -Wall -DF_CPU=8000000  time.c > time.d
avr-gcc -c -I. -mmcu=atmega328p -std=gnu99 -Os -Wall -DF_CPU=8000000  -o alarm.o alarm.c
avr-gcc -MM -I. -mmcu=atmega328p -std=gnu99 -Os -Wall -DF_CPU=8000000  alarm.c > alarm.d
avr-gcc -c -I. -mmcu=atmega328p -std=gnu99 -Os -Wall -DF_CPU=8000000  -o piezo.o piezo.c
avr-gcc -MM -I. -mmcu=atmega328p -std=gnu99 -Os -Wall -DF_CPU=8000000  piezo.c > piezo.d
avr-gcc -c -I. -mmcu=atmega328p -std=gnu99 -Os -Wall -DF_CPU=8000000  -o display.o display.c
avr-gcc -MM -I. -mmcu=atmega328p -std=gnu99 -Os -Wall -DF_CPU=8000000  display.c > display.d
avr-gcc -c -I. -mmcu=atmega328p -std=gnu99 -Os -Wall -DF_CPU=8000000  -o buttons.o buttons.c
avr-gcc -MM -I. -mmcu=atmega328p -std=gnu99 -Os -Wall -DF_CPU=8000000  buttons.c > buttons.d
avr-gcc -c -I. -mmcu=atmega328p -std=gnu99 -Os -Wall -DF_CPU=8000000  -o mode.o mode.c
avr-gcc -MM -I. -mmcu=atmega328p -std=gnu99 -Os -Wall -DF_CPU=8000000  mode.c > mode.d
avr-gcc -c -I. -mmcu=atmega328p -std=gnu99 -Os -Wall -DF_CPU=8000000  -o usart.o usart.c
avr-gcc -MM -I. -mmcu=atmega328p -std=gnu99 -Os -Wall -DF_CPU=8000000  usart.c > usart.d
avr-gcc -c -I. -mmcu=atmega328p -std=gnu99 -Os -Wall -DF_CPU=8000000  -o gps.o gps.c
avr-gcc -MM -I. -mmcu=atmega328p -std=gnu99 -Os -Wall -DF_CPU=8000000  gps.c > gps.d
avr-gcc -c -I. -mmcu=atmega328p -std=gnu99 -Os -Wall -DF_CPU=8000000  -o temp.o temp.c
avr-gcc -MM -I. -mmcu=atmega328p -std=gnu99 -Os -Wall -DF_CPU=8000000  temp.c > temp.d
avr-gcc -I. -mmcu=atmega328p -std=gnu99 -Os -Wall -DF_CPU=8000000  -o icetube.elf icetube.o system.o time.o alarm.o piezo.o display.o buttons.o mode.o usart.o gps.o temp.o
avr-objcopy  -R.eeprom -R.fuse -R.lock -O ihex icetube.elf icetube_flash.hex
avr-objcopy  -j .eeprom -O ihex icetube.elf icetube_eeprom.hex
avr-objcopy  -j.fuse -O ihex icetube.elf icetube_fuse.hex
avr-objcopy  -j.lock -O ihex icetube.elf icetube_lock.hex

ATMEGA328P MEMORY USAGE SUMMARY

Program memory (FLASH):   70%    (23172/32768)
Preallocated SRAM:         5%    (  119/ 2048)
Allocated EEPROM:          5%    (   59/ 1024)


jarchie@andromeda /cygdrive/c/Users/jarchie/Downloads/xmas-icetube-master/firmware
$ make install-all
avrdude -B 4 -P usb -c usbtiny -p atmega328p -u -U lfuse:w:0x62:m -u -U hfuse:w:0xD1:m -u -U efuse:w:0x06:m -U flash:w:icetube_flash.hex:i -U eeprom:w:icetube_eeprom.hex:i -U lock:w:0x2B:m

avrdude: AVR device initialized and ready to accept instructions

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

avrdude: Device signature = 0x1e950f
avrdude: NOTE: FLASH memory has been specified, an erase cycle will be performed
         To disable this feature, specify the -D option.
avrdude: current erase-rewrite cycle count is -65536 (if being tracked)
avrdude: erasing chip
avrdude: reading input file "0x62"
avrdude: writing lfuse (1 bytes):

Writing | ################################################## | 100% 0.00s

avrdude: 1 bytes of lfuse written
avrdude: verifying lfuse memory against 0x62:
avrdude: load data lfuse data from input file 0x62:
avrdude: input file 0x62 contains 1 bytes
avrdude: reading on-chip lfuse data:

Reading | ################################################## | 100% 0.00s

avrdude: verifying ...
avrdude: 1 bytes of lfuse verified
avrdude: reading input file "0xD1"
avrdude: writing hfuse (1 bytes):

Writing | ################################################## | 100% 0.00s

avrdude: 1 bytes of hfuse written
avrdude: verifying hfuse memory against 0xD1:
avrdude: load data hfuse data from input file 0xD1:
avrdude: input file 0xD1 contains 1 bytes
avrdude: reading on-chip hfuse data:

Reading | ################################################## | 100% 0.00s

avrdude: verifying ...
avrdude: 1 bytes of hfuse verified
avrdude: reading input file "0x06"
avrdude: writing efuse (1 bytes):

Writing | ################################################## | 100% 0.00s

avrdude: 1 bytes of efuse written
avrdude: verifying efuse memory against 0x06:
avrdude: load data efuse data from input file 0x06:
avrdude: input file 0x06 contains 1 bytes
avrdude: reading on-chip efuse data:

Reading | ################################################## | 100% 0.00s

avrdude: verifying ...
avrdude: 1 bytes of efuse verified
avrdude: reading input file "icetube_flash.hex"
avrdude: writing flash (23278 bytes):

Writing | ################################################## | 100% 7.89s



avrdude: 23278 bytes of flash written
avrdude: verifying flash memory against icetube_flash.hex:
avrdude: load data flash data from input file icetube_flash.hex:
avrdude: input file icetube_flash.hex contains 23278 bytes
avrdude: reading on-chip flash data:

Reading | ################################################## | 100% 6.21s



avrdude: verifying ...
avrdude: 23278 bytes of flash verified
avrdude: reading input file "icetube_eeprom.hex"
avrdude: writing eeprom (61 bytes):

Writing | ################################################## | 100% 0.24s



avrdude: 61 bytes of eeprom written
avrdude: verifying eeprom memory against icetube_eeprom.hex:
avrdude: load data eeprom data from input file icetube_eeprom.hex:
avrdude: input file icetube_eeprom.hex contains 61 bytes
avrdude: reading on-chip eeprom data:

Reading | ################################################## | 100% 0.02s



avrdude: verifying ...
avrdude: 61 bytes of eeprom verified
avrdude: reading input file "0x2B"
avrdude: writing lock (1 bytes):

Writing | ################################################## | 100% 0.01s

avrdude: 1 bytes of lock written
avrdude: verifying lock memory against 0x2B:
avrdude: load data lock data from input file 0x2B:
avrdude: input file 0x2B contains 1 bytes
avrdude: reading on-chip lock data:

Reading | ################################################## | 100% 0.00s

avrdude: verifying ...
avrdude: 1 bytes of lock verified

avrdude done.  Thank you.


jarchie@andromeda /cygdrive/c/Users/jarchie/Downloads/xmas-icetube-master/firmware
$
--John <www.jarchie.com/email>

jarchie
 
Posts: 595
Joined: Sun Jun 24, 2012 2:16 pm
Location: Santa Cruz, California, United States

Re: Another Ice Tube Clock Design for the Holidays

by phild13 on Sun Nov 10, 2013 8:15 pm

While this may be a bit overboard for what you want or need, I have attached a text file of the output from cygwin terminal and AVRDude session for each of the commands that I list.Take a look at it as I think seeing the actual output from a session would be informative. I am using windows 7 on a Dell laptop.

Here are the commands I used:

Code: Select all | TOGGLE FULL SIZE
cd /cygdrive/c/data/xmas_firmware
make
make install-fuse
make install
optionally you can use the command make install-all with the newer xmas_firmware

You need to include the /cygdrive in the change directory command.


Also, optionally you can use the following example to verify what was written to
the chip even though it was verified after writing as you can see from the output. Change the path to the path of your .hex files.
I included the command and output so you can see what it looks like. Verifying this way can be handy sometimes and is why I included the command.

Code: Select all | TOGGLE FULL SIZE
avrdude -c usbtiny -p m328p -U flash:v:"C:\Data\xmas_firmware\icetube_flash.hex":a -U eeprom:v:"C:\Data\xmas_firmware\icetube_eeprom.hex":a;



Note: The above commands will also work from a windows terminal window if everything is set up correctly. The path in the verify command would be changed to the file name only and not the full path as indicated above.
Attachments
avrdude output.txt
Cygwin terminal windoe AVRDude output. Programming a ATMega 328P-PU chip with xmas_firmware for the icetube clock.
(8.54 KiB) Downloaded 131 times

phild13
 
Posts: 247
Joined: Mon Sep 10, 2012 1:05 pm

Re: Another Ice Tube Clock Design for the Holidays

by Russell 27 on Mon Nov 11, 2013 8:11 am

Thank you both for fine tuning this, I didn't type the cd /cygdrive/c/data/xmas_firmware.

Russell
Russell 27
 
Posts: 240
Joined: Thu Sep 12, 2013 3:59 pm

Re: Another Ice Tube Clock Design for the Holidays

by ukewarrior on Fri Jan 10, 2014 2:45 pm

Do you have a set of Gerbers for this PCB?

Seeed and others run specials from time to time that are much less than even OSHpark.

Thanks.
ukewarrior
 
Posts: 11
Joined: Thu Jan 09, 2014 10:38 am

Re: Another Ice Tube Clock Design for the Holidays

by phild13 on Fri Jan 10, 2014 4:58 pm

Same as at Adafruits GitHub site, John's github site has the Eagle files needed to make the boards. https://github.com/johngarchie/xmas-ice ... r/hardware
You can use the free version of Eagle Cad and generate Gerber files for other board houses, but I don't think there is a set of gerber files anywhere for Johna boards.

phild13
 
Posts: 247
Joined: Mon Sep 10, 2012 1:05 pm

Re: Another Ice Tube Clock Design for the Holidays

by jarchie on Fri Jan 10, 2014 5:10 pm

ukewarrior wrote:Do you have a set of Gerbers for this PCB?

Phil is correct; I never generated any Gerbers for these boards. I do know that Eagle provides options to generate Gerbers, but I don't know how to do that. Googling "Eagle to Gerber tutorial" reveals a lot of hits, so that might be a good place to start. But if you run into trouble, I'd be willing to give it a go.

ukewarrior wrote:Seeed and others run specials from time to time that are much less than even OSHpark.

Thanks for the information; OSH Park is definitely on the expensive side. But they use an American fab which is required to handle all those nasty chemicals responsibly and provide good working conditions. They also have a pretty quick turn-around and superb quality control. For me, that makes OSH Park my fab of choice.

Also, OSH Park sent me some free revision D boards because they had cosmetic damage; the corner was chipped. I'd be willing to send you one of those for the price of shipping. If that interests you, email me privately.
--John <www.jarchie.com/email>

jarchie
 
Posts: 595
Joined: Sun Jun 24, 2012 2:16 pm
Location: Santa Cruz, California, United States

Re: Another Ice Tube Clock Design for the Holidays

by rcb on Mon Jan 13, 2014 4:02 pm

Hi John,
I was gearing up to build a clock w/ all of your fine mods (Rev D boards being fabbed now by OSH, etc.), and
I had 2 (probably dumb) questions:

1. Do you jumper R7 and R8 or not on the Rev D board? (The BOM & schematic still has R7 and R8, so my guess is -- not)
2. On the underside of the rev D board -- it's clear how to use the 3 pts for the GPS, but it wasn't entirely
clear to me re pts 'BATT' and 'TOSC1' ('BATT' for GPS battery power...but how about TOSC1?)

Thanks! Best wishes.
rcb
 
Posts: 24
Joined: Sun Sep 15, 2013 6:25 pm

Re: Another Ice Tube Clock Design for the Holidays

by jarchie on Mon Jan 13, 2014 6:47 pm

rcb wrote:I had 2 (probably dumb) questions:

Your questions aren't dumb at all!

rcb wrote:1. Do you jumper R7 and R8 or not on the Rev D board? (The BOM & schematic still has R7 and R8, so my guess is -- not)

You are correct. The R7 and R8 resistors that were in revision A-C have been removed. In revision D, R7 and R8 have a different function--to provide a voltage reference for the LM317. Jumpering R7 and R8 in revision D will short the LM317 regulator output to ground, and since the LM317 is used as part of the VFD filament power supply, the tube would not light.

rcb wrote:2. On the underside of the rev D board -- it's clear how to use the 3 pts for the GPS, but it wasn't entirely clear to me re pts 'BATT' and 'TOSC1' ('BATT' for GPS battery power...but how about TOSC1?)

When I use the GPS mod, I only use three points--the 5v regulator voltage (Vreg), ground (GND), and GPS data (RX).

Optionally, you can use the clock battery (BATT) for the GPS battery backup. The advantage is in reacquiring a GPS lock: After sleep, the GPS will reacquire a lock within seconds instead of minutes, and the GPS will reacquire a lock more reliably in areas with poor signal reception. The disadvantage is battery life: The Adafruit Ultimate GPS module will consume ~7 uA during sleep, increasing total current from ~2 uA to ~9 uA. So instead of around two years of sleep, you would have several months. For reference an original, unmodified Adafruit Ice Tube Clock v1.1 consumes ~50 uA during sleep.

The TOSC1 marking is for installing a DS32kHz hardware TCXO instead of the crystal oscillator and temperature sensor combination. So just ignore TOSC1 for the purposes of the GPS mod.

Good luck and happy hacking!
--John <www.jarchie.com/email>

jarchie
 
Posts: 595
Joined: Sun Jun 24, 2012 2:16 pm
Location: Santa Cruz, California, United States

Re: Another Ice Tube Clock Design for the Holidays

by rcb on Tue Jan 14, 2014 11:12 am

Thanks John! You are so helpful and quick as usual!
Now all we need is reliable external temperature... I suppose one could put the sensor on a
pigtail lead & run it outside to the bottom...but I guess then it can't do its other job?
Best wishes.
rcb
 
Posts: 24
Joined: Sun Sep 15, 2013 6:25 pm

Re: Another Ice Tube Clock Design for the Holidays

by phild13 on Tue Jan 14, 2014 12:26 pm

If you drilled a hole in the proper place in the case bottom plate and installed the temp sensor correctly on the bottom of the board, make the top of it flush with the hole, or stick out slightly, it would provide a reasonably accurate outside case temp. The temp sensor as it is now being used is reading the inside case temp, making the clocks time keeping more accurate.

phild13
 
Posts: 247
Joined: Mon Sep 10, 2012 1:05 pm

Please be positive and constructive with your questions and comments.