Re: [time-nuts] [Solved] Looking for multiple PPS timestamp logging

2011-10-05 Thread shalimr9
Jim,

This is an interesting product, thank for the link!

Didier KO4BB

Sent from my BlackBerry Wireless thingy while I do other things...

-Original Message-
From: Jim Lux jim...@earthlink.net
Sender: time-nuts-boun...@febo.com
Date: Tue, 04 Oct 2011 08:40:55 
To: Discussion of precise time and frequency measurementtime-nuts@febo.com
Reply-To: Discussion of precise time and frequency measurement
time-nuts@febo.com
Subject: Re: [time-nuts] [Solved] Looking for multiple PPS timestamp logging

On 10/4/11 8:03 AM, Kevin Rosenberg wrote:

 So, if you know of any simple ADC to UART firmwares available, that'd
 be great so he can just reference someone else's code. The picPET
 is a perfect device at the perfect time. But, we can't rely on tvb
 to come up with a 'picADC' at a similarly serendipitous time.


DATAQ

http://www.dataq.com/products/startkit/di145.html

$29, 4 channel 10 bit ADC with USB  interface

You'll need to cobble up a sensor, of course, and I don't know if the 
resolution of the di145 is good enough (20mV/LSB as I recall) for a 
LM335 (10mV/Kelvin?).  One thing you get with cheap is a +/- 10V full 
scale range.

A thermistor and resistor into the DATAQ might work better.

Maxim/Dallas One-Wire devices are another possibility  There's tons of 
PIC code out there to interface to them.  The sensors are cheap (few 
bucks, depending on whether you buy raw device, or you get one potted 
with a cable)  Sparkfun.com has them, among other places.


There's also a whole raft of USB temperature loggers out there from 
Onset (HOBO) or DataQ or a variety of other companies.  They tend to run 
in the $80 range  (if someone knows about a battery powered temperature 
logger in the under $25 range, I'd love to hear about it)

And, of course, a DMM with a RS-232 interface is another possibility


___
time-nuts mailing list -- time-nuts@febo.com
To unsubscribe, go to https://www.febo.com/cgi-bin/mailman/listinfo/time-nuts
and follow the instructions there.
___
time-nuts mailing list -- time-nuts@febo.com
To unsubscribe, go to https://www.febo.com/cgi-bin/mailman/listinfo/time-nuts
and follow the instructions there.


Re: [time-nuts] [Solved] Looking for multiple PPS timestamp logging

2011-10-05 Thread Kevin Rosenberg
On Oct 4, 2011, at 11:42 AM, Mark Sims wrote:
 Use an LM34 sensor,  not the LM35.  It has twice the resolution per volt 
 since it outputs in degrees F,  not degrees C.

That's a good idea. That's one issue that I have with a 10-bit ADC common to 
many MCUs, is the
low voltage of 0.20 to 0.28 mV in the office.

 Better yet,  use the DS1620 (old revision) that is used on the Tbolt.  It has 
 a digital interface.  It will give you around 0.01C res without any ADC 
 conversion noise, etc.

That's a good idea. In fact, I saw that I have some DS1631 samples on the shelf.
I like that idea as that can be bit-banged by a simple, small MCU on same
board as the XO.

Thanks for the thoughts, Mark!

Kevin


___
time-nuts mailing list -- time-nuts@febo.com
To unsubscribe, go to https://www.febo.com/cgi-bin/mailman/listinfo/time-nuts
and follow the instructions there.


Re: [time-nuts] [Solved] Looking for multiple PPS timestamp logging

2011-10-05 Thread Kevin Rosenberg
Hi Chris,

select is a great idea, but I think I'll be using cygwin which doesn't
appear to have an emulation of select on Windows.

Kevin

On Oct 4, 2011, at 10:23 AM, Chris Albertson wrote:

 On Tue, Oct 4, 2011 at 3:36 AM, Hal Murray hmur...@megapathdsl.net wrote:
 The temperature swings won't be large, just the usual diuneral indoor 
 cycles.
 
 In California, the diurnal temperature swings are big enough to be useful. :)
 
 This is what ntp sees the main/CPU crystal doing in a non airconditioned
 room.  Each color is a different day.
  http://www.megapathdsl.net/~hmurray/ntp/slope.gif
 
 The swing would be much bigger outside, especially with an open sky.
 
 
 Since we'd be measuring 4 PPS signals that won't be in phase, I wasn't
 planning on sleeping for long. But, I some 10 usec sleeps with usleep(1)
 after reading a pulse would be reasonable. But, with the system not doing
 anything  but polling and writing to the disk, I wasn't expecting much
 interruptions from other processes.
 
 I was thinking of keeping track of when you expected each pulse to arrive
 next and sleeping until a little before you expected the soonest one.
 (Adjust a little by trial and error.)
 
 This is a UNIX-like system?  If so use a select on the file
 descriptor(s).This system call allows you to sleep until there is
 data available on one of a set of files.   See man 2 select
 
 The code right after the select() has to poll all the files to see
 which one has data, your read/process it then go back an wait/sleep.
 If you do poll after a fixed length sleep you will on average to 1/2
 of a polling cycle late reading the data and also you waste time
 checking when nothing is there.
 
 Chris Albertson
 Redondo Beach, California
 
 ___
 time-nuts mailing list -- time-nuts@febo.com
 To unsubscribe, go to https://www.febo.com/cgi-bin/mailman/listinfo/time-nuts
 and follow the instructions there.
 


