This is a library for the TI DAC80501 16bit digital analog converter (until now only the SPI bus connection is supported by this lib)
https://www.ti.com/product/DAC80501
Jürgen Goldmann
Licensed under the European Union Public License (EUPL)-1.2-or-later
Why licensed under EUPL-1.2: it is compatible to GPL and compatible to EU-rights and regulations
To download click the DOWNLOAD ZIP button, rename the uncompressed folder Dac80501. Check that the Dac80501 folder contains DAC80501.cpp and DAC80501.h
Place the Dac80501 library folder your arduinosketchfolder/libraries/ folder. You may need to create the libraries subfolder if its your first library. Restart the IDE.
Add in 'platform.ini' (no need to download before)
lib_deps =
https://github.com/raibisch/dac80501
MOSI signal was not used, because of one way data transfer from slave to master, but defined as 'dummy' pin in CPU. Tested with ESP32, ESP-S2 and ESP-S3 - may also (not tested) work with other arduino CPUs
DAC80501 dac;
// default clock=2MHz
dac.setClockSpeed(10000000); // 10MHz
dac.begin(&SPI,SPI1_SCK,SPI1_MISO,SPI1_MOSI,SPI1_CS);
// default div=2 gain=1
dac.setREG4_DivGain(SET4_DIV2,SET4_GAIN2);
dac.writeDAC(0xffff);
In some cases the spi data transfer does not work. I have good results with a 330 Ohm resistor in the 'SCLK' and 'MISO' (and CS) line to reduce signal reflections.