External TTL trigger

To automatically start /stop acquisition by means of an external TTL signal follow the following instructions.

First, connect an appropriate TTL control signal to the P1.6 (pin #21) of the extension header of the Scanbox board.  The view below shows a top view of the Scanbox control board.  The pin in question is located on the back row of connectors when viewing the board from the front.  As a ground pin, you can use pin #3.  To make it easier to make the appropriate connections it helps to get the this cable and route it outside the box.


StartCapture the Scanbox software and operate as usual by focusing and selecting the area you want to record.  When ready to switch to external trigger control, simply click the “External TTL Trigger” checkbox, which is located in the middle of the Scanner control panel.

After enabling the TTL trigger, the manual Focus/Grab buttons will be grayed out and blocked from usage.  If you want to go back to manual control simply deselect the TTL Trigger checkbox.

The rising edge of the TTL control signal is used to start/stop the microscope.  Minimum pulse width is 1 ms.

While controlling the microscope using an external TTL signal it is useful to run it in continuous resonant mode (so you avoid waiting for the resonant mirror to warm up) , and set the “autoinc” configuration variable to “true”, so file numbers increment automatically after the completion of each session.

To use this feature you have to update to the latest version of the firmware/software.

Update [6/23/17]:

If you are willing to give use of TTL1 as an event line, a new trig_sel configuration variable allows you to use it instead of the signal from the header to start and stop the acquisition.  You will have to upgrade to the latest version of the software.  Follow the instructions here.  You can skip the steps asking you to update knobby, the motor box, and run vc_redist.x64.exe.  After the update, simple set the trig_sel configuration variable to true if you want to trigger with TTL1 (or false if you want to trigger using the header signal).

TTL synchronization

The simplest way to synchronize external stimulation with the microscope data collection is for the user to generate a TTL signal that is HIGH when the stimulus is on and LOW when it is off.

This signal should be split and connected to the TTL1 input of Scanbox and the AUX1 input of the Alazartech card (see diagram below).  This has TTL-compliant signal (do not use 3.3V boards).


The TTL1 input in the Scanbox allows the system to time-stamp the rising and falling edges of the stimulus TTL signal with the frame and time on which it occurred.  The input to AUX1 allows the system to display stimulus markers in real time on top of the traces and save a log of the TTL data along with the real time traces.

If you are using only TTL1, please use imask=2 in your configuration file.  If you are using both TTL1 and TTL0 use imask=3 in the configuration file.  Never enable a TTL event input without having something connected there.

More information here.


The Heart of Scanbox

The heart of Scanbox is the custom designed card shown below, now in its third revision:


Here is a brief summary of the architecture.

The card communicates with the host PC through a USB line.  A number of Matlab functions allows one to easily communicate with the card, sending scanning parameters, starting and stopping scanning, receiving TTL events, etc.

TTL events are time-stamped by the card by assigning them the (frame,line) pair at which they occurred.  TTL lines can be programmed to detect rising/falling edges or both. These data are saved along with the entire state of the microscope (including position, gains of PMTs, laser wavelength, etc) in a Matlab file.

The fast shutter line is used to control a Uniblitz shutter that it is only open while scanning.  This line can also be used as a TTL signal that signals when the microscope is in the middle of a scan.

The Pockels cell signal modulates the power of the laser during the line.  This is generated by a look-up table in the hardware so it can be programed to any arbitrary shape.  By default, the shape is such that keeps the mean image brightness uniform except at the very edges where the laser is completely blanked.

The trigger line acquisition line is sent to the AlazarTech 9440 to trigger the acquisition of one line.  The PMTs power are gain signals are provided directly from the card.  The same applies to the CRS resonant mirror controller and the slow galvanometer controller.

A mirror moved by a Firgelli linear actuator is controlled via a PWM signal available form the card.  An I2C interface is provided to communicate with other sensors and an extension header provides 34 additional lines of digital or analog I/O that can be accessed by the PSoC chip.

Of course, the amazing PSoC 5 chip is in charge of everything.

To learn more about the microscope optics and its capabilities go to this page.