___
time-nuts mailing list -- time-nuts@febo.com
To unsubscribe, go to https://www.febo.com/cgi-bin/mailman/listinfo/time-nuts
and follow the instructions there.


Re: [time-nuts] [Solved] Looking for multiple PPS timestamp logging

2011-10-05 Thread Kevin Rosenberg
Hi Didier,

Thanks for the idea. I haven't done any 8051 programming, but the price is 
great and you
list other advantages on your web site. I appreciate the recommendation.

Kevin

 A cheap way to measure temperature that will also be a good learning exercise 
 would be to use a Silabs Toolstick. Most of their chips have a built in 
 temperature sensor and a demo ADC program that spits out the temperature over 
 the serial port emulated USB interface.
 
 The toolsticks are all about $10 and you need a Base Adapter that is $15 I 
 believe. The tools are free (demo, size limited Keil compiler, or the free 
 unlimited SDCC)
 
 More info on my web site in the Wiki
 
 http://www.ko4bb.com
 
 Alternately, you can buy a USB temperature sensor on eBay for about $10 I 
 believe, but you won't learn much by using it...
 
 Didier KO4BB
 
 Sent from my BlackBerry Wireless thingy while I do other things...
 
 -Original Message-
 From: Kevin Rosenberg ke...@rosenberg.net
 Sender: time-nuts-boun...@febo.com
 Date: Tue, 4 Oct 2011 09:03:56 
 To: Discussion of precise time and frequency measurementtime-nuts@febo.com
 Reply-To: Discussion of precise time and frequency measurement
   time-nuts@febo.com
 Subject: Re: [time-nuts] [Solved] Looking for multiple PPS timestamp logging
 
 On Oct 4, 2011, at 4:36 AM, Hal Murray wrote:
 In California, the diurnal temperature swings are big enough to be useful. :)
 
 Here in New Mexico as well, useful or ruinous depending upon your application.
 Hence, I believe, your smiley face above ;)
 
 The swing would be much bigger outside, especially with an open sky.
 
 We thought about an outdoor light and temperature sensor when my son
 considered measuring the stability of the PPS signal from a NetClock/2
 WWVB receiver. But, we'll be measuring the temperature near the indoor XO.
 
 I was thinking of keeping track of when you expected each pulse to arrive 
 next and sleeping until a little before you expected the soonest one.  
 (Adjust a little by trial and error.)
 
 Sure, and the solution becomes more interesting the more pulse lines that
 are being polled.
 
 I agree that Tom's picPET will be a fine way to do it.  I was just playing 
 with how to do it with the parallel port.
 
 I lot of fine ideas come from thought experiments.
 
 It's still an interesting question of how accurate you need to measure the 
 time.  That's probably a good one to work through with your son on the back 
 of an envelope.
 
 I think so, too. So, my son will be learning more about stability, Allan
 deviations, modified Allan deviations (which should be more useful for 
 the number of averaging points over a month), and improving his exponent
 skills.
 
 Another statistic he'll be learning is the Pearson correlation coefficient
 to compare temperature (probably in Kelvin) to the XO frequency. The more
 precisely those are measured, the more likely the Pearson will reflect the
 true correlation.
 
 How are you measuring temperature?
 
 Good question, because we haven't completely solved that. We'll be using
 a LM35CAH mounted next to the 32768 crystal and measuring the
 voltage once a second.
 
 What I haven't decided is whether to have my son use the 34401A and GPIB
 polling via a Prologix adapter versus a simple MCU firmware using a 2.5V
 reference voltage and a 10-12 bit ADC and outputs the ADC result either
 once a second, or in response to a pulse (probably from the PPS of the XO).
 The first has merits of accuracy and simplicity, but I prefer he use
 more affordable devices than the 34401A in his experiment to even his 
 project compared with other students. The latter has the advantage of 
 price, but the disadvantage of me writing the firmware (though, the 
 firmware is almost trivial). But again, I'd like him to be as 
 independent as possible.
 
 So, if you know of any simple ADC to UART firmwares available, that'd
 be great so he can just reference someone else's code. The picPET
 is a perfect device at the perfect time. But, we can't rely on tvb
 to come up with a 'picADC' at a similarly serendipitous time.
 
 Kevin
 
 
 ___
 time-nuts mailing list -- time-nuts@febo.com
 To unsubscribe, go to https://www.febo.com/cgi-bin/mailman/listinfo/time-nuts
 and follow the instructions there.
 ___
 time-nuts mailing list -- time-nuts@febo.com
 To unsubscribe, go to https://www.febo.com/cgi-bin/mailman/listinfo/time-nuts
 and follow the instructions there.


___
time-nuts mailing list -- time-nuts@febo.com
To unsubscribe, go to https://www.febo.com/cgi-bin/mailman/listinfo/time-nuts
and follow the instructions there.


