deusletum / Winterbloom_AD5689

CircuitPython driver for the Analog Devices AD5689 16-bit DAC

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Winterbloom AD5689

This is a CircuitPython driver for the Analog Devices AD5689(R) 16-bit DAC

Installation

Install this library by copying winterbloom_ad5689.py to your device's lib folder.

Connecting your device to the AD5689

The AD5689 is connected over SPI. You should wire up the devices as follows (TSSOP-16 package):

  • 1: AD5689 = Vref, AD5689R = NC (uses internal reference)
  • 2: NC
  • 3: Analog output A
  • 4: GND
  • 5: VDD
  • 6: NC
  • 7: Analog output B
  • 8: NC (optionally can use as serial out for daisy chaining)
  • 9: GND (optionally can use as LDAC switch, but the driver doesn't use it)
  • 10: GND (optionally can use as GAIN)
  • 11: VDD (logic voltage)
  • 12: SCLK - connect to board.SCK for hardware SPI or any digital pin for bitbang IO.
  • 13: CS - connect to any digital pin.
  • 14: MOSI - connect to board.MOSI for hardware SPI or any digital pin for bitbang IO.
  • 15: VDD (optionally can use as hardware reset pin, but the driver doesn't use it)
  • 16: GND (optionally can use as reset selection)

Example usage

import board
import winterbloom_ad5689

# Using hardware SPI with D3 wired to CS.
dac = winterbloom_ad5689.create_from_pins(
    cs=board.D3)
dac.reset()

# 16-bit values, so 0-65535
dac.a.value = 15000
dac.b.value = 0

License and contributing

This is available under the MIT License. I welcome contributors, please read the Code of Conduct first. :)

About

CircuitPython driver for the Analog Devices AD5689 16-bit DAC

License:MIT License


Languages

Language:Python 100.0%