ARDUINO_DELAY

Section: User Commands (1)
Updated: July 2012
Index Return to Main Contents
 

NAME

arduino_delay - InfraRed Camera System Initialise  

SYNOPSIS


 Uses Arduino to configure a FIFO connected between PulseBlaster and NI 4462 trigger. This allows the delay-line time to be varied.
 It's useful to compensate for the (unwanted) 63-sample digital-filter group delay internal to the NI 4462.

 

DESCRIPTION

This program interfaces with the Arduino Nano to control an AL422 3 Mbit FIFO which acts as a clocked delay-line between the PulseBlaster and the NI4462 PFI0. The FIFO can be either inserted or bypassed, and the length of its delay is controlled by pre-filling it (via the Arduino). The delay length can be 0 (bypassed) or between [5120, 15728640] ns; it is clocked at a speed of 25 MHz, (so there is a jitter of 20.00 ns, and a maximum signal frequency of 12.5 MHz). The FIFO's clock is directly exported from the NI4462 (via LVDS and divider), for perfect sync. The Arduino is connected to serial port /dev/arduino_nano_A700fmiq (specified by a udev rule), which runs at 115200 Baud, with HUPCL off to prevent accidental DTR-reset on exit.

USAGE: arduino_delay OPTIONS (all permutations permitted; not all are sensible.)

OPTIONS: -h show this help.


          -d           print debugging messages to stderr (uses timeouts, so slower).


          -a           check communication (and protocol) with Arduino and exit .


          -g           get the current delay value in ns. 0 means bypassed; -1 uninitialised.


          -s  LEN_NS   set the delay in ns. LEN_NS = { 0, [5120, 15728640] }. 0 means Bypass.
                       LEN may have suffixes s,ms,us,ns. Truncation/quantisation: 40 ns.
                       Setting the delay prefills the FIFO and inserts it into the path.


          -v           get verbose status information from the Arduino.


          -b           bypass the FIFO (the delay on subsequent re-insertion is unchanged).


          -i           inserts the FIFO into the path.


          -m           measure the actual FIFO delay (in ns) vs. the Arduino's clock. Returns
                       0 when bypassed. Accuracy: 8 us quantisation.
                       [This uses a spare FIFO bit, so is non-destructive of fill-level.]


          -c  LEN_MS   count falling-edges for (integer) ms. Max freq ~2.5 MHz; accuracy ~0.2%.
                       LEN may also have suffixes of s,ms. Max LEN: 1000000 ms.
                       [FIFO is altered during this measurement; state is then restored.]


          -u           gets the Arduino uptime in seconds (wraps at 2^32, i.e. 71 days).


          -l           blink the diagnostic LED on the Arduino.


          -w           60 second test: 25 kHz clock, with switch/led to generate/view pulses.
                       [FIFO is bypassed during this test; state is then restored.]


          -r           soft reset the Arduino (also clears the FIFO).


          -R           hard reset the Arduino (hangup DTR; also clears the FIFO).

RETURNS:
          0            on success.
          1            on error.

NOTE: * The NI4462 has a digital group delay of 63 samples. If pre-trigger samples is 2,
        and it is clocked at 204.8 kHz, the trigger-delay should ideally be 317382.8 ns.
      * Serial protocol is: send 1-line command; wait up to 100 ms, read 1-line reply. -d drains the
        queue every time, reading n-lines till EOF: necessary if Arduino has '#define DEBUG 1'.
      * The Arduino's own oscillator is not used for any timing functions (except -m, -c).
      * The circuit doesn't use the Arduino's 8 Analog pins; these are available for future expansion.

 

AUTHOR

The author of arduino_delay and this manual page is Richard Neill, <arduino#AT(spamblock)#richardneill.org>
Copyright July 2012; this is Free Software (GPL v3+), see the source for copying conditions.

 

SEE ALSO

arduino_check(1), ni4462_system_clock_calibrate(1), pb_ni4462_pulse(1), ni4462_characterise(1)


 

Index

NAME
SYNOPSIS
DESCRIPTION
AUTHOR
SEE ALSO

This document was created by man2html, using the manual pages.
Time: 15:38:10 GMT, November 11, 2013