Re: [time-nuts] [Solved] Looking for multiple PPS timestamp logging

2011-10-05 Thread Kevin Rosenberg
Hi Jim,

Thanks for the thought. I forgot about my Dataq DI-720 which can do 
14-bit ADC. However, I'll need to spend more time looking at their
acquisition software.

I haven't seen a way to have WinDaq/Pro output an ASCII log file, though
the software sheet talks about streaming disk files, it appears to be
their proprietary format. BTW, I have an open-source program called
wdq2wav to convert WinDaq files to .wav files @ http://wdq2wav.b9.com/

I haven't found a simple C API for the unit to allow me to write my 
own logging program for the DI-720.

But, you have a good idea. I should give Dataq a call and find out
what options I have for simple, continuous ASCII logging output.

Kevin

On Oct 4, 2011, at 9:40 AM, Jim Lux wrote:

 On 10/4/11 8:03 AM, Kevin Rosenberg wrote:
 
 So, if you know of any simple ADC to UART firmwares available, that'd
 be great so he can just reference someone else's code. The picPET
 is a perfect device at the perfect time. But, we can't rely on tvb
 to come up with a 'picADC' at a similarly serendipitous time.
 
 
 DATAQ
 
 http://www.dataq.com/products/startkit/di145.html
 
 $29, 4 channel 10 bit ADC with USB  interface
 
 You'll need to cobble up a sensor, of course, and I don't know if the 
 resolution of the di145 is good enough (20mV/LSB as I recall) for a LM335 
 (10mV/Kelvin?).  One thing you get with cheap is a +/- 10V full scale range.
 
 A thermistor and resistor into the DATAQ might work better.
 
 Maxim/Dallas One-Wire devices are another possibility  There's tons of PIC 
 code out there to interface to them.  The sensors are cheap (few bucks, 
 depending on whether you buy raw device, or you get one potted with a cable)  
 Sparkfun.com has them, among other places.
 
 
 There's also a whole raft of USB temperature loggers out there from Onset 
 (HOBO) or DataQ or a variety of other companies.  They tend to run in the $80 
 range  (if someone knows about a battery powered temperature logger in the 
 under $25 range, I'd love to hear about it)
 
 And, of course, a DMM with a RS-232 interface is another possibility
 
 
 ___
 time-nuts mailing list -- time-nuts@febo.com
 To unsubscribe, go to https://www.febo.com/cgi-bin/mailman/listinfo/time-nuts
 and follow the instructions there.


___
time-nuts mailing list -- time-nuts@febo.com
To unsubscribe, go to https://www.febo.com/cgi-bin/mailman/listinfo/time-nuts
and follow the instructions there.


Re: [time-nuts] [Solved] Looking for multiple PPS timestamp logging

2011-10-05 Thread Kevin Rosenberg
On Oct 4, 2011, at 10:16 AM, Tijd Dingen wrote:
 You mentioned wanting to use the parallel port under linux for pps purposes, 
 right?

Hi Fred, I consider it, but tvb's picPET's will work much better for the 
project.

 So if some parallel port programming is acceptable, then you can do the 
 following:
 - get an adc with SPI bus (which means plenty of choice)
 - connect the 3 SPI wires to parallel port
 - bitbang spi (just google bitbang spi and you'll find example code. it's 
 pretty simple to do yourself and a fairly forgiving protocol (timing wise))

I like SPI as well and have done a fair bit of AVR bit banging. Doing it though 
the parallel port is intriguing.

 Alternatively you could use a microcontroller with both spi and uart 
 (microchip and atmel have plenty), and use that to serve as uart -- spi 
 bridge. Or for something like a 10 bit ADC you can use the internal adc of 
 the MCU. 

I'm leaning toward an ATMega168 which has a USART and a TWI interface, 
so simplify programming and work at the byte rather than bit level.

 - get an ADS1258EVM board for about $50
 - bring your own supply voltage
 - bitbang spi on the parallel port
 - bitbang i2c on the parallel port (this is optional for this board, not 
 strictly needed)

That's a nice board. I ended up ordering the PDK version which comes with a some
other features including a USB interface so can skip worrying about having a 
parallel
port on whatever system I'll be using the ADS1258EVM with. Creating a fpga 
interface
like you did is a fine idea, but I'll end up trading some dollars for time with 
the PDK
version.

Kevin



___
time-nuts mailing list -- time-nuts@febo.com
To unsubscribe, go to https://www.febo.com/cgi-bin/mailman/listinfo/time-nuts
and follow the instructions there.


Re: [time-nuts] [Solved] Looking for multiple PPS timestamp logging

2011-10-05 Thread Kevin Rosenberg
On Oct 4, 2011, at 9:10 AM, Bob Bownes wrote:
 If you need a simple/cheap pollable ADC, there is a Velleman kit
 available with USB. Can sample ADC, and a number of discrete inputs as
 well.
 
 And it can now be found on the wall at Radio Shack, strangely enough.

Hi Bob,

That's nice that it's available down the street, but for reading the LM35
at 0.20 to 0.28 V, the kit's 8-bit resolution will be lower than I'd like.
Thanks for the idea -- I wasn't aware that RS was carrying Velleman kits.

Kevin


___
time-nuts mailing list -- time-nuts@febo.com
To unsubscribe, go to https://www.febo.com/cgi-bin/mailman/listinfo/time-nuts
and follow the instructions there.


Re: [time-nuts] [Solved] Looking for multiple PPS timestamp logging

2011-10-05 Thread Jim Lux

On 10/5/11 12:59 PM, shali...@gmail.com wrote:

Jim,

This is an interesting product, thank for the link!

Didier KO4BB

Sent from my BlackBerry Wireless thingy while I do other things...



There's also the Labjack product... http://www.labjack.com/  USB 
interface for events, ADC, etc.  In the $100 range depending on the model.


A few years ago when it first came out, it was a pain because it was 
Windows only, with limited protocol doc.  But now they've got Linux, 
Mac, Windows, with bindings for just about every language






-Original Message-
From: Jim Luxjim...@earthlink.net
Sender: time-nuts-boun...@febo.com
Date: Tue, 04 Oct 2011 08:40:55
To: Discussion of precise time and frequency measurementtime-nuts@febo.com
Reply-To: Discussion of precise time and frequency measurement
time-nuts@febo.com
Subject: Re: [time-nuts] [Solved] Looking for multiple PPS timestamp logging

On 10/4/11 8:03 AM, Kevin Rosenberg wrote:


So, if you know of any simple ADC to UART firmwares available, that'd
be great so he can just reference someone else's code. The picPET
is a perfect device at the perfect time. But, we can't rely on tvb
to come up with a 'picADC' at a similarly serendipitous time.



DATAQ

http://www.dataq.com/products/startkit/di145.html

$29, 4 channel 10 bit ADC with USB  interface

You'll need to cobble up a sensor, of course, and I don't know if the
resolution of the di145 is good enough (20mV/LSB as I recall) for a
LM335 (10mV/Kelvin?).  One thing you get with cheap is a +/- 10V full
scale range.

A thermistor and resistor into the DATAQ might work better.

Maxim/Dallas One-Wire devices are another possibility  There's tons of
PIC code out there to interface to them.  The sensors are cheap (few
bucks, depending on whether you buy raw device, or you get one potted
with a cable)  Sparkfun.com has them, among other places.


There's also a whole raft of USB temperature loggers out there from
Onset (HOBO) or DataQ or a variety of other companies.  They tend to run
in the $80 range  (if someone knows about a battery powered temperature
logger in the under $25 range, I'd love to hear about it)

And, of course, a DMM with a RS-232 interface is another possibility


___
time-nuts mailing list -- time-nuts@febo.com
To unsubscribe, go to https://www.febo.com/cgi-bin/mailman/listinfo/time-nuts
and follow the instructions there.
___
time-nuts mailing list -- time-nuts@febo.com
To unsubscribe, go to https://www.febo.com/cgi-bin/mailman/listinfo/time-nuts
and follow the instructions there.




___
time-nuts mailing list -- time-nuts@febo.com
To unsubscribe, go to https://www.febo.com/cgi-bin/mailman/listinfo/time-nuts
and follow the instructions there.


Re: [time-nuts] [Solved] Looking for multiple PPS timestamp logging

2011-10-05 Thread Kevin Rosenberg
On Oct 5, 2011, at 7:49 PM, Jim Lux wrote:
 There's also the Labjack product... http://www.labjack.com/  USB interface 
 for events, ADC, etc.  In the $100 range depending on the model.
 
 A few years ago when it first came out, it was a pain because it was Windows 
 only, with limited protocol doc.  But now they've got Linux, Mac, Windows, 
 with bindings for just about every language

Cool gadgets. Thanks for the link!

Kevin


___
time-nuts mailing list -- time-nuts@febo.com
To unsubscribe, go to https://www.febo.com/cgi-bin/mailman/listinfo/time-nuts
and follow the instructions there.


Re: [time-nuts] [Solved] Looking for multiple PPS timestamp logging

2011-10-04 Thread Hal Murray
 The temperature swings won't be large, just the usual diuneral indoor cycles.

In California, the diurnal temperature swings are big enough to be useful. :)

This is what ntp sees the main/CPU crystal doing in a non airconditioned 
room.  Each color is a different day.
  http://www.megapathdsl.net/~hmurray/ntp/slope.gif

The swing would be much bigger outside, especially with an open sky.


 Since we'd be measuring 4 PPS signals that won't be in phase, I wasn't
 planning on sleeping for long. But, I some 10 usec sleeps with usleep(1)
 after reading a pulse would be reasonable. But, with the system not doing
 anything  but polling and writing to the disk, I wasn't expecting much
 interruptions from other processes. 

I was thinking of keeping track of when you expected each pulse to arrive 
next and sleeping until a little before you expected the soonest one.  
(Adjust a little by trial and error.)


I agree that Tom's picPET will be a fine way to do it.  I was just playing 
with how to do it with the parallel port.

It's still an interesting question of how accurate you need to measure the 
time.  That's probably a good one to work through with your son on the back 
of an envelope.

How are you measuring temperature?



-- 
These are my opinions, not necessarily my employer's.  I hate spam.




___
time-nuts mailing list -- time-nuts@febo.com
To unsubscribe, go to https://www.febo.com/cgi-bin/mailman/listinfo/time-nuts
and follow the instructions there.


Re: [time-nuts] [Solved] Looking for multiple PPS timestamp logging

2011-10-04 Thread Kevin Rosenberg
On Oct 4, 2011, at 4:36 AM, Hal Murray wrote:
 In California, the diurnal temperature swings are big enough to be useful. :)

