[ntp:hackers] thinking of yet another reference clock implementation

Cirilo Bernardo cbernardo at auspace.com.au
Wed Sep 26 03:23:30 UTC 2007


Hi folks,

  I'm playing around with a Trimble LassenSQ receiver in an embedded system, specifically the WinSystems PCM-GPS board.  I would like to make the best use of the device features, which includes a PPS interrupt as well as TSIP and NMEA outputs.  Since other software running on the system also want information from the GPS, I wrote a device driver which has a number of pseudo-devices which can be opened by multiple processes. Originally I thought it would be a convenient way of sharing the NMEA message, but since I can get a high-res timestamp when the PPS signal is received, why not make use of it?

  For keeping time, I thought I may as well create a pseudo-device which provides the NMEA RMC message (or at least the UTCTIME and DATE parts) along with its associated PPS timestamp.  Any comments on this idea, or suggestions on what to read to get started on its implementation?  The pseudo device already exists in my driver and the characteristics are:

1. will block for up to 2 seconds if no data is currently available
2. will return data only if the GPS is currently computing posision fixes - so the device is reliable in the sense that it either has good data or nothing
3. return values:
   -ETIME:  2 seconds have elapsed with no data coming in - possibly reception problems or a GPS fault
   -ENOMSG: the GPS is not currently computing position fixes; the driver is refusing to give poor(er)
   quality data

I also have an 'rmc' virtual device which simply parrots the NMEA RMC message. When read, the device will immediately return the last NMEA RMC message, or else block if read() had already been performed and no new data had come in.  It saves an NTP reference clock implementation from the nuisance of polling; the ref. clock can happily be blocked (for a maximum 2s) while waiting for the driver to pull in data via its serial hardware interrupt routine.

- Cirilo


More information about the hackers mailing list