# Sinara 5432 DAC Zotino / Sinara 5632 DAC Fastino

* [Datasheet Zotino](https://m-labs.hk/docs/sinara-datasheets/5432.pdf)
* [Wiki Zotino](https://github.com/sinara-hw/Zotino/wiki)
* [Wiki Fastino](https://github.com/sinara-hw/Fastino/wiki)

## JSON

```json
{
  "type": "zotino",
  "ports": [<port num>]
}
```
```json
{
  "type": "fastino",
  "hw_rev": "v1.2", // optional
  "ports": [<port num>]
}
```

Fastino uses two physical EEM channels, but in the JSON file there should be only one channel specified, 
and it should be the one connected to Fastino's EEM0.

## Setup

Connect the BNC/SMA-IDC adapters to the Zotino/Fastino with 26-pin cable if needed by customer. Be aware of the ports order - 
see reference numbers on the board.

## Testing

After running `artiq_sinara_test`:

```text
*** Testing Zotino DACs and USER LEDs.
Voltages:
zotino0 0.1 -0.1 0.2 -0.2 0.3 -0.3 0.4 -0.4 0.5 -0.5 0.6 -0.6 0.7 -0.7 0.8 -0.8 0.9 -0.9 1.0 -1.0 1.1 -1.1 1.2 -1.2 1.3 -1.3 1.4 -1.4 1.5 -1.5 1.6 -1.6
Press ENTER when done.

*** Testing Fastino DACs and USER LEDs.
Voltages:
fastino0 0.1 -0.1 0.2 -0.2 0.3 -0.3 0.4 -0.4 0.5 -0.5 0.6 -0.6 0.7 -0.7 0.8 -0.8 0.9 -0.9 1.0 -1.0 1.1 -1.1 1.2 -1.2 1.3 -1.3 1.4 -1.4 1.5 -1.5 1.6 -1.6
Press ENTER when done.
```

1. Touch with multimeter/DC voltmeter each pair of pins from bottom to top (left pins are ground)
2. Check that respective pins have voltages as described by `artiq_sinara_test`
3. If there are [BNC/SMA-IDC adapters](./bnc_sma_idc_adapter.md), also check their voltages - they should be the same
4. Check LEDs are on


## Common problems

### High-freq audible noise and output values all near -0.1 on Zotino v1.4.2

This may happen when power-cycle is too short. Power down the crate, wait at least 30 seconds, and power up again.
[Issue](https://github.com/sinara-hw/Zotino/issues/37).

### Zero voltage output on Fastino

Some Fastino may not output any voltage during testing, usually that means it has no gateware.

Another common symptom of no gateware is that no LEDs are lit up. Whereas if the gateware has been flashed, the PG and FD LEDs will be lit green.

You can flash the gateware with a standalone Kasli/Kasli-SoC:

1. Download the latest `fastino.bin` release from [quartiq/fastino](https://github.com/quartiq/fastino/releases)
2. Run `git clone https://github.com/quartiq/kasli-i2c.git` and place `fastino.bin` in the kasli-i2c directory
2. Connect the Fastino's EEM0 to any available Kasli/Kasli-SoC EEM port (**do not hot-plug**)
3. Power on the standalone Kasli/Kasli-SoC
4. Run `nix-shell -p python311Packages.pyftdi`
5. Run `cd kasli-i2c; python flash_fastino.py 0 EEM<number> write fastino.bin` where `<number>` is the EEM port number on the Kasli/Kasli-SoC side
6. If PG and FD LEDs are lit green, the Fastino is ready.