Here in New Mexico as well, useful or ruinous depending upon your application.
Hence, I believe, your smiley face above ;)

 The swing would be much bigger outside, especially with an open sky.

We thought about an outdoor light and temperature sensor when my son
considered measuring the stability of the PPS signal from a NetClock/2
WWVB receiver. But, we'll be measuring the temperature near the indoor XO.

 I was thinking of keeping track of when you expected each pulse to arrive 
 next and sleeping until a little before you expected the soonest one.  
 (Adjust a little by trial and error.)

Sure, and the solution becomes more interesting the more pulse lines that
are being polled.

 I agree that Tom's picPET will be a fine way to do it.  I was just playing 
 with how to do it with the parallel port.

I lot of fine ideas come from thought experiments.

 It's still an interesting question of how accurate you need to measure the 
 time.  That's probably a good one to work through with your son on the back 
 of an envelope.

I think so, too. So, my son will be learning more about stability, Allan
deviations, modified Allan deviations (which should be more useful for 
the number of averaging points over a month), and improving his exponent
skills.

Another statistic he'll be learning is the Pearson correlation coefficient
to compare temperature (probably in Kelvin) to the XO frequency. The more
precisely those are measured, the more likely the Pearson will reflect the
true correlation.

 How are you measuring temperature?

Good question, because we haven't completely solved that. We'll be using
a LM35CAH mounted next to the 32768 crystal and measuring the
voltage once a second.

