time-nuts@lists.febo.com

Discussion of precise time and frequency measurement

View all threads

``direct'' RS-232 vs. RS-232 via USB vs. PPS decoding cards

RN
Ruslan Nabioullin
Mon, Feb 13, 2017 4:07 PM

Hi, generally speaking, what are the performance differences between the
following: 1. direct RS-232 (i.e., what I believe is a standard PCI card
offering RS-232---essentially UARTs interfaced more-or-less directly to
the PCI bus); 2. RS-232 via USB; 3. PPS decoding PCI cards (which might
also have an IRIG input or even an onboard GNSS receiver).

Thanks in advance,
Ruslan

Hi, generally speaking, what are the performance differences between the following: 1. direct RS-232 (i.e., what I believe is a standard PCI card offering RS-232---essentially UARTs interfaced more-or-less directly to the PCI bus); 2. RS-232 via USB; 3. PPS decoding PCI cards (which might also have an IRIG input or even an onboard GNSS receiver). Thanks in advance, Ruslan
GE
Gary E. Miller
Mon, Feb 13, 2017 8:15 PM

Yo Ruslan!

On Mon, 13 Feb 2017 11:07:49 -0500
Ruslan Nabioullin rnabioullin@gmail.com wrote:

Hi, generally speaking, what are the performance differences between
the following: 1. direct RS-232 (i.e., what I believe is a standard
PCI card offering RS-232---essentially UARTs interfaced more-or-less
directly to the PCI bus); 2. RS-232 via USB; 3. PPS decoding PCI
cards (which might also have an IRIG input or even an onboard GNSS
receiver).

#2 will have a lot higher jitter than #1.  On a #2 you can expect
500 micro second best timing.  On a #1 you can get to 1 micro second.

On a RasPi using GPIO you can get to 500 nano second.  Data
available on request, but better on the devel@ntpsec.org list.

RGDS
GARY

Gary E. Miller Rellim 109 NW Wilmington Ave., Suite E, Bend, OR 97703
gem@rellim.com  Tel:+1 541 382 8588

    Veritas liberabit vos. -- Quid est veritas?
"If you can’t measure it, you can’t improve it." - Lord Kelvin
Yo Ruslan! On Mon, 13 Feb 2017 11:07:49 -0500 Ruslan Nabioullin <rnabioullin@gmail.com> wrote: > Hi, generally speaking, what are the performance differences between > the following: 1. direct RS-232 (i.e., what I believe is a standard > PCI card offering RS-232---essentially UARTs interfaced more-or-less > directly to the PCI bus); 2. RS-232 via USB; 3. PPS decoding PCI > cards (which might also have an IRIG input or even an onboard GNSS > receiver). #2 will have a lot higher jitter than #1. On a #2 you can expect 500 micro second best timing. On a #1 you can get to 1 micro second. On a RasPi using GPIO you can get to 500 nano second. Data available on request, but better on the devel@ntpsec.org list. RGDS GARY --------------------------------------------------------------------------- Gary E. Miller Rellim 109 NW Wilmington Ave., Suite E, Bend, OR 97703 gem@rellim.com Tel:+1 541 382 8588 Veritas liberabit vos. -- Quid est veritas? "If you can’t measure it, you can’t improve it." - Lord Kelvin
CA
Chris Albertson
Tue, Feb 14, 2017 5:24 AM

Pretty dramatic difference between a "real" serial port and USB.  Like two
orders of magnitude or more.

If you computer lacks a serial port, just buy a new computer.  The
Raspberry Pi or the like costs about $40.  But the money you save on
electric power will pay off that $40 in less than a year.

Why is this?  the serial port has a pin that is tied to an interrupt.  If
you read the code associated with that interrupt it is like maybe 4 or 6
lines of C and VERY simple.  USB on the other hand is packetized.
Nothing happens on till a block of data comes in and then it is quite
complex so the time from the pin going active to the internal counter being
sampled is quite variable  I said "two orders of magnitude"  it might even
be three orders.

On Mon, Feb 13, 2017 at 8:07 AM, Ruslan Nabioullin rnabioullin@gmail.com
wrote:

Hi, generally speaking, what are the performance differences between the
following: 1. direct RS-232 (i.e., what I believe is a standard PCI card
offering RS-232---essentially UARTs interfaced more-or-less directly to the
PCI bus); 2. RS-232 via USB; 3. PPS decoding PCI cards (which might also
have an IRIG input or even an onboard GNSS receiver).

Thanks in advance,
Ruslan


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

--

