KIWI - Precision Timestamp Utility

[Tone] KIWI is a "freeware" DOS program that uses a PC and GPS (with 1PPS) to timestamp an event to millisecond accuracy to UTC. The program uses the GPS to firstly calibrate the PC timing and then every 5 seconds resynchs the PC timing to the GPS (to track thermal changes in the PC quartz crystal). This method enables any old PC to be used to timestamp an event over long periods (days or months even) and yet retain the 1 millisecond accuracy to UTC.

The event to be timestamped can trigger KIWI via a logic signal or by a manually operated switch connected to the PC printer port. For astronomical events using a camcorder, a LED (optional) is flashed for 50msec to ident the video at the time of the "trigger" for subsequent field/frame accuracy determination.

The PC timing acts as a "flywheel" to the GPS 1 pulse per second drumbeat. Even if the GPS briefly loses synch with the satellites, the software will retain its accuracy. One of the functions of the program shows how the PC timing compares to the 1PPS from the GPS - 5 microseconds RMS for most PC's common.

This page is concerned with the NMEA version of KIWI. Those with a TRIMBLE SV6 receiver please click here.

New Features:

KIWI now generates time signals (sound and sight) in a format similar to WWV. At the same time the software analyses the 1PPS and serial data for Integrity. Any change to the 1PPS is detected and an Integrity Fault report is made, giving the date, time, error, and various GPS status conditions. This gives traceability of all generated time signals to UTC. The current version of software will generate an Integrity Fault report if the 1PPS varies by more than 50 millionths of a second from UTC.

The Integrity Monitoring ability gives the user confidence of using the GPS "anywhere" as well as the ability to choose the best place to use a GPS to avoid multipath etc. Here is an example:

Integrity Fault @ UTC 18-09-2002 21:03:14, 1.00400 secs=Delta, SVs= 2 FIX=NN
Integrity Fault @ UTC 18-09-2002 21:08:07, 0.99600 secs=Delta, SVs= 3 FIX=YY

Integrity Fault Summary @ UTC 18-09-2002 23:13:40
Early = 1    Late = 1    Busy = 209    OK = 54905
The SV6 was sitting on an inside window sill, with a very poor view of the sky with many trees outside. It had been running for 15.2 hours (54905 / 3600), during this time there was only a single time period where the 1PPS was not aligned to UTC. At 21:03 the GPS was only tracking 2 satellites and did not have a "valid fix". Its internal 1PPS generation changed its "reference" back by 4 mS (as you can see above). For the next five minutes the 1PPS was aligned 4 milliseconds late to UTC, and then as another satellite popped into view, it was able to get a valid fix (YY) and so correct the 1PPS by moving its reference "forward" by 4 mS. Thereafter the 1PPS was aligned to UTC.

So although the GPS was not placed in an ideal reception position (but convenient to me), I could use the 1PPS reference with confidence by observing I had an equal count of early and lates (the 1PPS had got out of, and then back into, synch with UTC). The busy count, is not really a fault, but a quirk of the SV6 where "sometimes" it cannot reply within the current second. The software is designed to smoothly handle this condition.

The above test was conducted with a Trimble SV6 receiver with the TAIP version of KIWI, the following sample is from my Motorola Oncore GT+ running on the NMEA version of KIWI.
Integrity Fault Summary @ UTC 21-09-2002 08:35:28
Early = 0    Late = 0    Busy = 0    OK = 95566
Again an inside test (but a different window). I was also using the 1PPS signal for another software program that was determining the Temperature Coefficient of a Grandfather clock. The above result showed that there were no excursions (to the 50 microsecond level) of the 1PPS for over 26.5 hours. Because multipath and clock slip occur at discrete quanta in excess of 50uS, it can be assumed that all 1PPS signals were accurate to below the 1uS level. The results from the other clock program had also proved I had adjusted the temperature compensation correctly in the fine old Grandfather clock ;-)

Also new is a linear reduction function making it much easier to time pre-recorded events.

When exiting the program, the software will align the time on your PC to atomic accuracy from the GPS, allowing automatically for your timezone.

KIWI was initially designed for Astronomical Occultation timings. Occultation's occur when a celestial object passes in front of another (usually a star). The timing of this event can be used to obtain size and shapes of Asteroids and topography of our Moon. Many other applications, experiments and research may benefit from KIWI.

Requirements: KIWI was compiled as a 16bit DOS application, requiring DOS 3.0 or above. The PC does not have to be state of the art, any old pc/laptop AT and above is okay, even a 20 MHz '286' 15 year old AT can easily meet the 1 msec spec. KIWI can make that old "junk" PC suddenly have a purpose in life!

