Voting resources, early voting, and poll worker information - VOTE. ... Adafruit is open and shipping.
0

ICE Tube Clock Firmware Comparison
Moderators: adafruit_support_bill, adafruit

Please be positive and constructive with your questions and comments.

Re: ICE Tube Clock Firmware Comparison

by jarchie on Tue Mar 12, 2013 7:17 pm

Can anyone point me to a link that will give me info on compiling these firmware packages the ICE Tube Clock?


I am not aware of any such resource. If you have an ATMEGA328P-PU, I would recommend playing with my firmware. It has installation instructions, compiles cleanly, and the code is clearly written.

Some of the older firmware projects no longer compile on recent versions of GCC, so the code will need to be modified in order for them to compile. This is the procedure I used to get the Adafruit code to compile and run on my clock. The procedure for older firmware projects based on the Adafruit code should be similar.

EDIT: The version of GCC that comes with WinAVR is quite old, and these firmwares probably do compile just fine in that environment.

First, the original Adafruit Ice Tube Clock code defines several pointers in program memory which are not declared as constants. These pointers are alphatable_p and numbertable_p in fonttable.h as well as digittable_p and segmenttable_p in iv.c. Recent versions of GCC do not allow nonconstant program memory pointers, so each of these pointers must be declared constant. For example, the definition of alphatable_p should be changed to

Code: Select all | TOGGLE FULL SIZE
PGM_P const alphatable_p PROGMEM = alphatable;


Second, interrupt names in the original firmware have been deprecated and should be changed to their nondeprecated counterparts. Current and deprecated interrupt names are listed in the avr-libc documentation. Different firmwares may use different interrupts, but the following interrupt name changes were required for the Adafruit GPS firmware:

  • SIG_OVERFLOW0 -> TIMER0_OVF_vect
  • SIG_PIN_CHANGE2 -> PCINT2_vect
  • SIG_PIN_CHANGE0 -> PCINT0_vect
  • SIG_INTERRUPT0 -> INT0_vect
  • SIG_COMPARATOR -> ANALOG_COMP_vect

After these changes, the firmware should compile with the "make" command. The next step is to program the chip, so open the Makefile and make sure the avrdude programmer variables are set correctly. The following settings worked for me with with the Adafruit USBtinyISP:

Code: Select all | TOGGLE FULL SIZE
AVRDUDE_PROGRAMMER = usbtiny
AVRDUDE_PORT = usb


On the Ice Tube Clock, set the brightness to minimum. Unplug the clock and disassemble the case. Remove the side PCB and VFD tube. If using a USBtinyISP, disconnect the power jumper. Reconnect the clock's power adapter and connect your AVR ISP programmer, ensuring PIN 1 on the ISP cable and PIN 1 on the Ice Tube Clock ISP header match. Install the new firmware to the Ice Tube Clock's ATMEGA168V chip by executing the "make full" command.

Porting a firmware to the ATMEGA328P-PU is described in another thread.

Hope that helps. 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: ICE Tube Clock Firmware Comparison

by windy48 on Sat Nov 26, 2016 5:42 am

Cool ICE Tube Clock,waiting for your complete.
Cause anyway I don't have any source of this.


Customized Anime Girl Case Fashion Cover For Ipad Air/Air 2

windy48
 
Posts: 3
Joined: Sat Nov 26, 2016 4:27 am

Re: ICE Tube Clock Firmware Comparison

by Volodya on Sat Feb 16, 2019 11:45 am

Hi. Please help me to solve the problem with compiling HEX files for ATMega328p firmware for your Ice Tube Clock project. I downloaded the source files (in the attachment), but I can not compile them - the command "Make" is interrupted with an error when processing the file time.If you still have ready HEX files for version (revision) "D" please send them to my e-mail (voyajer@gmail.com). I would be very grateful. Thank you in advance. Sincerely, Vladimir.
The log of the command "Make":
Code: Select all | TOGGLE FULL SIZE

