This example Arduino sketch is meant to work with Anabit's QuadraDAC 12/14/16 Bit 4 channel DAC open source reference design
Product link: https://anabit.co/products/quadra-dac
This example sketch demonstrates how to output 4 different voltage patterns from the 14 bit DAC. This portable version targets ANY Arduino board with hardware SPI and uses standard digitalWrite() for the chip select (CS) pin. The DAC is driven over SPI using the Arduino board's default SPI pins.
The sketch does the following: --> in the setup fucntion all 4 outputs are set to a voltage level defined by constants "VOUT_X" --> In the main loop a dynamic signal is demonstrated, from channel 4 or D a sinewave is output --> By default the sketch uses the max voltage set by verf gain of 1 (2.5V), you can change the gain to 2 to get a max of ~5V.
Note that this DAC with gain of 2 can do max 5V. This is done by the vref getting multipled by 2 but keep in mind this is done with internal op amps and no op amp is true rail to rail so when the gain is set to 2 you can get close to 5V out but it will by more like 4.9V depending on load conditions. To get more of a true 5V out set the input power to just above 5V like 5.2 or 5.3V
Please report any issue with the sketch to the Anagit forum: https://anabit.co/community/forum/digital-to-analog-converters-dacs
Example code developed by Your Anabit LLC © 2025 Licensed under the Apache License, Version 2.0.