I saw someone talk about using a MAX232 chip to level-shift a PPS pulse.
If you need to level-shift serial data, that's a good idea, but there
are easier ways to do a PPS pulse on a typical personal computer.
RS-232 is supposed to be driven at +/-5 to +/-12 V and received at +/-3V.
Between -3V and +3V is "undefined", although most receivers can accept it.
Anyway, if you have something like an old Trimble GPS receiver that has
an open-collector PPS output, that the GPS reciever pulls to ground
every second, it's easy to connect that to a PPS pin with a few components:
Open-collector PPS >-----+---||---+----------> DCD
| |
| +--/\/\/---< 5V
+--/\/\/------------< 12V
Make both resistors 4.7K (or so) and the capacitor something like 10 uF
(larger is always fine). By "or so", I mean that 470 ohms or 47K might
be pushing it, but within a factor of 3 should be fine.
Most of the time, the resistors will hold the lines at the appropriate
levels and the capacitor will have 7V across it.
When the PPS line is pulled to ground, the capacitor will hold 7V across
it for a brief while, even with the resistor trying to object (over
1 ms, a 10 uF capactor looks like a 100 ohm resistor), and the DCD
input will be pulled to -7V.
Which is a nice high-quality RS-232 signal edge. (The rising edge will
be ratty, so don't use that.)
If you have a 0-5V rising edge PPS pulse, like on the Garmin receivers,
you can convert it to the above with a single NPN transistor:
+----+---||---+----------> DCD
|/ | |
0-5V PPS >--------| | +--/\/\/---< 5V
|\ +--/\/\/------------< 12V
v
+------------------------< GND
You can find 12V, 5V and GND in the yellow, red, and black (respectively) wires
of any AT/ATX power supply. The transistor can be anything.
Terminology in case you need it: in the above diagram, the 0-5 PPS signal
goes into the BASE at 9:00, GND is connected to the EMITTER (with the
arrow pointing outward) at 5:00, and the COLLECTOR at 1:00 is pulled up
to 12V.
It doesn't tke much skill to solder either of these together and fit it into
a 9-pin serial connector shell. Note that the second circuit will invert
the PPS pulse; a rising edge will become a falling edge on the DCD input.
(In NTP terms, that's "fudge 127.127.22.0 flag2 1".)
Alternatively, you could gamble that your serial port will accept +/-2.5V
inputs and try the even simpler circuit:
0-5V PPS >------||---+----------> DCD
|
+--/\/\/---< 5V
|
+--/\/\/---< GND
The two resistors to 5V and GND must be equal and not be too small
(4.7K will do, but 10K would be better). Together, they pull the DCD input
to +2.5V, and the PPS pulse will drive it to -2.5V when it arrives.
This is playing fast & loose with the RS-232 spec, however, and might not
work reliably. It does NOT invert the PPS pulse, just shifts it down by
-2.5V so the RS-232 receiver can see it.
None of these are good enough to pass serial data, but taking advantage
of the fact that a PPS signal is only active in brief, well-spaced pulses,
you can do it really cheap and nasty without degrading the signal.
_______________________________________________
timekeepers mailing list
[email protected]
https://fortytwo.ch/mailman/cgi-bin/listinfo/timekeepers