Nixie Clock for the HP Z3815A

by

Con Wassilieff ZL2AFP

Rev 3 Version 1.0 Build 26.07.07

Introduction

It is all very well having a modern high performance GPS Disciplined Reference such as the Z3815A, which provides a frequency standard with all the accuracy you might wish, but what use is it if you can't also use it to tell the time with any accuracy?

This was the motivation behind providing this unusual 'retro' clock. Rather than give it a modern appearance, we brought back the appearance of a 1970's Nixie display device! The appearance is based on a photograph of a real Nixie device, the Hewlett Packard 5326A frequency counter, which dates from 1972.

History

The Nixie tube was a device developed by Burroughs. It consists of a glass envelope like a tube/valve, but filled with Neon gas at very low pressure, along with a trace of Mercury. There is a single anode, consisting of a mesh, within which are ten small stamped metal electrodes, stacked one behind the other, and shaped like numbers. The anode is fed with a supply of about 150V via a current limiting resistor, and one of the ten cathodes is grounded to make the corresponding number glow. There were standard TTL devices (the 7442) designed with high voltage outputs to drive these tubes from BCD data. The Nixie was reasonably reliable (more than could be said for the driving circuitry, prone to leakage and shorts with the high voltages around), but the biggest advantage was the large size and good clarity of the displays, which were typically 12 - 15mm high, and sometimes even bigger.

The Nixie (according to some sources the name started as 'Neon Indicator eXperimental No. 1' or NIX1) went out of use with the arrival of the inexpensive LED display in the late 1970s. However, the warm glow and 'steam radio' appearance of the Nixie (or in this case the 'virtual Nixie) still has a strong appeal.

How the clock works

The software contains a 'skin', which is a picture created from a real photograph, in fact by cutting a section out of the photograph of the HP 5326A counter, correctly matching up the joining point (I bet you can't find it!), and then performing other graphics magic, such as reducing the size and adding the 'Z3815A UTC Clock' logo. The original photo was chosen from several others because the natural lighting and slanted shadows gave a more realistic appearance than the flatness of a flash shot with unwanted highlights. The picture is stored in the software as a bit map, which accounts for the large size of the program. The skin is arranged in the program to have no Windows borders or banner, so other arrangements must be made to control the program.

On this 'skin' the software places the 11 different images, also stored as bit maps. These are used as 'sprites', special memory areas which can be very quickly manipulated using techniques frequently used in games software. The images were captured as photographs of the real Nixie display, and you will see if you observe closely that some digits appear bigger or smaller, and closer or further away. This is a realistic copy of what happens with the real Nixie display, where the different digits are spaced front-to-back so they don't interfere electrically, and so the front digits are about 5mm ahead of the back ones. Of course the display background is black, or nearly so (the original plastic bezel is a dark orange filter), as no internal light leaks from inside the case, and the displays are mounted on a black supporting frame. The photographed digit images also have the same background, as they were photographed in situ through the bezel, and so placing them on top of the clock image gives the appearance that the digits are still glowing through the bezel!

Now the tricky stuff! The clock is a software clock, keeping time in software variables, hours, minutes and seconds. It is run by a one second second timer with a resolution of 50ms. The timer and therefore the clock continues to run even when the time message from the Z3815A is not available - but it will not be correct for very long, as PC clocks are notoriously inaccurate. The software clock cannot be set any other way than via the Z3815A. The clock directly places the time on the display using the image sprites, 10 digits plus colon.

Every 10 seconds or so, the software sends a ':PTIM:TCOD?' request to the HP Z3815A, via its serial comms connection. This is a request for a special time code, which is sent with very precise timing. The Z3815A does not respond immediately, but waits until exactly 20ms after the next UTC second event. It then transmits the time code for the NEXT UTC second event. The message takes the form:

T2yyyymmddhhmmsstflrvcc
followed by CR/LF. 'yyyymmdd' is of course the date, 'hhmmss' the time, and the 'tflrvcc' contains the Reference TFOM, FFOM, leap second and status information and a message checksum.

At 9600 bps, it takes about 33ms for the complete message to be received, and another 150ms or so for it to be processed in the computer. Thus the time for the next second is available about 800ms early of the second event to which it refers. The software then sets a timer (adjustable, but by default 800ms), and when this timer expires, the software clock is updated to the new reading, and the second timer restart so that subsequent seconds tick over at the correct time. Windows timers do not freeze the computer - other applications can still use the processor resources until the timer event returns.

Using the Clock

First, the HP Z3815A must be operating stably, with a good fix and locked to GPS. Close any other software used with the Z3815A, as unfortunately only one computer program at a time can use the serial communications resource - no sharing is possible. Make sure the serial connection to the Z3815A is operating, and leave it connected.

There are two time code modes, GPS binary (format 1) and UTC decimal (format 2). Make sure the Z3815A is set in UTC decimal mode, and if necessary send it

:PTIM:TCOD:FORM F2
to set it into the correct mode.

Edit the setup file 'UTC_clock.set' so the first line has the name of the serial communications resource you have the Z3815A connected to (COM1, COM2 etc). Later (if necessary) you can also edit the second line of the file to adjust the time offset so your clock ticks over exactly on the UTC second.

Start the program 'NixieUTCclock3.exe'. After a few seconds the clock will appear on the screen, and a few seconds later the correct UTC time will appear on the clock.

The clock can be moved around the screen using the left mouse button to click on and drag it. If the clock is under another window, a left-click anywhere on the clock will restore it, as will clicking on 'HP Z3815A Clock' in the application tray.

A right-click anywhere on the clock will bring up a simple menu, where you can pull up this help file, arrange the clock to be always on top of other applications, and quit the program. All self-explanatory.

It's not a good idea to disconnect the Z3815A from the serial port while the clock is running, as the clock will soon indicate incorrect time. PC timing is notoriously poor. When you reconnect, however, the time will soon be corrected.

You may find on some slower computers that watching the clock and listening to WWV (or other time signal), or even watching the 1PPS signal at the same time on an oscilloscope, the seconds seem to run slow, or some seconds out of every 10 seem to be slow. If so, adjust the second line (default 800) in the 'UTC_clock.set' file, so that the seconds march in time with WWV, or at least the slower ones are about as slow as the faster ones are fast!

On faster computers (>500MHz) the time accuracy should be easily within 100ms with no adjustment.

What the Nixie Clock doesn't do

The Z3815A Nixie Clock displays UTC time, the date (bottom centre, look closely!), the Reference Time Figure of Merit (TFOM) and Frequency Figure of Merit (FFOM). It does not: The program should however work on any Windows (TM) 98 or XP computer, and requires a modest amount of memory, under 500kb of disc space, and a VGA display. The clock is 457 x 152 pixels, so will nearly fill a 640 x 480 screen. It's been made fairly large so it can be seen across the room. No registry or other changes are made to Windows.