This example Arduino sketch is meant to work with Anabit's Reflex DAC 14 Bit 10V 2MSPS bipolar output
Product link: https://anabit.co/products/reflex-dac-14-bit-2msps-10v-range
This example sketch demonstrates how to output 4 different voltage patterns from the 14 bit DAC. The sketch is specically designed for ESP32 based arduino profiles and utilizes fast pin changes specific to the ESP32. It makes quick changes on the chip select pin used for SPI communication to make the DAC output run fast. The sketch can be used to create the following 4 outputs: --> single voltage value (between -10V and +10V) --> Ramp waveform that cycles through all of the DAC points 2^14 --> Sinewave waveform, the number of points defined per cylce and SPI clock speed determine output frequency of the sinewave. Note when you view the sinewave on an oscillscope, please note you will see artifacts from the DAC's sample rate frequency (look like steps) --> Quick change waveform (will look like saw tooth waveform) toggles points from +4.096V to -4.096V as fast as possible. If you remove filter caps C24 and C25 this will appear more as a squarewave Note that because the ESP32 uses an RTOS under the hood, the arduino loop timing is not consistent so this will cause random glitches in the sinewave and quick change waveform outputs
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.