As a DIY hobby project it should take an "evening" to put together. A GPS (with 1PPS is required), these can now be purchased for as low as US$25. The program does require some electronic skill to connect the GPS and PC, so please read documentation first to see if you have the required skill.

The program should not be run from a W9x/ME dos window, the accuracy is "ruined" by the W9x/ME operating system not giving enough CPU cycles for the application to meet spec! To use the program from W9x, you must click on "Start" and "Shut Down" to "restart in MSDOS Mode".

If KIWI is now placed on a "bootable" DOS floppy disk, then it does not matter what the operating system on the Hard Disk is (Windows, LINUX, UNIX etc). KIWI will not save any data to the floppy OR hard disk. If KIWI is run on a hard disk system, it will save its timing data to the hard disk. The reason it will not save data to the floppy disk is because it shuts down all interrupts and the floppy motor would keep running. The program detects whether it is running on a floppy and advises on the screen (in appropriate functions) that it will not save data to disk.

Why KIWI? (pronounced "key we") It is the native bird of New Zealand, where this freeware was written.

Photos of how I wired up my Motorola GT+ and $25 Trimble SV6 receiver.

KIWI is a software program only, it is up to the user to obtain a GPS module (that outputs NMEA sentences GGA and RMC) and wire it up. What features and how complex the wiring, is left as a hobby project for the user.

Review of KIWI - Art Lucas from IOTA (International Occultation Timing Association) has kindly provided a review of KIWI from his experience putting the project together. Art has many good pointers and tips about construction and valid comments for those that wish to procede with the project (especially those using the GARMIN GPS35-HVS).


Copy KIWI ( (Version 1.07) to a new (any name) directory on your PC. Unzip contents (produces 3 files) and read the file README.TXT for further information.

Support and Additional Information

KIWI written by Geoff Hitchcox, Christchurch, New Zealand, South Pacific.

Here are the Menu options of KIWI

 1 = Show the Logic Level of 1PPS and Switch
 2 = Show raw NMEA serial data from GPS
 3 = Your reaction time to an object    Appearance
 4 = Your reaction time to an object DISappearance
 5 = Measure PC timing Accuracy
 6 = Position Averaging and Satellite Tracking Info
 7 = Timestamp Function
 8 = Generate Time Signals (sound and sight)
 9 = Linear Time Reduction (of pre-recorded events)
 0 = Quit Program (also ESC Key)

An example of option 7 (Timestamp Function) follows:

I coupled to the manual switch an open collector transistor
connected to an AM radio. The 143 ms "delay" of the 6 time pips
is due to the PCM digital system used to connect the radio

The following data is what is presented on the screen and also
saved to a TEXT file on the PC.

Started Timing @ 08:55:15 HH:MM:SS 18-09-2002 DD-MM-YYYY UTC 43 31' 11.0" S 172 42' 8.2" E 12.2 Hgt (metres) 40.0 Hgt (feet) 08:59:55.143 UTC 08:59:56.143 UTC 08:59:57.143 UTC 08:59:58.143 UTC 08:59:59.143 UTC 09:00:00.143 UTC Finished Timing @ 09:05:16 HH:MM:SS 18-09-2002 DD-MM-YYYY UTC 43 31' 11.0" S 172 42' 8.2" E 12.2 Hgt (metres) 40.0 Hgt (feet)
Protocol of the Audio Pips. Pip = Seconds marker Hi Pip = 10 second marker Short Pip = 55,56,57,58 second marker Double Pip = Minutes Triple Pip = Hours (24HR), lower tone if Hr = Min Silent Pip = 59th second "P" Key to Toggle Pips, to gather stats quietly!
Explanation of the Hour and Minute Coding. Let's assume the time is 12:09 (HH:MM) During the minute starting at 12:09 The pip at the 9th second will be replaced by a "double" pip The pip at the 12th second will be replaced by a "triple" pip Thus: On the HOUR the first pip is a double (because minute = 0). Thereafter each Minute starts with a long pip (like WWV). If the hour and minute are the same (08:08) then a much lower frequency triple pip is given. Midnight UTC is marked by a low freq triple pip (because HR = Min = 0). No indication is given of the 59th minute, because the 59th second is ALWAYS silent. An added Leap second will give 2 triple pips.

Many thanks to:
Don Oliver (Houston, Texas, USA) for the Linear Time Reduction algorithm, and many hours of testing.
Brian Loader and Dave Gault for being the first in New Zealand and Australia (respectively) for implementing KIWI timing.
Hosted by