What I haven't decided is whether to have my son use the 34401A and GPIB
polling via a Prologix adapter versus a simple MCU firmware using a 2.5V
reference voltage and a 10-12 bit ADC and outputs the ADC result either
once a second, or in response to a pulse (probably from the PPS of the XO).
The first has merits of accuracy and simplicity, but I prefer he use
more affordable devices than the 34401A in his experiment to even his 
project compared with other students. The latter has the advantage of 
price, but the disadvantage of me writing the firmware (though, the 
firmware is almost trivial). But again, I'd like him to be as 
independent as possible.

So, if you know of any simple ADC to UART firmwares available, that'd
be great so he can just reference someone else's code. The picPET
is a perfect device at the perfect time. But, we can't rely on tvb
to come up with a 'picADC' at a similarly serendipitous time.

Kevin


___
time-nuts mailing list -- time-nuts@febo.com
To unsubscribe, go to https://www.febo.com/cgi-bin/mailman/listinfo/time-nuts
and follow the instructions there.


Re: [time-nuts] [Solved] Looking for multiple PPS timestamp logging

2011-10-04 Thread Jim Lux

On 10/4/11 8:03 AM, Kevin Rosenberg wrote:


So, if you know of any simple ADC to UART firmwares available, that'd
be great so he can just reference someone else's code. The picPET
is a perfect device at the perfect time. But, we can't rely on tvb
to come up with a 'picADC' at a similarly serendipitous time.



DATAQ

http://www.dataq.com/products/startkit/di145.html

$29, 4 channel 10 bit ADC with USB  interface

You'll need to cobble up a sensor, of course, and I don't know if the 
resolution of the di145 is good enough (20mV/LSB as I recall) for a 
LM335 (10mV/Kelvin?).  One thing you get with cheap is a +/- 10V full 
scale range.


A thermistor and resistor into the DATAQ might work better.

Maxim/Dallas One-Wire devices are another possibility  There's tons of 
PIC code out there to interface to them.  The sensors are cheap (few 
bucks, depending on whether you buy raw device, or you get one potted 
with a cable)  Sparkfun.com has them, among other places.



There's also a whole raft of USB temperature loggers out there from 
Onset (HOBO) or DataQ or a variety of other companies.  They tend to run 
in the $80 range  (if someone knows about a battery powered temperature 
logger in the under $25 range, I'd love to hear about it)


And, of course, a DMM with a RS-232 interface is another possibility


___
time-nuts mailing list -- time-nuts@febo.com
To unsubscribe, go to https://www.febo.com/cgi-bin/mailman/listinfo/time-nuts
and follow the instructions there.


Re: [time-nuts] [Solved] Looking for multiple PPS timestamp logging

2011-10-04 Thread Chris Albertson
On Tue, Oct 4, 2011 at 3:36 AM, Hal Murray hmur...@megapathdsl.net wrote:
 The temperature swings won't be large, just the usual diuneral indoor cycles.

 In California, the diurnal temperature swings are big enough to be useful. :)

 This is what ntp sees the main/CPU crystal doing in a non airconditioned
 room.  Each color is a different day.
  http://www.megapathdsl.net/~hmurray/ntp/slope.gif

 The swing would be much bigger outside, especially with an open sky.


 Since we'd be measuring 4 PPS signals that won't be in phase, I wasn't
 planning on sleeping for long. But, I some 10 usec sleeps with usleep(1)
 after reading a pulse would be reasonable. But, with the system not doing
 anything  but polling and writing to the disk, I wasn't expecting much
 interruptions from other processes.

 I was thinking of keeping track of when you expected each pulse to arrive
 next and sleeping until a little before you expected the soonest one.
 (Adjust a little by trial and error.)

