Another Ice Tube Clock Design for the Holidays

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
nix_clk_dd
 
Posts: 38
Joined: Tue May 21, 2019 2:15 pm

Re: Another Ice Tube Clock Design for the Holidays

Post by nix_clk_dd »

I ordered the boards in matte black from JLCPCB and will have a few extras (they are just now getting ready to ship to me).
If anyone needs a set, just let me know and I can send them to you. All I ask is that you cover the shipping cost which I think is a little less than $4.00 within the US.

:)

User avatar
nix_clk_dd
 
Posts: 38
Joined: Tue May 21, 2019 2:15 pm

Re: Another Ice Tube Clock Design for the Holidays

Post by nix_clk_dd »

Well...I'm still waiting for my PCBs in the mail and there are a couple parts that are back-ordered on DigiKey.

Maybe this is a question for another thread, but does anyone have any experience with building an enclosure for their electronics project out of wood? I really want to build one out of some type of hardwood but I want to go about it in the safest way.

User avatar
adafruit_support_bill
 
Posts: 88087
Joined: Sat Feb 07, 2009 10:11 am

Re: Another Ice Tube Clock Design for the Holidays

Post by adafruit_support_bill »

@nix_clk_dd - Best to start a fresh thread for your enclosure question. I'm happy to talk woodworking. But it is a bit off-topic for this thread. :)
posting.php?mode=post&f=41

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

Re: Another Ice Tube Clock Design for the Holidays

Post by jarchie »

Bill is right about a new thread. There are probably people with good advice on casing a project who are uninterested in my redesign work. Starting a new thread might get you more feedback.

But in specific reference to this project, forum user liljester put his Ice Tube Clocks in wooden cases. I think both builds used my firmware and one used my board redesign:
viewtopic.php?f=41&t=14769&start=180#p461459
viewtopic.php?f=41&t=14769&start=180#p557570

One of the tricks he used for the display mount was to ditch the side PCB, and run wires directly to the display header in the main board, as shown earlier in this thread: viewtopic.php?f=41&t=43836&p=472696#p472696

Just to be safe, I would also suggest allowing a way for heat to dissipate, perhaps through a metal base plate or alternatively cut some small vents in the back?

User avatar
nix_clk_dd
 
Posts: 38
Joined: Tue May 21, 2019 2:15 pm

Re: Another Ice Tube Clock Design for the Holidays

Post by nix_clk_dd »

jarchie wrote:Bill is right about a new thread. There are probably people with good advice on casing a project who are uninterested in my redesign work. Starting a new thread might get you more feedback.

But in specific reference to this project, forum user liljester put his Ice Tube Clocks in wooden cases. I think both builds used my firmware and one used my board redesign:
viewtopic.php?f=41&t=14769&start=180#p461459
viewtopic.php?f=41&t=14769&start=180#p557570

One of the tricks he used for the display mount was to ditch the side PCB, and run wires directly to the display header in the main board, as shown earlier in this thread: viewtopic.php?f=41&t=43836&p=472696#p472696

Just to be safe, I would also suggest allowing a way for heat to dissipate, perhaps through a metal base plate or alternatively cut some small vents in the back?
Thanks! I made a new thread in the suggested location and replied there.
Good news...PCBs are here and they look great in matte black! Now to wait on DigiKey.

Image

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

Re: Another Ice Tube Clock Design for the Holidays

Post by jarchie »

Wow, those are beautiful boards! And you officially have more boards than I do! ;-)

I've been following your thread on building a wooden case and am glad to see that you were able to get some good advice.

User avatar
nix_clk_dd
 
Posts: 38
Joined: Tue May 21, 2019 2:15 pm

Re: Another Ice Tube Clock Design for the Holidays

Post by nix_clk_dd »

jarchie wrote:Wow, those are beautiful boards! And you officially have more boards than I do! ;-)

I've been following your thread on building a wooden case and am glad to see that you were able to get some good advice.
I couldn’t help but to get 20 of each PCB because it was only $12 total :)

User avatar
jsandlin
 
Posts: 4
Joined: Sun Jul 14, 2019 5:40 pm

Re: Another Ice Tube Clock Design for the Holidays

Post by jsandlin »

I am building one of the Xmas ice tube clocks. I had the PCB's made by JLCPCB and they turned out great. lets start with I am in electronics but am a newbie at any kind of programming. I have WinAVR and cygwin64 installed on a windows 10 machine. After dats of searching and making changes to the path and other things I have gotton to one error that i just can't find a solution for. When I try to make the file to program I get an error:



