dac8165: quad DAC
The Texas Instruments DAC8165, a four-channel 14-bit voltage DAC, handy for CV outputs. Firmware may drive it from a PIO state machine that bit-bangs its serial interface, so the model watches the pins directly instead of sitting on an SPI controller.
Keys
| Key | Type | Default | |
|---|---|---|---|
sdi | GPIO | required | serial data in |
cs | GPIO | required | SYNC, active low |
clk | GPIO | required | serial clock |
rst | GPIO | reset, active low | |
vref_mv | 1..10000 | 2500 | reference voltage in mV: the full-scale output |
cv_zero_uv | ±10000000 | 0 | output stage: the DAC output (µV) that gives 0 V at the jack |
cv_uv_per_volt | ±10000000 | 1000000 | output stage: DAC µV per volt at the jack; negative if it inverts |
[parts.dac]
kind = "dac8165"
sdi = 4
cs = 5
clk = 6
rst = 7
vref_mv = 2500
cv_zero_uv = 1239240
cv_uv_per_volt = -240310
The output stage
A DAC's output rarely goes straight to a jack. In the example above, an
inverting op-amp stage turns the DAC's 0..2.5 V into roughly +5.2..-5.3 V. The two
cv_* keys describe that stage so the panel, and the test synth, can show
and use the voltage at the jack:
cv_zero_uvis the DAC output that gives 0 V at the jack;cv_uv_per_voltis how much the DAC output changes for each volt at the jack, negative for an inverting stage.
So the jack voltage is (dac_uv - cv_zero_uv) / cv_uv_per_volt. The defaults
(0 and 1000000) mean no stage at all.
What's modelled
24-bit frames, MSB first, shifted in on each falling clock edge while SYNC is low and acted on when SYNC rises. Bits 21:20 pick the load mode, 18:17 the channel and 15:2 the 14-bit code:
| Mode | |
|---|---|
00 | write the channel's input register |
01 | write it and update that channel's output |
10 | write it and update all outputs from their input registers |
11 | write the code to every channel and update all |
A SYNC rising on the same cycle as the last clock edge still counts that
edge, as a PIO program driving both with side-set does. The output voltage is
vref * code / 16384.
Panel
Four voltmeters showing the voltage at each jack, with a bar.
Events
dac, with channel << 16 | code, whenever an output changes.
Not modelled
Power-down, broadcast commands, the reference control register, LDAC and the output settling time. Frames using them are counted and ignored.