This is a UNIX-like system?  If so use a select on the file
descriptor(s).This system call allows you to sleep until there is
data available on one of a set of files.   See man 2 select

The code right after the select() has to poll all the files to see
which one has data, your read/process it then go back an wait/sleep.
 If you do poll after a fixed length sleep you will on average to 1/2
of a polling cycle late reading the data and also you waste time
checking when nothing is there.

Chris Albertson
Redondo Beach, California

___
time-nuts mailing list -- time-nuts@febo.com
To unsubscribe, go to https://www.febo.com/cgi-bin/mailman/listinfo/time-nuts
and follow the instructions there.


Re: [time-nuts] [Solved] Looking for multiple PPS timestamp logging

2011-10-03 Thread Kevin Rosenberg
Thank you to everyone for their thought answers and insights, they gave
me some great ideas. I was thinking about the parallel port polling idea,
but then my son wanted to measure the relation between temperature and XO
frequency, so we needed microsecond resolution.

tvb came up with just the perfect solution:
  - Cheap, $5 per part
  - Easy for my son to construct, an 8-pin PIC and a bypass capacitor for
each PPS line
  - Easy to analyze results, one ASCII text line for each input pulse
  - Continuously counting indefinitely
  - sub-microsecond resolution (useful for measuring tempc for an XO)

Thanks again to everyone for their good thoughts and valuable time
spent considering my question.

Kevin



___
time-nuts mailing list -- time-nuts@febo.com
To unsubscribe, go to https://www.febo.com/cgi-bin/mailman/listinfo/time-nuts
and follow the instructions there.


Re: [time-nuts] [Solved] Looking for multiple PPS timestamp logging

2011-10-03 Thread Hal Murray

 I was thinking about the parallel port polling idea, but then my son wanted
 to measure the relation between temperature and XO frequency, so we needed
 microsecond resolution.

Why do you need microsecond resolution?

A junk XO will drift ballpark of 1 PPM per C.  That's 86 ms per day or 3.6 ms 
per hour.


What sort of resolution do you think you can get from a parallel port?

It might be fun to see how far you can push the parallel port.

How about a loop like this:
Initialization:
  grab old time
  grab old parallel port data
loop:
  grab new time
  grab new parallel port data
  if data changed:
grab newer time
log change that happened somewhere between old time and newer time
  old time = new time
  old data = new data
  goto loop

Post processing can filter out the occasional samples with a wide time window 
because the scheduler ran some other job at the wrong time.

For extra credit...  Suppose  you are expecting PPS type signals and you know 
roughly where they are located within a second.  There is no point is 
spinning when you aren't expecting something to happen.  So you can sleep 
until a bit before the next event.   That will let the scheduler run other 
jobs.  Hopefully it will be nicer to you when you do want to run.


-- 
These are my opinions, not necessarily my employer's.  I hate spam.




___
time-nuts mailing list -- time-nuts@febo.com
To unsubscribe, go to https://www.febo.com/cgi-bin/mailman/listinfo/time-nuts
and follow the instructions there.


Re: [time-nuts] [Solved] Looking for multiple PPS timestamp logging

2011-10-03 Thread Don Latham
Hi Hal: been watching this thread with some interest. Seems to me that
the layers that the MS operating systems and bios(es) put between the
parallel port and the programs using the port could introduce a lot of
variable latency. I think there may be some available dll's that go
around the shells?
Don

Hal Murray

 I was thinking about the parallel port polling idea, but then my son
 wanted
 to measure the relation between temperature and XO frequency, so we
 needed
 microsecond resolution.

 Why do you need microsecond resolution?

 A junk XO will drift ballpark of 1 PPM per C.  That's 86 ms per day or
 3.6 ms
 per hour.


 What sort of resolution do you think you can get from a parallel port?

 It might be fun to see how far you can push the parallel port.

 How about a loop like this:
 Initialization:
   grab old time
   grab old parallel port data
 loop:
   grab new time
   grab new parallel port data
   if data changed:
 grab newer time
 log change that happened somewhere between old time and newer time
   old time = new time
   old data = new data
   goto loop

 Post processing can filter out the occasional samples with a wide time
 window
 because the scheduler ran some other job at the wrong time.

 For extra credit...  Suppose  you are expecting PPS type signals and you
 know
 roughly where they are located within a second.  There is no point is
 spinning when you aren't expecting something to happen.  So you can
 sleep
 until a bit before the next event.   That will let the scheduler run
 other
 jobs.  Hopefully it will be nicer to you when you do want to run.


 --
 These are my opinions, not necessarily my employer's.  I hate spam.




 ___
 time-nuts mailing list -- time-nuts@febo.com
 To unsubscribe, go to
 https://www.febo.com/cgi-bin/mailman/listinfo/time-nuts
 and follow the instructions there.



