https://github.com/raibisch/dac80501
Library for the DAC80501 16 bit digital analog converter
https://github.com/raibisch/dac80501
dac dac80501 esp32 esp32-arduino spi
Last synced: 4 months ago
JSON representation
Library for the DAC80501 16 bit digital analog converter
- Host: GitHub
- URL: https://github.com/raibisch/dac80501
- Owner: raibisch
- License: other
- Created: 2022-11-23T18:57:13.000Z (about 3 years ago)
- Default Branch: master
- Last Pushed: 2023-02-01T17:39:08.000Z (almost 3 years ago)
- Last Synced: 2025-06-20T18:56:23.172Z (7 months ago)
- Topics: dac, dac80501, esp32, esp32-arduino, spi
- Language: C++
- Homepage:
- Size: 62.5 KB
- Stars: 0
- Watchers: 1
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: license/LICENSE.md
Awesome Lists containing this project
README
# DAC80501 Arduino Library
[](https://github.com/raibisch/Dac80501/archive/refs/heads/master.zip)
[](license/LICENSE.md)
[](https://www.paypal.com/paypalme/goldmannjuergen)
This is a library for the TI DAC80501 16bit digital analog converter
(until now only the SPI bus connection is supported by this lib)
## Helpful Infos
https://e2e.ti.com/support/data-converters-group/data-converters/f/data-converters-forum/968246/dac80501-spi
https://www.ti.com/product/DAC80501
## Author
Jürgen Goldmann
## Licence
[Licensed under the European Union Public License (EUPL)-1.2-or-later](https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12)
[Why licensed under EUPL-1.2: it is compatible to GPL and compatible to EU-rights and regulations](https://joinup.ec.europa.eu/collection/eupl/join-eupl-licensing-community)
[Compare different licences](https://joinup.ec.europa.eu/collection/eupl/solution/joinup-licensing-assistant/jla-find-and-compare-software-licenses)
## Download and Installation
To download click the DOWNLOAD ZIP button, rename the uncompressed folder Dac80501. Check that the Dac80501 folder contains DAC80501.cpp and DAC80501.h
### Arduino IDE
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.
### Platform IO
Add in 'platform.ini' (no need to download before)
```
lib_deps =
https://github.com/raibisch/dac80501
```
# Remark for Software-Design
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
### Define
```
DAC80501 dac;
```
### Init
```
// 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);
```
### Write Value to DAC
```
dac.writeDAC(0xffff);
```
# Remark for Hardware-Design
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.