Chris Albertson
Redondo Beach, California

Pretty dramatic difference between a "real" serial port and USB. Like two orders of magnitude or more. If you computer lacks a serial port, just buy a new computer. The Raspberry Pi or the like costs about $40. But the money you save on electric power will pay off that $40 in less than a year. Why is this? the serial port has a pin that is tied to an interrupt. If you read the code associated with that interrupt it is like maybe 4 or 6 lines of C and VERY simple. USB on the other hand is packetized. Nothing happens on till a block of data comes in and then it is quite complex so the time from the pin going active to the internal counter being sampled is quite variable I said "two orders of magnitude" it might even be three orders. On Mon, Feb 13, 2017 at 8:07 AM, Ruslan Nabioullin <rnabioullin@gmail.com> wrote: > Hi, generally speaking, what are the performance differences between the > following: 1. direct RS-232 (i.e., what I believe is a standard PCI card > offering RS-232---essentially UARTs interfaced more-or-less directly to the > PCI bus); 2. RS-232 via USB; 3. PPS decoding PCI cards (which might also > have an IRIG input or even an onboard GNSS receiver). > > Thanks in advance, > Ruslan > _______________________________________________ > time-nuts mailing list -- time-nuts@febo.com > To unsubscribe, go to https://www.febo.com/cgi-bin/m > ailman/listinfo/time-nuts > and follow the instructions there. > -- Chris Albertson Redondo Beach, California
M
MLewis
Tue, Feb 14, 2017 6:15 AM

On 14/02/2017 12:24 AM, Chris Albertson wrote:

Pretty dramatic difference between a "real" serial port and USB.  Like two
orders of magnitude or more.

If you computer lacks a serial port, just buy a new computer.  The
Raspberry Pi or the like costs about $40.... the serial port has a pin that is tied to an interrupt.  If
you read the code associated with that interrupt it is like maybe 4 or 6
lines of C and VERY simple.
...

Great for picking up the PPS.
Know of any with an Ethernet port, preferably two, that aren't run from
a USB controller?

Michael

On 14/02/2017 12:24 AM, Chris Albertson wrote: > Pretty dramatic difference between a "real" serial port and USB. Like two > orders of magnitude or more. > > If you computer lacks a serial port, just buy a new computer. The > Raspberry Pi or the like costs about $40.... the serial port has a pin that is tied to an interrupt. If > you read the code associated with that interrupt it is like maybe 4 or 6 > lines of C and VERY simple. > ... Great for picking up the PPS. Know of any with an Ethernet port, preferably two, that aren't run from a USB controller? Michael
BC
Bob Camp
Tue, Feb 14, 2017 12:26 PM

Hi

A direct port might be a +/- 100 ns sort of thing most of the time and a +/-10 us
thing every so often under some OS’s. Most desktop operating systems are not
designed to prioritize random pin interrupts. A dirt cheap MCU coded with a few
(hundred) lines of assembly code may be a better option than a typical desktop.
Complicating this further is the degree to which some OS’s can be directly or
indirectly optimized. Install this package and it all goes nuts. Install that package
and not much happens ….

Bob

On Feb 13, 2017, at 11:07 AM, Ruslan Nabioullin rnabioullin@gmail.com wrote:

Hi, generally speaking, what are the performance differences between the following: 1. direct RS-232 (i.e., what I believe is a standard PCI card offering RS-232---essentially UARTs interfaced more-or-less directly to the PCI bus); 2. RS-232 via USB; 3. PPS decoding PCI cards (which might also have an IRIG input or even an onboard GNSS receiver).

Thanks in advance,
Ruslan


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.

Hi A direct port might be a +/- 100 ns sort of thing most of the time and a +/-10 us thing every so often under some OS’s. Most desktop operating systems are not designed to prioritize random pin interrupts. A dirt cheap MCU coded with a few (hundred) lines of assembly code may be a better option than a typical desktop. Complicating this further is the degree to which some OS’s can be directly or indirectly optimized. Install *this* package and it all goes nuts. Install that package and not much happens …. Bob > On Feb 13, 2017, at 11:07 AM, Ruslan Nabioullin <rnabioullin@gmail.com> wrote: > > Hi, generally speaking, what are the performance differences between the following: 1. direct RS-232 (i.e., what I believe is a standard PCI card offering RS-232---essentially UARTs interfaced more-or-less directly to the PCI bus); 2. RS-232 via USB; 3. PPS decoding PCI cards (which might also have an IRIG input or even an onboard GNSS receiver). > > Thanks in advance, > Ruslan > _______________________________________________ > 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.
M
MLewis
Tue, Feb 14, 2017 3:31 PM

