tartelette / documentation demossource ↗

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

KeyTypeDefault
sdiGPIOrequiredserial data in
csGPIOrequiredSYNC, active low
clkGPIOrequiredserial clock
rstGPIOreset, active low
vref_mv1..100002500reference voltage in mV: the full-scale output
cv_zero_uv±100000000output stage: the DAC output (µV) that gives 0 V at the jack
cv_uv_per_volt±100000001000000output 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_uv is the DAC output that gives 0 V at the jack;
  • cv_uv_per_volt is 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
00write the channel's input register
01write it and update that channel's output
10write it and update all outputs from their input registers
11write 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.