Skip to content

Bit Communication (TTL Pulses)

Digital Signals are Yes or No

All TDT digital I/O communications use 'TTL signals'. TTL stands for 'transistor-transistor logic,' but you don't need to understand transistors or have an electrical engineering degree to use these signals. A TTL signal is very simple: it's a voltage signal that is set at either a fixed high value or zero to indicate whether something is on or off, kind of like a light switch. We call this high or low state a 'bit'. Unlike analog signals which can be any value within a specified range, a digital bit is binary - the signal is either true or it is not true.

TTL signals have two voltage states - high or low. The high voltage is either 3.3 V or 5.0 V and the low voltage is always 0 V.

Voltages

Important

TDT digital I/O can tolerate up to 5.0 V, but bit (Port C) should only go up to 3.3 V. Our official recommendation is that if you have a consistent 5.0 V signals, then you need to use Ports A or B, which use bytes for communication. Your third-party device will indicate the TTL voltage.

We often refer to TTL signals as 'TTL pulses' because they are square. TTL pulses can become high or low as long as needed to indicate a state behavior, or they can be programmed for a set period of time to indicate an event. The latter is commonly used for synchronizing or triggering third-party equipment like external cameras, lasers, Arduinos, other recording systems, FED3 and peripheral behavioral devices. Some of these send out TTL pulses to mark short events into TDT that we capture and record. Others require TDT to send TTL pulses to them to trigger events or synchronize recording clocks.

Note

The 'on' and 'off' state for a device does not need to be a high voltage for 'on' and zero for 'off.' These can actually be flipped. The external device's state behavior can be easily deduced in synapse by recording a few test TTL pulse inputs. This information should also be in the device manuals.

BNC Connections

The easiest and most common way to connect devices for individual TTL communication (0 - 3.3 V signals) is with a BNC cable.

You've likely seen these around any neuroscience lab. They are single-channel coaxial cables that you twist onto to secure into place.

BNC cable with male connector on both ends

Note

The term BNC is short for "Bayonet Neill–Concelman" named for being a bayonet connector and the two co-inventors Wiki Reference

Because of their commonality, TDT is well-suited for making connections to BNC cables. The RZ2, RZ5, RZ10x, and some iCon modules all have built-in BNC connections for digital I/O that map to bit-addressable memory. The RZ6 does not, but you can use our PP24 breakout connection board to easily provide BNC access to the RZ6 or any RZ device. This is convenient if you have more TTL signals than available BNC ports and want to use BNC cables for your digital connections.

Note

The bit I/O channels on the PP24 are labeled under 'Port C,' which happen to be connectors A1 - A8 on the PP24

Another option is to use a BNC to flying leads cable if you have a third-party device with screw terminals and want to connect to a TDT BNC, or you are using a device with a BNC and want to connect directly to the TDT DB25 connector.

Setup Bit Inputs in Synapse

Setting up a TTL inputs for bit communication (a single channel/ signal) in Synapse is very easy. If you have the physical connections to your other equipment ready and that equipment can send out test pulses, then all you have to do is activate the correct bit channel (normally one of the C0 - C3 bits) in Synapse.

Digital I/O - Bit Input

Digital I/O - Bit Input

Read a TTL bit input from the RZ into Synapse.

From a TDT-perspective, receiving TTL pulses is passive. If you are not seeing signals appear in Synapse and you think you should, please do the following troubleshooting steps:

  1. Verify that your BNC connection is correct and that you are connected to the correct port on your TDT device.

  2. Verify that you have the digital input setup correctly in Synapse.

  3. Autoscale your TTL trace in the Synapse RunTime plot if you see a flat green line.

  4. If you don't see anything, verify that your third-party device is actually sending out a TTL pulse. This is usually done with an oscilloscope. Most of the time, this is the problem.

  5. Sometimes BNC cables break. Try replacing it.

  6. If you see TTL pulses in an oscilloscope but still do not see it in TDT, contact support@tdt.com for next steps. Please make notes or take pictures of steps up to this point for proof of troubleshooting.

Setup Bit Outputs in Synapse

TDT TTL ports can be setup for outputs as well. This will be accompanied by a signal in Synapse that you want to use to send to another device. TDT has a number of gizmos that can be used to send logic signals to a specified digital IO port to generate a 0 - 3.3 V TTL pulse.

The simplest example is using the Pulse Generator. In the below example, the gizmo generates a logic pulse that we then select in Port C0 in the RZ digital IO tab as an output signal. The bit-addressable ports in Synapse only accept logic signals (these are marked green on gizmo connection diagrams) for specified output signal IDs.

Pulse Gen with TTL Output

Pulse Gen with TTL Output

Use the Pulse Generator Gizmo to make dynamically-controlled pulse trains that can be output at TTL signals to control external devices like lasers.

Similarly, you can generate user-defined single pulses with the User Input gizmo.

User Input

User Input

Use the User Input Gizmo to make user-defined triggers via software buttons, or to receive TTL bit inputs from the Digital I/O.

If you want to make more complicated pulse trains, such as bursting patterns with higher frequency pulse trains that occur at a specified interval, then check out the Pulse Train Generator. This gizmo uses a Parent-Child setup where a child train can only be true if the parent train is also true. You can change the train stack in the General > Configuration tab in the gizmo. The pTrain can also send out simple regular pulses like the Pulse Generator.

Below is an example output of two pTrain configurations. pTrainA (WiA/, colored green) is a simple 5 Hz pulsing pattern (pulse width = 5 ms). The other pTrainB (PeB/ and WiB/, colored cyan) shows a stacked logic pattern for bursts of pulses. The parent train has a Period of 5000 ms and a Width of 1000 ms - this means that every 5 seconds it will be ON for 1 second. The child train has a Period = 40 ms and a Width = 5 ms. The child train can only be active when the parent train is active, so the result is that every 5 seconds there is a burst of 25 Hz, 5 ms pulses that last for 1 second in total duration.

You can download the example experiment here: Download Experiment File

There are other gizmos in synapse that can generate logic pulses to be used for outputs. The stimulation gizmos can output a 'StimSync' pulse when they are active (example using the Auditory Stimulation gizmo). This pulse can be routed to a digital output.

Bit Epocs in the Data

TTL data gets saved as an 'epoc' in Synapse. An Epoc is a timestamp event with distinct name, an onset time, offset time, and a data value. Epoc events are important for marking events in your data for time reference comparisons. Here is everything you need to know about importing data into Matlab or Python.

The below image shows the data structure that was saved from the example experiment TwoPTrains in the above Setup Bit Outputs in Synapse. In the image, we see one of the epocs, WiA from pTrainA, and look into the onset timestamps for every triggered event.

Epocs are commonly used for peri-event filtering to make raster plots, histograms, peri-event response plots, and much more. Below are three posted examples that use epocs for data-related analysis:

Averaging around an epoc event

PSTH using epocs and spike snippet data

Peri-event plot using detected behavioral input events and fiber photometry data