# Sinara 2118 BNC-TTL / 2128 SMA-TTL

* [Datasheet](https://m-labs.hk/docs/sinara-datasheets/2118-2128.pdf)
* [Wiki DIO BNC](https://github.com/sinara-hw/DIO_BNC/wiki)
* [Wiki DIO SMA](https://github.com/sinara-hw/DIO_SMA/wiki)

## JSON

```json
{
  "type": "dio",
  "board": "DIO_BNC", // or "DIO_SMA"
  "hw_rev": "vX.Y", // optional
  "ports": [<port num>],
  "edge_counter": <bool>,
  "bank_direction_low": "input",
  "bank_direction_high": "output"
}
```

## Setup

Switch the direction switches (shown on the picture below) according to customer requests.
Remember, that you can only switch directions in groups of four.

![](../img/dio_ttl_switches.jpg)

## Test

### Output

```text
*** Testing TTL outputs.
Outputs are tested in groups of 4. Touch each TTL connector
with the oscilloscope probe tip, and check that the number of
pulses corresponds to its number in the group.
Press ENTER when done.
Testing TTL outputs: ttl0, ttl1, ttl2, ttl3.
```

1. Touch each TTL connector with the oscilloscope probe tip
2. Adjust time- and voltage- scale and trigger threshold so that you clearly see square pulse
3. Check that first TTL connector outputs 1 pulse, second - 2... fourth - 4 pulses
4. Repeat 1-3 for each group of TTL connectors

### Input

```text
*** Testing TTL inputs.
TTL device to use as stimulus (default: ttl4): ttl4
Connect ttl4 to ttl0. Press ENTER when done.
...
```

1. Mount a wire with respective connector to the chosen TTL output (any should work, choose most convenient one)
2. Connect the end of the wire to the TTL input requested by the `artiq_sinara_test` (you may use fast connector for SMA)
3. Press ENTER and check that `artiq_sinara_test` prints `PASSED`
4. Repeat 2-3 for every connector