orangepiplus:~/Desktop/firmware$ sudo 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 /bin/sh: 1: ./util.pl: Permission denied
time.c:25:32: error: ‘TIME_DEFAULT_AUTODST’ undeclared here (not in a function)uint8_t ee_time_status EEMEM = TIME_DEFAULT_AUTODST;                             
time.c:29:32: error: ‘TIME_DEFAULT_YEAR’ undeclared here (not in a function)uint8_t ee_time_year   EEMEM = TIME_DEFAULT_YEAR;
time.c:30:32: error: ‘TIME_DEFAULT_MONTH’ undeclared here (not in a function)uint8_t ee_time_month  EEMEM = TIME_DEFAULT_MONTH;
time.c:31:32: error: ‘TIME_DEFAULT_MDAY’ undeclared here (not in a function)uint8_t ee_time_day    EEMEM = TIME_DEFAULT_MDAY;
time.c:32:32: error: ‘TIME_DEFAULT_HOUR’ undeclared here (not in a function)uint8_t ee_time_hour   EEMEM = TIME_DEFAULT_HOUR;                             
time.c:33:32: error: ‘TIME_DEFAULT_MINUTE’ undeclared here (not in a function)uint8_t ee_time_minute EEMEM = TIME_DEFAULT_MINUTE;
time.c:34:32: error: ‘TIME_DEFAULT_SECOND’ undeclared here (not in a function)uint8_t ee_time_second EEMEM = TIME_DEFAULT_SECOND;
Makefile:67: ошибка выполнения рецепта для цели «time.o»
make: *** [time.o] Ошибка 123
Attachments
xmas-icetube-master.rar
The source files and schema of your project.
(275.42 KiB) Downloaded 47 times

Volodya
 
Posts: 2
Joined: Sat Feb 16, 2019 11:30 am

Re: ICE Tube Clock Firmware Comparison

by jarchie on Sat Feb 16, 2019 5:23 pm

Looking at your output, the first error is

Code: Select all | TOGGLE FULL SIZE
time.c /bin/sh: 1: ./util.pl: Permission denied"

The default macros (TIME_DEFAULT_AUTODST, etc.) are all generated by util.pl, so the later errors make sense because util.pl failed.

So something is preventing the Perl script util.pl from running. Does util.pl have the executable bit ("x") set? If you run util.pl manually, you should see a usage synopsis.

Code: Select all | TOGGLE FULL SIZE
xmas-icetube/firmware % ls -l util.pl
-rwxr-xr-x  1 jarchie  staff  6078 Aug 29  2014 util.pl*
xmas-icetube/firmware % ./util.pl
Usage:  ./util.pl [time|fuse|lock|memusage]

If the executable bit is not set, try setting it with

Code: Select all | TOGGLE FULL SIZE
xmas-icetube/firmware % chmod +x util.pl


Hope that helps.

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

Re: ICE Tube Clock Firmware Comparison

by Volodya on Sun Feb 17, 2019 3:34 am

Hello, thank you very much. Сommand:
Code: Select all | TOGGLE FULL SIZE
 xmas-icetube / firmware % chmod +x util.pl
helped and compilation was successful. Today I'm going to flash the microcontroller. I hope everything works out.
If I have further problems when starting the clock, can I ask for help in the relevant sections of the forum?
Thank you in advance.
Sincerely, Vladimir.

Volodya
 
Posts: 2
Joined: Sat Feb 16, 2019 11:30 am

Re: ICE Tube Clock Firmware Comparison

by jarchie on Mon Feb 18, 2019 3:16 am

Excellent! And congratulations on a successful build.

If you do run into any issues, I would be happy to help. It's probably better to post to the thread for my firmware rather than this one.

Good luck and happy hacking!

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

Re: ICE Tube Clock Firmware Comparison

by Wilcoxon on Mon Apr 29, 2019 10:38 am

Do you recommend always keeping the firmware up to date, Jarchie?

Wilcoxon
 
Posts: 1
Joined: Sat Apr 27, 2019 4:05 am

Re: ICE Tube Clock Firmware Comparison

by jarchie on Wed May 01, 2019 5:25 pm

Wilcoxon wrote:Do you recommend always keeping the firmware up to date, Jarchie?

I guess the short answer is "no."

The long answer?

The last update I made to my firmware was several years ago. I consider the firmware to be a finished product at this point, and do not intend to make any more changes. I will probably only update the code if problems are found (e.g., if bugs are found or if the project fails to compile in some future version of the avr-gcc compiler).

I would suggest looking at the current list of features in the firmware/README file. If there's a new feature you want, then maybe installing the latest version is worthwhile. Consider also that upgrading the firmware might be a fun project (or not fun, depending on your temperment). Use your own judgement.