On 14/02/2017 7:26 AM, Bob Camp wrote:

Hi

A direct port might be a +/- 100 ns sort of thing most of the time and a +/-10 us
thing every so often under some OS’s. Most desktop operating systems are not
designed to prioritize random pin interrupts. A dirt cheap MCU coded with a few
(hundred) lines of assembly code may be a better option than a typical desktop.
Complicating this further is the degree to which some OS’s can be directly or
indirectly optimized. Install this package and it all goes nuts. Install that package
and not much happens ….

Bob

Hence, wouldn't Best Practice be boxes loaded with only the bare OS and
software for the time-related tasks?
As in:

  • a dedicated machine/box for unencumbered acceptance of PPS, and
  • for systems with a business need, a dedicated NTP server/box
    disciplined by the PPS source (with dedicated communication), while
    maintaining internet NTP sources as backup for when the PPS source fails?
    Is there a better way?
    Other considerations?

Michael

On 14/02/2017 7:26 AM, Bob Camp wrote: > Hi > > A direct port might be a +/- 100 ns sort of thing most of the time and a +/-10 us > thing every so often under some OS’s. Most desktop operating systems are not > designed to prioritize random pin interrupts. A dirt cheap MCU coded with a few > (hundred) lines of assembly code may be a better option than a typical desktop. > Complicating this further is the degree to which some OS’s can be directly or > indirectly optimized. Install *this* package and it all goes nuts. Install that package > and not much happens …. > > Bob > Hence, wouldn't Best Practice be boxes loaded with only the bare OS and software for the time-related tasks? As in: - a dedicated machine/box for unencumbered acceptance of PPS, and - for systems with a business need, a dedicated NTP server/box disciplined by the PPS source (with dedicated communication), while maintaining internet NTP sources as backup for when the PPS source fails? Is there a better way? Other considerations? Michael
CA
Chris Albertson
Tue, Feb 14, 2017 5:33 PM

Here is a something that could work.  It has a real serial port and you
could add more ethernet controllers, uses very little power and cost only
$60.
www.newegg.com/....
https://www.newegg.com/Product/Product.aspx?Item=N82E16813157497&cm_re=j1900-_-13-157-497-_-Product

There are other boards like this that use the same J1900 CPU.  I'm
thinking about using this as th machine tool (milling machine) controller.

On Tue, Feb 14, 2017 at 4:26 AM, Bob Camp kb8tq@n1k.org wrote:

Hi

A direct port might be a +/- 100 ns sort of thing most of the time and a
+/-10 us
thing every so often under some OS’s. Most desktop operating systems are
not
designed to prioritize random pin interrupts. A dirt cheap MCU coded with
a few
(hundred) lines of assembly code may be a better option than a typical
desktop.
Complicating this further is the degree to which some OS’s can be directly
or
indirectly optimized. Install this package and it all goes nuts. Install
that package
and not much happens ….

Bob

On Feb 13, 2017, at 11:07 AM, Ruslan Nabioullin rnabioullin@gmail.com

wrote:

Hi, generally speaking, what are the performance differences between the

following: 1. direct RS-232 (i.e., what I believe is a standard PCI card
offering RS-232---essentially UARTs interfaced more-or-less directly to the
PCI bus); 2. RS-232 via USB; 3. PPS decoding PCI cards (which might also
have an IRIG input or even an onboard GNSS receiver).

Thanks in advance,
Ruslan


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.

--

Chris Albertson
Redondo Beach, California

Here is a something that could work. It has a real serial port and you could add more ethernet controllers, uses very little power and cost only $60. www.newegg.com/.... <https://www.newegg.com/Product/Product.aspx?Item=N82E16813157497&cm_re=j1900-_-13-157-497-_-Product> There are other boards like this that use the same J1900 CPU. I'm thinking about using this as th machine tool (milling machine) controller. On Tue, Feb 14, 2017 at 4:26 AM, Bob Camp <kb8tq@n1k.org> wrote: > Hi > > A direct port might be a +/- 100 ns sort of thing most of the time and a > +/-10 us > thing every so often under some OS’s. Most desktop operating systems are > not > designed to prioritize random pin interrupts. A dirt cheap MCU coded with > a few > (hundred) lines of assembly code may be a better option than a typical > desktop. > Complicating this further is the degree to which some OS’s can be directly > or > indirectly optimized. Install *this* package and it all goes nuts. Install > that package > and not much happens …. > > Bob > > > On Feb 13, 2017, at 11:07 AM, Ruslan Nabioullin <rnabioullin@gmail.com> > wrote: > > > > Hi, generally speaking, what are the performance differences between the > following: 1. direct RS-232 (i.e., what I believe is a standard PCI card > offering RS-232---essentially UARTs interfaced more-or-less directly to the > PCI bus); 2. RS-232 via USB; 3. PPS decoding PCI cards (which might also > have an IRIG input or even an onboard GNSS receiver). > > > > Thanks in advance, > > Ruslan > > _______________________________________________ > > 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. > -- Chris Albertson Redondo Beach, California
BC
Bob Camp
Tue, Feb 14, 2017 6:49 PM