> "make.exe" all
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
-DTIME_DEFAULT_SECOND=39 -DTIME_DEFAULT_MINUTE=30 -DTIME_DEFAULT_HOUR=17 -DTIME_DEFAULT_MDAY=14 -DTIME_DEFAULT_MONTH=7 -DTIME_DEFAULT_YEAR=19 -DTIME_DEFAULT_WDAY=0 -DTIME_DEFAULT_YDAY=194 -DTIME_DEFAULT_DST=1 -DTIME_DEFAULT_UTC_OFFSET_HOURS=-5 -DTIME_DEFAULT_UTC_OFFSET_MINUTES=0 -DTIME_DEFAULT_AUTODST=TIME_AUTODST_USA
./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
./util.pl time | xargs avr-gcc -c -I. -mmcu=atmega328p -std=gnu99 -Os -Wall -DF_CPU=8000000 -o gps.o gps.c
-DTIME_DEFAULT_SECOND=41 -DTIME_DEFAULT_MINUTE=30 -DTIME_DEFAULT_HOUR=17 -DTIME_DEFAULT_MDAY=14 -DTIME_DEFAULT_MONTH=7 -DTIME_DEFAULT_YEAR=19 -DTIME_DEFAULT_WDAY=0 -DTIME_DEFAULT_YDAY=194 -DTIME_DEFAULT_DST=1 -DTIME_DEFAULT_UTC_OFFSET_HOURS=-5 -DTIME_DEFAULT_UTC_OFFSET_MINUTES=0 -DTIME_DEFAULT_AUTODST=TIME_AUTODST_USA
./util.pl time | xargs 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-gcc: time.o: No such file or directory
avr-gcc: gps.o: No such file or directory
make.exe: *** [icetube.elf] Error 1

> Process Exit Code: 2
> Time Taken: 00:03



It seems that for some reason the files time.o and gps.o are not being created. if you could give me some advice on how to continue it would be appreciated.

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

Re: Another Ice Tube Clock Design for the Holidays

Post by jarchie »

I've seen this error when compiling with the Windows command prompt. Could that be the problem? If so, try using the BASH shell instead. BASH should have come with cygwin by default.

There is a Windows installation tutorial on the xmas-icetube wiki, here, which you might check out if you haven't already.

Also, when using my xmas-icetube redesign you'll need to make the appropriate changes to the firmware/config.h file before compiling. The easiest way to do this is to simply copy the already-configured hardware/config.h to the firmware/ directory, overwriting the existing config.h file. The original firmware/config.h file is configured for compatibility with the original Adafruit design.

User avatar
jsandlin
 
Posts: 4
Joined: Sun Jul 14, 2019 5:40 pm

Re: Another Ice Tube Clock Design for the Holidays

Post by jsandlin »

Thanks, that was it got away from windows command prompt and used the BASH shell that was installed with cygwin and it looks like it installed with no errors. I have to wait till next week to try it still waiting on a few parts to complete it.
I do have one more question that I hope you can help with I have several of the Atmega328-pu which when I try to program (make install-all) I get the error that the device id doesn't match use -F to over ride. I am assuming that this would go in the makefile? could you give me an example?

Thanks for your time

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

Re: Another Ice Tube Clock Design for the Holidays

Post by jarchie »

jsandlin wrote:Thanks, that was it got away from windows command prompt and used the BASH shell that was installed with cygwin and it looks like it installed with no errors.
Congratulations on successful compilation and installation!