Anyway, as always, good luck and happy hacking!

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

Re: ICE Tube Clock Firmware Comparison

by nix_clk_dd on Thu May 23, 2019 5:21 pm

Hi John,
I'm going to build an Ice Tube clock soon. I found several kits online, but I like the improvements you made and it would be a cool experience to source the parts from DigiKey and OSHPark. I would say I'm a beginner, but I've successfully built a nixie tube clock from a kit.

There are a couple questions that I have.
1. If I don't currently have anything to write the firmware to the microcontroller. would the flashing service from DigiKey work? Upon placement of an order of the ATmega328p, I can send them the firmware.

2. Do you have a parts list of the components modified from the original board and everything needed to take advantage of all the improvements (minus maybe the GPS functionality)? I'm almost certain I'm still missing things after reading your github README files.


Thank you so much! I know this is a lot to ask.

nix_clk_dd
 
Posts: 37
Joined: Tue May 21, 2019 2:15 pm

Re: ICE Tube Clock Firmware Comparison

by jarchie on Sat May 25, 2019 3:17 am

Sorry I missed the notification of this post in my email... I hope this doesn't come too late.

nix_clk_dd wrote:1. If I don't currently have anything to write the firmware to the microcontroller. would the flashing service from DigiKey work? Upon placement of an order of the ATmega328p, I can send them the firmware.

I've never tried it, but there's no reason why it wouldn't work. I can post a binary somewhere. And they would also need to program the fuse bits, lock bits, and eeprom as well as the flash program memory.

There are some compile time options that you wouldn't be able to change if you go this route, such as Adafruit vs xmas style buttons. Check out the hardware/config.h file for a description of the compile-time options. The defaults are probably fine for most people, and most of the options are for the hardware configuration.

My suspicion is that it might be cheaper (and perhaps more fun) to program the chips yourself. If you go that route, the USBtinyISP is what I find easiest.

nix_clk_dd wrote:2. Do you have a parts list of the components modified from the original board and everything needed to take advantage of all the improvements (minus maybe the GPS functionality)? I'm almost certain I'm still missing things after reading your github README files.

It sounds like you might want my modified boards. Check out the hardware/README, especially the "Collecting the Parts" section. The components that I bought years ago are all in the hardware/BOM.csv file. (BOM = bill of materials)

As far as GPS is concerned, you might as well keep the default support in the firmware (config.h). The clock will detect that there is no GPS attached and everything will work fine.


Hope that helps. And if you run into problems or have more questions please let me know. Happy hacking!

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

Re: ICE Tube Clock Firmware Comparison

by nix_clk_dd on Sat May 25, 2019 1:30 pm

Thanks for the response!

jarchie wrote:My suspicion is that it might be cheaper (and perhaps more fun) to program the chips yourself. If you go that route, the USBtinyISP is what I find easiest.

I might go that direction. The USBtisyISP is easy enough to build, but once again I feel like I'm missing something. :)
How does the microcontroller actually make the connection to the programmer? I don't have any experience with Arduino devices or flashing chips. Some images I've seen online show the chips on a breadboard connected to the programmer but I don't seen anything detailing this in the documentation.

jarchie wrote:It sounds like you might want my modified boards. Check out the hardware/README, especially the "Collecting the Parts" section. The components that I bought years ago are all in the hardware/BOM.csv file. (BOM = bill of materials)

That CSV is VERY helpful.
Once thing I noticed when searching for the crystal oscillator is that there are two versions of the Abracon AB38T-32.768KHZ
https://www.digikey.com/short/p4ww9h

All else being equal, here are the differences:

AB38T-32.768KHZ
Frequency Tolerance: ±20ppm
Operating Temperature: -10°C ~ 60°C

AB38T-32.768KHZ-B7
Frequency Tolerance: ±15ppm
Operating Temperature: -20°C ~ 70°C

I wonder if these differences would result in slightly better timekeeping. The B7 is only $0.04 more, so it might be the obvious choice unless it somehow interferes with your automatic rate correction code.

Thanks again!

nix_clk_dd
 
Posts: 37
Joined: Tue May 21, 2019 2:15 pm

Re: ICE Tube Clock Firmware Comparison

by jarchie on Sat May 25, 2019 11:11 pm

Our discussion might be getting a bit off-topic for an alternative firmware thread, so I'm replying here.

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

Please be positive and constructive with your questions and comments.