Hi

On Feb 14, 2017, at 10:31 AM, MLewis mlewis000@rogers.com wrote:

On 14/02/2017 7:26 AM, Bob Camp wrote:

Hi

A direct port might be a +/- 100 ns sort of thing most of the time and a +/-10 us
thing every so often under some OS’s. Most desktop operating systems are not
designed to prioritize random pin interrupts. A dirt cheap MCU coded with a few
(hundred) lines of assembly code may be a better option than a typical desktop.
Complicating this further is the degree to which some OS’s can be directly or
indirectly optimized. Install this package and it all goes nuts. Install that package
and not much happens ….

Bob

Hence, wouldn't Best Practice be boxes loaded with only the bare OS and software for the time-related tasks?

That would be one approach.

As in:

  • a dedicated machine/box for unencumbered acceptance of PPS, and
  • for systems with a business need, a dedicated NTP server/box disciplined by the PPS source (with dedicated communication), while maintaining internet NTP sources as backup for when the PPS source fails?
    Is there a better way?

It depends on what you are trying to do. If the objective is to replace a piece of test gear
logging 100% of your events at the 100ns level, the computer likely will not measure up. If the objective is to run
NTP at the 100 us level, there are a lot more things you can get away with. NTP is designed from the
ground up to be quite tolerant of various issues.

Bob

Other considerations?

Michael


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.

Hi > On Feb 14, 2017, at 10:31 AM, MLewis <mlewis000@rogers.com> wrote: > > > > On 14/02/2017 7:26 AM, Bob Camp wrote: >> Hi >> >> A direct port might be a +/- 100 ns sort of thing most of the time and a +/-10 us >> thing every so often under some OS’s. Most desktop operating systems are not >> designed to prioritize random pin interrupts. A dirt cheap MCU coded with a few >> (hundred) lines of assembly code may be a better option than a typical desktop. >> Complicating this further is the degree to which some OS’s can be directly or >> indirectly optimized. Install *this* package and it all goes nuts. Install that package >> and not much happens …. >> >> Bob >> > Hence, wouldn't Best Practice be boxes loaded with only the bare OS and software for the time-related tasks? That would be one approach. > As in: > - a dedicated machine/box for unencumbered acceptance of PPS, and > - for systems with a business need, a dedicated NTP server/box disciplined by the PPS source (with dedicated communication), while maintaining internet NTP sources as backup for when the PPS source fails? > Is there a better way? It depends on what you are trying to do. If the objective is to replace a piece of test gear logging 100% of your events at the 100ns level, the computer likely will not measure up. If the objective is to run NTP at the 100 us level, there are a lot more things you can get away with. NTP is designed from the ground up to be quite tolerant of various issues. Bob > Other considerations? > > Michael > > > > _______________________________________________ > 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.
TV
Tom Van Baak
Tue, Feb 14, 2017 7:31 PM

Hence, wouldn't Best Practice be boxes loaded with only the bare OS and
software for the time-related tasks?

If you find yourself in a situation like this -- where your timing seems to improve the less load you have -- that's a sure sign that you're doing the timing wrong in the first place.

Best practices are to do 1PPS timing in hardware using capture registers (which almost every microcontroller has). That way there's a separation between the critical act of making a timing measurement from the non-critical act of delivering the measurement result the operating system. You still use interrupts -- but now the purpose of the interrupt is simply to indicate that a fresh measurement result is ready, rather than the interrupt itself being the measurement. The result is that the time stamp / capture register method is immune to interrupt latency and system load issues.

Best practices number two are to replace the crystal on the motherboard with a TCXO or OCXO. Then, with the help of NTP, your computer is finally acting like a GPSDO.

/tvb

