}

The Agile ICC computer (nimble) contains a high-accuracy GPS-synchronized timer card that emits pulses that trigger readout of the Agile camera when run in external synch mode.

The card is a PCI-SyncClock32 with the DIVGATE option and BCD time. The recommended configuration for Agile has no GPS receiver (see 1 PPS Vs. The Built-In GPS Receiver below). We bought the card from Brandywine Communications. Technical support has been from John Kates of jxi2, so I assume jxi2 makes the card.

DIVGATE Option

The DIVGATE option is necessary to start a pulse sequence at a known time. This allows the heartbeat counter (and other outputs driven by the dividers 0-2) to be synched to the integer second.

Without the DIVGATE option, starting a pulse sequence involves sending a "rejam" to configure the new pulse rate. Rejam resets the whole timer card, so it temporarily loses track of time and the new pulse sequence will not start at a predictable time. You can also get spurious extra pulses.

Driving Agile

The heartbeat output of the timer card is connected to the external synch input of the Agile camera. Pulses are output using heartbeat mode, in which the timer card outputs pulses at a fixed rate indefinitely (until the heartbeat is turned off or the rate is changed). The heartbeat pulse mode is DP_ctl_mode2: the output is normally high, but goes low for each pulse for one clock cycle, which is 10 milliseconds. This is crucial because if the output is still low when the Agile camera has finished reading the exposure, it will read another exposure (despite the fact that the Agile sync pulse is advertised as being edge triggered; don't you just love Princeton Instruments?).

The timer card is configured for slow heartbeat: clock ticks are 10 milliseconds long. This offers a nice balance of long maximum exposure time and good resolution. The alternative is fast heartbeat: 0.333... microsecond clock ticks, which would give a maximum exposure time that is too short to be useful.

An alternative design is to schedule each pulse individually. The advantage is you don't have to reconfigure the card at all (so the DIVGATE option is not required) and you don't have to guess when the pulse train starts, since each tick comes exactly when you command it. However, it is intrinsically a bit fragile because it requires the software to reliably configure each pulse; if your code is late for some reason then you will miss an exposure.

If the Card Hangs

We have had some trouble with the card failing to start a new pulse sequence correctly. The card cannot see heartbeat pulses at all, but the camera seems to see a fast stream of pulses and so the exposure sequence fails right away. It was a very intermittent problem so I put in some print statements to document exactly what calls we were making to the timer card drivers (to have something concrete to send to tech support), but when I added those print statements the problem went away. So it is most likely a timing issue, e.g. not waiting long enough between two operations.

If the problem does occur, use the program setheartbeat (an example in my syncclock package) followed by stopheartbeat to start and stop a timing sequence. That always seems to get the card running again. Simply commanding another exposure does not, unfortunately, fix the problem.

1 PPS Vs. The Built-In GPS Receiver

We bought a card that has an on-board GPS receiver (so that Agile could be run standalone, e.g. as a visiting instrument at other observatories), with the understanding that we could choose to either use GPS or synchronize the card with an external 1 PPS pulse or IRIG. Unfortunately that turned out to be false.

As it turns out, the built-in GPS receiver drives the 1 PPS line. Thus you must not feed 1 PPS in as long as the built-in GPS receiver is connected. To disconnect the built-in GPS receiver, do either of:

  • Remove zero-ohm resitors JP6 and JP9 (GPS 1 PPS and GPS serial output).
  • Remove the GPS receiver entirely (this is what we did):
    • Remove the metal plate on the connector edge of the board
      • Unscrew the outer nut on the BNC GPS antenna jack
      • Remove the two spacer nuts on the high-density D26 connector
      • Remove the metal plate on the edge of the board
    • Remove the GPS receiver (with its antenna attached)
      • unscrew the 4 plastic nuts holding the GPS daughtercard
      • carefully lift off the daughtercard
    • Reattach the metal plate by reattaching the two spacer nuts to the D26 connector

Notes:

  • It is safer to feed external 1 PPS in on pin 18 (HaveQuick 1 PPS) of the high-density 26-pin connector, instead of pin 9. Pin 18 includes protection circuitry. See circuit diagram 1 of 4, middle bottom; PTTI1PPS is pin 18, and REF is pin 9 and they are connected together via some protection circuitry.
  • To terminate the 1 PPS input on pin 18 (but not pin 9) with 50 ohms put a jumper across P10. (As shown in the circuit just mentioned above).
  • Note: the best way to feed a 1 PPS signal to multiple devices is to daisy-chain it and terminate the only the end of the chain.
  • One can examine extended status (in dual port RAM). There are 5 bits; bit 2 (starting from 0) is "1 PPS is NOT valid" if high.
  • Using external 1 PPS with on a GPS receiver mode is not fully supported, in that the timer card's firmware has been programmed to assume a GPS, but the tech support person claimed it would work.
  • They can sell us a firmware update that will support both the GPS and 1 PPS input at the same time. It involves changing on EPROM and removing RZP, a zero-ohm resistor. With these changes, an external 1 PPS will be used if the GPS receiver is not picking anything up.
  • Fortunately we did NOT fry the GPS receiver by feeding our own 1 PPS into pin 9. I saw this by performing the suggested test -- look at pin 9 on an oscilloscope. If it has 1 PPS, that is coming from the built-in GPS receiver.
  • It is OK for one process to keep a connection to the card while another process uses it. Just avoid command conflicts, of course.

IRIG-B vs GPS

Unlike 1 PPS, IRIG-B (and other encoded time) *can* be used with the onboard GPS receiver. If no GPS satellites are seen then the IRIG-B will be used. I don't know what happens if both are coming in at the same time.

EPROMs

Our card came with an EPROM labelled:

                        7130A
                        OCD9
                        

We were sent a special EPROM that allows the 1 PPS to work (if the GPS clock is removed). It is labelled:

                        6812A
                        79B9
                        

We then ordered a special -DIVGATE modification (see Rejam oddities above) and were sent two more EPROMS:

GPS with -DIVGATE option:

                        7130A
                        E343
                        

No GPS (allows 1 PPS input) with -DIVGATE option:

                        6812A
                        8114
                        

EPROMs must be installed such that the text is "right side up" when the card has the connectors at the top:

                         BNC BNC  high-density D26
                         ------------------------
                        |                        |
                        |                        |
                        |                EPROM   |
                        |                        |
                        |                        |
                        |                        |
                        |                        |
                        |                        |
                        |                        |
                        |                        |
                        |                        |
                        |                        |
                        |                        |
                        |                        |
                        |                        |
                        |                        |
                        |                        |
                        |                        |
                         ------------------------
                        

BCD Vs. Binary

We bought a card that encodes time as binary-coded decimal (BCD). This turned out to be a bit of a problem because the registers only have room to store two digits for the year. (It is also annoying because it is more work to decode the time.)

Because the timer card cannot keep all 4 digits of the year, I do not even bother to set time on the the timer card at all. I rely on it only to get the correct fraction of a second (and to output a steady rate of pulses); I get the rest of the time information from the computer's own clock (which is synchronized to NTP).

If I was starting over I would buy the version that encodes time as binary instead of BCD. The binary version has room for all 4 digits of the year. One could then set the timer card and read time directly from it (if desired). Or better yet, synch it to IRIG-B and don't worry about setting it.