The problem was that the Windows shell does not support the Unix-style pipes used in the Makefile, but BASH under Cygwin is able emulate pipes correctly. Pipes are used to set some default values when building time.o and gps.o, hence your particular problem. (If you don't come from a Unix background, a pipe is just one way to send the output of one program to the input of another.)
jsandlin wrote:I have several of the Atmega328-pu which when I try to program (make install-all) I get the error that the device id doesn't match use -F to over ride.
Unfortunately the xmas firmware does not support the ATMEGA328--only the ATMEGA328P. I've personally used the ATMEGA328P-PU and the ATMEGA328P-PN; the latter simply has a higher max operating temperature but is functionally identical.

The "P" in the ATMEGA328P identifier indicates support for Atmel's picoPower(tm) features. The xmas firmware and redesign uses this ultra-low power chip mode to help reduce sleep power consumption from 47 uA in the original Adafruit Ice Tube Clock to less than 2 uA in the xmas redesign. This extends the backup battery life from about five weeks without power to well over two years without power.

I understand where you're coming from, though. Most projects using the ATMEGA328P do not use the picoPower(tm) features, and forcing the programming of an ATMEGA328 will work fine in those cases. But this trick won't work with the xmas-icetube project.

User avatar
jsandlin
 
Posts: 4
Joined: Sun Jul 14, 2019 5:40 pm

Re: Another Ice Tube Clock Design for the Holidays

Post by jsandlin »

Thanks for the reply. I had never looked to see the differences between the 328 and the 328p. Over the years I have used them interchangeably with no problems but never used the power feature. That's good to know and will keep that in mind from here on out. I will post an update when all my parts come in. Again thanks for the help and making your design available.

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

Re: Another Ice Tube Clock Design for the Holidays

Post by jarchie »

jsandlin wrote:I had never looked to see the differences between the 328 and the 328p. Over the years I have used them interchangeably with no problems but never used the power feature.
Since you piqued my interest, I decided to look into the two chips a bit more, and I was partially mistaken in my last post.

According to the datasheet, the 328p has support for picoPower, which really amounts to the ability to disable the brown-out detection (BOD) during sleep without sacrificing chip reliability. Something that I did not notice before is that the 328p has two additional branch instructions (JMP and CALL) that the 328 does not. When I remove the picoPower code from my xmas firmware and compile it for the 328 and 328p, I get different bytecode, so the compiler does seem to be using the additional machine instructions supported by the 328p. This means that according to the datasheet the chips are meaningfully different.

Since adding support for the 328 looked pretty trivial, I decided to try it, and just pushed the new code to the xmas-icetube GitHub repository. In my clock, the 328 microcontroller current draw during sleep was around 21 uA due to the lack of picoPower support.

Just for kicks, I compiled xmas for the 328p and forced installation onto the 328. To my surprise the clock worked perfectly, and microcontroller current draw was back down to around 2 uA! That's the same as for the 328p with picoPower!

So according to the datasheet, any 328 firmware will work on the 328p, but several 328p features are not supported on the 328. But in practice it seems to work both ways! My guess is that somewhere along the line, Atmel stopped making the 328 with the original chip die and replaced it with a 328p die having the bytecode identifier of a 328. That would explain why 328p programs with 328p-specific features work on the 328 in practice. But this might not hold true for all 328 chips, since this support is not guaranteed in the datasheet.


Anyway, if you want to compile a version of my firmware that will work with the 328 as defined by the product datasheet, grab the latest copy from GitHub, and change the Makefile line specifying the AVRMCU macro to

Code: Select all

AVRMCU ?= atmega328
Then just recompile and reinstall. (The "make clean" ensures that any old compiled code gets deleted and doesn't cause problems.)

Code: Select all

$ make clean
$ make
$ make install-all
Alternatively, you could force installation of the 328p code to the 328. To do this, just leave the AVRMCU macro set to "atmega328p" but add the "-F" option to the AVRDUDEOPT macro to ignore the bytecode identifier and to force installation to the 328 chip.

Code: Select all

AVRDUDEOPT    ?= -F -B 4 -P usb -c $(AVRISP) -p $(AVRMCU)  # usbtiny & dragon_isp
Then just recompile and reinstall.

Code: Select all

$ make clean
$ make
$ make install-all
But keep in mind that forcing a 328p program onto a 328 chip is not officially supported by Atmel, and I suspect that doing so will fail on old 328 chips which probably do lack the features of the 328p. So your mileage might vary here, but it worked for me!
jsandlin wrote:Again thanks for the help and making your design available.
You're very welcome! I hope you enjoy it.

User avatar
jsandlin
 
Posts: 4
Joined: Sun Jul 14, 2019 5:40 pm

Re: Another Ice Tube Clock Design for the Holidays

Post by jsandlin »

Got all the parts in and assembled it and it works great. the case should be here next week so I can complete it. I have been building nixie and VFD tube clocks for a couple years now. Like I said before I am a complete novice at programming most of my programming come from using the Arduino IDE and looking at other programs a picking the parts that I want and adjusting them for my use. Most of my clocks use stand alone boost circuits which are not regulated . I like the boost and filaments driven off the CPU for better regulation and being able to change them with software. That being said would it be possible to accomplish this through the Arduino environment? could you point me to the section of your code that i might be able to convert for my uses?


clocks.jpg
clocks.jpg (260.67 KiB) Viewed 346 times

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

Re: Another Ice Tube Clock Design for the Holidays

Post by jarchie »

jsandlin wrote:Got all the parts in and assembled it and it works great. the case should be here next week so I can complete it.
Congratulations on a successful build! Thank you for sharing the picture.
jsandlin wrote:That being said would it be possible to accomplish this through the Arduino environment?
I don't know of any way to use the Arduino IDE and suspect it's not possible without a major redesign of the hardware and major rewrite of the code. Personally, I just edit the code files with a text editor and compile at the command prompt. Under Windows, Notepad++ is decent if you don't already have a favorite editor. I understand that the command line seems like a lot of trouble at first, but it becomes second nature pretty quick.
jsandlin wrote:I like the boost and filaments driven off the CPU for better regulation and being able to change them with software. [...] could you point me to the section of your code that i might be able to convert for my uses?
For many options, you shouldn't need to alter code directly. Instead, there are configuration macros in the firmware/config.h that will help. The config.h file has verbose comments explaining each option, so that's a good place to start. The display driver options are defined in the following sections of config.h:
  • DISPLAY BRIGHTNESS / BOOST CONFIGURATION
  • DISPLAY MULTIPLEXING ALGORITHM
  • IV-18 TO-SPEC HACK
  • TO-SPEC BRIGHTNESS ADJUSTMENT METHOD
  • TO-SPEC FILAMENT DRIVER METHOD
The xmas hardware revision that you built incorporates the to-spec hack, so all of the sections above can be used to change how the tube is driven in your clock.

On the off chance that you want to delve deep into the code, first read through icetube.c to understand the overall code design. Then, the display-related features are defined in display.h and display.c.

Anyway, good luck and happy hacking!

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

Return to “Clock Kits (discontinued)”