> Hence, wouldn't Best Practice be boxes loaded with only the bare OS and > software for the time-related tasks? If you find yourself in a situation like this -- where your timing seems to improve the less load you have -- that's a sure sign that you're doing the timing wrong in the first place. Best practices are to do 1PPS timing in hardware using capture registers (which almost every microcontroller has). That way there's a separation between the critical act of *making* a timing measurement from the non-critical act of *delivering* the measurement result the operating system. You still use interrupts -- but now the purpose of the interrupt is simply to indicate that a fresh measurement result is ready, rather than the interrupt itself being the measurement. The result is that the time stamp / capture register method is immune to interrupt latency and system load issues. Best practices number two are to replace the crystal on the motherboard with a TCXO or OCXO. Then, with the help of NTP, your computer is finally acting like a GPSDO. /tvb
SS
Scott Stobbe
Tue, Feb 14, 2017 10:26 PM

Something like this would make a great NTP server.
https://www.digikey.com/products/en?keywords=P0286-ND

Too bad they didn't include a PTP 1588 capable PHY...

On Tue, Feb 14, 2017 at 12:33 PM, Chris Albertson <albertson.chris@gmail.com

wrote:

Here is a something that could work.  It has a real serial port and you
could add more ethernet controllers, uses very little power and cost only
$60.
www.newegg.com/....
<https://www.newegg.com/Product/Product.aspx?Item=
N82E16813157497&cm_re=j1900--13-157-497--Product>

There are other boards like this that use the same J1900 CPU.  I'm
thinking about using this as th machine tool (milling machine) controller.

On Tue, Feb 14, 2017 at 4:26 AM, Bob Camp kb8tq@n1k.org wrote:

Hi

A direct port might be a +/- 100 ns sort of thing most of the time and a
+/-10 us
thing every so often under some OS’s. Most desktop operating systems are
not
designed to prioritize random pin interrupts. A dirt cheap MCU coded with
a few
(hundred) lines of assembly code may be a better option than a typical
desktop.
Complicating this further is the degree to which some OS’s can be

directly

or
indirectly optimized. Install this package and it all goes nuts.

Install

that package
and not much happens ….

Bob

On Feb 13, 2017, at 11:07 AM, Ruslan Nabioullin <rnabioullin@gmail.com

wrote:

Hi, generally speaking, what are the performance differences between

the

following: 1. direct RS-232 (i.e., what I believe is a standard PCI card
offering RS-232---essentially UARTs interfaced more-or-less directly to

the

PCI bus); 2. RS-232 via USB; 3. PPS decoding PCI cards (which might also
have an IRIG input or even an onboard GNSS receiver).

Thanks in advance,
Ruslan


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.

--

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.

Something like this would make a great NTP server. https://www.digikey.com/products/en?keywords=P0286-ND Too bad they didn't include a PTP 1588 capable PHY... On Tue, Feb 14, 2017 at 12:33 PM, Chris Albertson <albertson.chris@gmail.com > wrote: > Here is a something that could work. It has a real serial port and you > could add more ethernet controllers, uses very little power and cost only > $60. > www.newegg.com/.... > <https://www.newegg.com/Product/Product.aspx?Item= > N82E16813157497&cm_re=j1900-_-13-157-497-_-Product> > > There are other boards like this that use the same J1900 CPU. I'm > thinking about using this as th machine tool (milling machine) controller. > > On Tue, Feb 14, 2017 at 4:26 AM, Bob Camp <kb8tq@n1k.org> wrote: > > > Hi > > > > A direct port might be a +/- 100 ns sort of thing most of the time and a > > +/-10 us > > thing every so often under some OS’s. Most desktop operating systems are > > not > > designed to prioritize random pin interrupts. A dirt cheap MCU coded with > > a few > > (hundred) lines of assembly code may be a better option than a typical > > desktop. > > Complicating this further is the degree to which some OS’s can be > directly > > or > > indirectly optimized. Install *this* package and it all goes nuts. > Install > > that package > > and not much happens …. > > > > Bob > > > > > On Feb 13, 2017, at 11:07 AM, Ruslan Nabioullin <rnabioullin@gmail.com > > > > wrote: > > > > > > Hi, generally speaking, what are the performance differences between > the > > following: 1. direct RS-232 (i.e., what I believe is a standard PCI card > > offering RS-232---essentially UARTs interfaced more-or-less directly to > the > > PCI bus); 2. RS-232 via USB; 3. PPS decoding PCI cards (which might also > > have an IRIG input or even an onboard GNSS receiver). > > > > > > Thanks in advance, > > > Ruslan > > > _______________________________________________ > > > 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. > > > > > > -- > > 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. >