-- 
Neither the voice of authority nor the weight of reason and argument
are as significant as experiment, for thence comes quiet to the mind.
R. Bacon
If you don't know what it is, don't poke it.
Ghost in the Shell


Dr. Don Latham AJ7LL
Six Mile Systems LLP
17850 Six Mile Road
POB 134
Huson, MT, 59846
VOX 406-626-4304
www.lightningforensics.com
www.sixmilesystems.com



___
time-nuts mailing list -- time-nuts@febo.com
To unsubscribe, go to https://www.febo.com/cgi-bin/mailman/listinfo/time-nuts
and follow the instructions there.


Re: [time-nuts] [Solved] Looking for multiple PPS timestamp logging

2011-10-03 Thread Tom Van Baak

Hal, Don,

I too have tried all the PC-based (serial/parallel port) solutions.
As we discussed at lot with the TEC thread, they work pretty
well. But for general use, or stand-alone operation, what I use
for dirt cheap non-nanosecond timing is a TBolt-10MHz-driven
isochronous microcontroller.


tvb came up with just the perfect solution:


Details here:

http://www.leapsecond.com/pic/picpet.htm

/tvb


___
time-nuts mailing list -- time-nuts@febo.com
To unsubscribe, go to https://www.febo.com/cgi-bin/mailman/listinfo/time-nuts
and follow the instructions there.


Re: [time-nuts] [Solved] Looking for multiple PPS timestamp logging

2011-10-03 Thread Kevin Rosenberg
On Oct 3, 2011, at 12:59 PM, Hal Murray wrote:
 Why do you need microsecond resolution?
 
 A junk XO will drift ballpark of 1 PPM per C.  That's 86 ms per day or 3.6 ms 
 per hour.

The temperature swings won't be large, just the usual diuneral indoor cycles.
He wants to use compute much much of the frequency change can be explained
by temperature alone, we were going to measure temperature and frequency
as precisely as is reasonable cost. So, it would be nice to measure a
microsecond difference in a second if the temperature very suddenly changed
by 1 degree C.

 What sort of resolution do you think you can get from a parallel port?

I think the point it moot now that tvb has the very useful picPET for
this application. I think resolution will depend upon the load of
the OS. I was going to use an old PC running linux and no graphics
mode. I think sub-millisecond stability is a reasonable expectation.
So, probably need to use fatPPS for the 10 usec PRS10 PPS.

 It might be fun to see how far you can push the parallel port.
 How about a loop like this: [...]

Yes, that about the flow that I was contemplating. I also planned
to use optoisolators on the input pins from the readings I did
on interfacings with a parallel port.

 For extra credit...  Suppose  you are expecting PPS type signals and you know 
 roughly where they are located within a second.  There is no point is 
 spinning when you aren't expecting something to happen.  So you can sleep 
 until a bit before the next event.   That will let the scheduler run other 
 jobs.  Hopefully it will be nicer to you when you do want to run.

Since we'd be measuring 4 PPS signals that won't be in phase, I wasn't planning
on sleeping for long. But, I some 10 usec sleeps with usleep(1) after
reading a pulse would be reasonable. But, with the system not doing anything 
but polling and writing to the disk, I wasn't expecting much interruptions from
other processes.

But, I really like Tom's picPET, not just for this project, but after my son's
project, I'm going to use 4 picPETs to measure stability across my group of 
Thunderbolts of varying vintage as well as comparing long-term drift across
some Rb oscillators.

Thanks again for the excellent parallel polling idea. I was going to go
with that plan before Tom letting me know about his picPETs.

Kevin


___
time-nuts mailing list -- time-nuts@febo.com
To unsubscribe, go to https://www.febo.com/cgi-bin/mailman/listinfo/time-nuts
and follow the instructions there.


Re: [time-nuts] [Solved] Looking for multiple PPS timestamp logging

2011-10-03 Thread Don Latham
Excellent, Tom. I missed it!
Don

Tom Van Baak
 Hal, Don,

 I too have tried all the PC-based (serial/parallel port) solutions.
 As we discussed at lot with the TEC thread, they work pretty
 well. But for general use, or stand-alone operation, what I use
 for dirt cheap non-nanosecond timing is a TBolt-10MHz-driven
 isochronous microcontroller.

 tvb came up with just the perfect solution:

 Details here:

 http://www.leapsecond.com/pic/picpet.htm

 /tvb


 ___
 time-nuts mailing list -- time-nuts@febo.com
 To unsubscribe, go to
 https://www.febo.com/cgi-bin/mailman/listinfo/time-nuts
 and follow the instructions there.



-- 
Neither the voice of authority nor the weight of reason and argument
are as significant as experiment, for thence comes quiet to the mind.
R. Bacon
If you don't know what it is, don't poke it.
Ghost in the Shell


Dr. Don Latham AJ7LL
Six Mile Systems LLP
17850 Six Mile Road
POB 134
Huson, MT, 59846
VOX 406-626-4304
www.lightningforensics.com
www.sixmilesystems.com



