Thread: [Linuxptp-users] grandmaster with an H/P 3805A GPS disciplined osc
PTP IEEE 1588 stack for Linux
Brought to you by:
rcochran
From: David G. <dav...@po...> - 2013-08-20 21:00:16
Attachments:
signature.asc
|
I was wondering if I use NTPd for controlling the GPS radio with its built-in driver for it along with the PPS signal on the comport as the DCD line <http://support.ntp.org/bin/view/Support/Z3801AReceiverModifications>, would this share the same counter for PTP? -- David Gravereaux <dav...@po...> |
From: Richard C. <ric...@gm...> - 2013-08-21 05:48:15
|
On Tue, Aug 20, 2013 at 02:00:05PM -0700, David Gravereaux wrote: > I was wondering if I use NTPd for controlling the GPS radio with its > built-in driver for it along with the PPS signal on the comport as the > DCD line > <http://support.ntp.org/bin/view/Support/Z3801AReceiverModifications>, > would this share the same counter for PTP? This setup will synchronize the Linux system time to the external Z3801A box using a PPS signal. You could use ptp4l with software time stamping and the 'free_running' option to serve this time to your network. HTH, Richard |
From: Richard C. <ric...@gm...> - 2013-08-21 06:09:29
|
On Wed, Aug 21, 2013 at 07:47:54AM +0200, Richard Cochran wrote: > On Tue, Aug 20, 2013 at 02:00:05PM -0700, David Gravereaux wrote: > > I was wondering if I use NTPd for controlling the GPS radio with its > > built-in driver for it along with the PPS signal on the comport as the > > DCD line > > <http://support.ntp.org/bin/view/Support/Z3801AReceiverModifications>, > > would this share the same counter for PTP? > > This setup will synchronize the Linux system time to the external > Z3801A box using a PPS signal. You could use ptp4l with software time > stamping and the 'free_running' option to serve this time to your > network. But you have an Intel i210, right? So it would be even better to feed the PPS from the Z3801A into one of the i210's SDP pins. (Be careful with the signal conditioning, SDP is CMOS directly to the chip.) I posted a igb patch on netdev to enable the SDP functions. This was not accepted into mainline (I'll have to make minor changes first), but it does work. You can patch your kernel with it. Then you can use the i210's external time stamps of the PPS to discipline the i210's clock. You will have to write some code, but you can re-use phc2sys and the testptp program, as they have most of what you need. The PPS will give you the phase offset from the full second, and you can read the time and date from the serial port. Good luck, Richard |
From: Miroslav L. <mli...@re...> - 2013-08-21 07:32:26
|
On Wed, Aug 21, 2013 at 08:09:08AM +0200, Richard Cochran wrote: > On Wed, Aug 21, 2013 at 07:47:54AM +0200, Richard Cochran wrote: > > On Tue, Aug 20, 2013 at 02:00:05PM -0700, David Gravereaux wrote: > > > I was wondering if I use NTPd for controlling the GPS radio with its > > > built-in driver for it along with the PPS signal on the comport as the > > > DCD line > > > <http://support.ntp.org/bin/view/Support/Z3801AReceiverModifications>, > > > would this share the same counter for PTP? > > > > This setup will synchronize the Linux system time to the external > > Z3801A box using a PPS signal. You could use ptp4l with software time > > stamping and the 'free_running' option to serve this time to your > > network. > > But you have an Intel i210, right? > > So it would be even better to feed the PPS from the Z3801A into one of > the i210's SDP pins. (Be careful with the signal conditioning, SDP is > CMOS directly to the chip.) Just to list all options, if the requirement is to have the PTP slaves well synced together, but the absolute accuracy of the PTP time doesn't matter match, the PHC can be synchronized from the system clock by phc2sys with a very slow PI servo and used by ptp4l without losing hw time stamping. e.g. phc2sys -w -c eth0 -s CLOCK_REALTIME -P 0.03 -I 0.0001 -- Miroslav Lichvar |
From: David G. <dav...@po...> - 2013-08-21 07:51:20
Attachments:
signature.asc
|
On 08/20/2013 11:09 PM, Richard Cochran wrote: > On Wed, Aug 21, 2013 at 07:47:54AM +0200, Richard Cochran wrote: >> On Tue, Aug 20, 2013 at 02:00:05PM -0700, David Gravereaux wrote: >>> I was wondering if I use NTPd for controlling the GPS radio with its >>> built-in driver for it along with the PPS signal on the comport as the >>> DCD line >>> <http://support.ntp.org/bin/view/Support/Z3801AReceiverModifications>, >>> would this share the same counter for PTP? >> >> This setup will synchronize the Linux system time to the external >> Z3801A box using a PPS signal. You could use ptp4l with software time >> stamping and the 'free_running' option to serve this time to your >> network. > > But you have an Intel i210, right? > > So it would be even better to feed the PPS from the Z3801A into one of > the i210's SDP pins. (Be careful with the signal conditioning, SDP is > CMOS directly to the chip.) > > I posted a igb patch on netdev to enable the SDP functions. This was > not accepted into mainline (I'll have to make minor changes first), > but it does work. You can patch your kernel with it. > > Then you can use the i210's external time stamps of the PPS to > discipline the i210's clock. You will have to write some code, but > you can re-use phc2sys and the testptp program, as they have most of > what you need. > > The PPS will give you the phase offset from the full second, and you > can read the time and date from the serial port. > > Good luck, > Richard > Awesome! I thought there might have been hardware support in the card, but wasn't sure. Let me meditate on this for a bit. Writing C is what I live for. I won't get the radio for a couple weeks yet. I want to get a leg-up on this "stock" workstation if possible before moving to PC/104e -- David Gravereaux <dav...@po...> |
From: David G. <dav...@po...> - 2013-08-21 22:38:39
Attachments:
signature.asc
|
On 08/20/2013 11:09 PM, Richard Cochran wrote: > The PPS will give you the phase offset from the full second, and you > can read the time and date from the serial port. Richard, I love this idea. But being a newb, I don't understand how all the parts work. Could you walk me though this? Conceptually, yes, I want to train the high-res clock of the i210 from the radio. And from that, or maybe in parallel with, train the system clock. First, I don't understand what phc2sys is used for. If I'm running the ptp4l daemon as a slave with free-running off, the daemon is setting and training system clock, yes? Or is it just the clock of the controller? Now if I'm using ptp as a grandmaster, who trains the /dev/ptp0 and how? Or if I'm driving a PPS input at the comport's DCD line that NTPd is using through its atom driver to /dev/pps0, is this managed by ptp4l for slewing the card's clock? Yeah, I'm lost. -- David Gravereaux <dav...@po...> |
From: Richard C. <ric...@gm...> - 2013-08-22 05:34:11
|
On Wed, Aug 21, 2013 at 03:38:26PM -0700, David Gravereaux wrote: > > Conceptually, yes, I want to train the high-res clock of the i210 from > the radio. And from that, or maybe in parallel with, train the system > clock. Okay. > First, I don't understand what phc2sys is used for. If I'm running the > ptp4l daemon as a slave with free-running off, the daemon is setting and > training system clock, yes? No, just /dev/ptp0. The phc2sys program is for syncing CLOCK_REALTIME to /dev/ptp0. [ But if you select SW time stamping, then ptp4l will discipline CLOCK_REALTIME instead of /dev/ptp0. In that case, you don't need to run phc2sys at all. ] > Or is it just the clock of the controller? Yes. > Now if I'm using ptp as a grandmaster, who trains the /dev/ptp0 and how? (That would be the program that you are going to write ;) > Or if I'm driving a PPS input at the comport's DCD line that NTPd is > using through its atom driver to /dev/pps0, is this managed by ptp4l for > slewing the card's clock? No, it is not managed by ptp4l. You have to make sure that, if run them at the same time, ntpd and ptp4l/phc2sys do not step on each other's toes. > Yeah, I'm lost. I think you are on the right track. (At least you are asking the right questions :) Thanks, Richard |
From: David G. <dav...@po...> - 2013-08-22 06:50:43
Attachments:
signature.asc
|
On 08/21/2013 10:33 PM, Richard Cochran wrote: > I think you are on the right track. (At least you are asking the right > questions :) EPIC! Thanks. So many toes on this foot. -- David Gravereaux <dav...@po...> |
From: David G. <dav...@po...> - 2013-08-22 07:49:04
Attachments:
signature.asc
|
On 08/21/2013 10:33 PM, Richard Cochran wrote: > On Wed, Aug 21, 2013 at 03:38:26PM -0700, David Gravereaux wrote: >> Now if I'm using ptp as a grandmaster, who trains the /dev/ptp0 and how? > > (That would be the program that you are going to write ;) > >> Or if I'm driving a PPS input at the comport's DCD line that NTPd is >> using through its atom driver to /dev/pps0, is this managed by ptp4l for >> slewing the card's clock? > > No, it is not managed by ptp4l. You have to make sure that, if run > them at the same time, ntpd and ptp4l/phc2sys do not step on each > other's toes. So instead of phc2sys, I'm wanting a gps2phc+rtc ;) If my head is screwed on right, this almost gets me there given system clock is the reference for start offset, but takes over from PPS, though not a physical signal to the NIC. phc2sys -wmql 7 -d /dev/pps0 -s CLOCK_REALTIME -c /dev/ptp0 If this is true, I'd be happy with this for the moment. -- David Gravereaux <dav...@po...> |
From: Miroslav L. <mli...@re...> - 2013-08-22 08:08:36
|
On Thu, Aug 22, 2013 at 12:48:51AM -0700, David Gravereaux wrote: > So instead of phc2sys, I'm wanting a gps2phc+rtc ;) > > If my head is screwed on right, this almost gets me there given system > clock is the reference for start offset, but takes over from PPS, though > not a physical signal to the NIC. > > phc2sys -wmql 7 -d /dev/pps0 -s CLOCK_REALTIME -c /dev/ptp0 > > If this is true, I'd be happy with this for the moment. The PPS time stamps are always relative to the system clock, so it can be used only with CLOCK_REALTIME as the slave clock. (phc2sys should print an error message if not) You can split it in to two phc2sys commands, one synchronizing the system clock from the PPS (ntpd must be disabled or configured to not touch the system clock) and the other synchronizing the PHC from the system clock. -- Miroslav Lichvar |
From: David G. <dav...@po...> - 2013-08-22 08:47:56
Attachments:
signature.asc
|
On 08/22/2013 01:08 AM, Miroslav Lichvar wrote: > The PPS time stamps are always relative to the system clock, so it can > be used only with CLOCK_REALTIME as the slave clock. (phc2sys should > print an error message if not) Yup, looks like I'm writing a radio driver myself then. The Z3805A has two ports anyways. One for the SCPI commands and the other spits format2 time continually, which beats the poll and grab it a second later thing the NTPd driver does. -- David Gravereaux <dav...@po...> |