___
time-nuts mailing list -- time-nuts@febo.com
To unsubscribe, go to https://www.febo.com/cgi-bin/mailman/listinfo/time-nuts
and follow the instructions there.


Re: [time-nuts] [Solved] Looking for multiple PPS timestamp logging

2011-10-03 Thread Neville Michie

That looks like a great solution for monitoring oscillators/GPSDOs.
Where to find an application that inputs RS232 and writes a file?

cheers,
Neville Michie



On 04/10/2011, at 6:54 AM, Tom Van Baak wrote:


Hal, Don,

I too have tried all the PC-based (serial/parallel port) solutions.
As we discussed at lot with the TEC thread, they work pretty
well. But for general use, or stand-alone operation, what I use
for dirt cheap non-nanosecond timing is a TBolt-10MHz-driven
isochronous microcontroller.


tvb came up with just the perfect solution:


Details here:

http://www.leapsecond.com/pic/picpet.htm

/tvb


___
time-nuts mailing list -- time-nuts@febo.com
To unsubscribe, go to https://www.febo.com/cgi-bin/mailman/listinfo/ 
time-nuts

and follow the instructions there.



___
time-nuts mailing list -- time-nuts@febo.com
To unsubscribe, go to https://www.febo.com/cgi-bin/mailman/listinfo/time-nuts
and follow the instructions there.


Re: [time-nuts] [Solved] Looking for multiple PPS timestamp logging

2011-10-03 Thread Jim Lux

On 10/3/11 5:20 PM, Neville Michie wrote:

That looks like a great solution for monitoring oscillators/GPSDOs.
Where to find an application that inputs RS232 and writes a file?



Hyperterm?
Minicom?

in a DOS box
 mode COMn:9600,n,8,1
 copy COMn filename

You could suffer great mental pain and use one of the various .NET 
flavors, each of which has a different interface to the com ports, and 
crank out something in Visual C# Express Edition.




___
time-nuts mailing list -- time-nuts@febo.com
To unsubscribe, go to https://www.febo.com/cgi-bin/mailman/listinfo/time-nuts
and follow the instructions there.


Re: [time-nuts] [Solved] Looking for multiple PPS timestamp logging

2011-10-03 Thread Don Latham
I use a freebie language called Robot Basic. It is very flexible, easy
to use, has a yahoo group of users, and the price is right! It will run
on any of the Win os's and does not require installation, that is does
not use the pesky .net or the registry. .exe files can be made, too.
Don

Neville Michie
 That looks like a great solution for monitoring oscillators/GPSDOs.
 Where to find an application that inputs RS232 and writes a file?

 cheers,
 Neville Michie



 On 04/10/2011, at 6:54 AM, Tom Van Baak wrote:

 Hal, Don,

 I too have tried all the PC-based (serial/parallel port) solutions.
 As we discussed at lot with the TEC thread, they work pretty
 well. But for general use, or stand-alone operation, what I use
 for dirt cheap non-nanosecond timing is a TBolt-10MHz-driven
 isochronous microcontroller.

 tvb came up with just the perfect solution:

 Details here:

 http://www.leapsecond.com/pic/picpet.htm

 /tvb


 ___
 time-nuts mailing list -- time-nuts@febo.com
 To unsubscribe, go to https://www.febo.com/cgi-bin/mailman/listinfo/
 time-nuts
 and follow the instructions there.


 ___
 time-nuts mailing list -- time-nuts@febo.com
 To unsubscribe, go to
 https://www.febo.com/cgi-bin/mailman/listinfo/time-nuts
 and follow the instructions there.



-- 
Neither the voice of authority nor the weight of reason and argument
are as significant as experiment, for thence comes quiet to the mind.
R. Bacon
If you don't know what it is, don't poke it.
Ghost in the Shell


Dr. Don Latham AJ7LL
Six Mile Systems LLP
17850 Six Mile Road
POB 134
Huson, MT, 59846
VOX 406-626-4304
www.lightningforensics.com
www.sixmilesystems.com



___
time-nuts mailing list -- time-nuts@febo.com
To unsubscribe, go to https://www.febo.com/cgi-bin/mailman/listinfo/time-nuts
and follow the instructions there.


Re: [time-nuts] [Solved] Looking for multiple PPS timestamp logging

2011-10-03 Thread Tijd Dingen


  That looks like a great solution for monitoring oscillators/GPSDOs.
  Where to find an application that inputs RS232 and writes a file?

 I don't think you need anything very complex for that.   One could
 simply cat the serial port device to a log file

 cat /dev/tty01 | somename.log

I see someone beat me to it. ;)

Although around here we do:

cat /dev/ttyS0  somename.log

and

cat /dev/ttyS0 | five_seconds_of_perl.pl

 Anyone who could build a uP powered device could figure out somethig

 even nicer in about 5 seconds using Perl, Python or whatever.

My thoughts exactly.
___
time-nuts mailing list -- time-nuts@febo.com
To unsubscribe, go to https://www.febo.com/cgi-bin/mailman/listinfo/time-nuts
and follow the instructions there.