Skip to content

Commit dcf8e3e

Browse files
pyhysjhedberg
authored andcommitted
boards: shields: Add Adafruit AD5693 DAC shield
The product photo is from https://learn.adafruit.com/assets/124731 and has the license CC BY-SA 3.0. Tested with the command in the index.rst file. Compile testing of the overlay file is done via the samples/drivers/dac sample. Signed-off-by: Jonas Berg <[email protected]>
1 parent 338a8b1 commit dcf8e3e

File tree

6 files changed

+124
-6
lines changed

6 files changed

+124
-6
lines changed
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
# Copyright (c) 2025 Jonas Berg
2+
# SPDX-License-Identifier: Apache-2.0
3+
4+
config SHIELD_ADAFRUIT_AD5693R
5+
def_bool $(shields_list_contains,adafruit_ad5693r)
Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
/*
2+
* Copyright (c) 2025 Jonas Berg
3+
*
4+
* SPDX-License-Identifier: Apache-2.0
5+
*/
6+
7+
/ {
8+
zephyr,user {
9+
dac = <&dac_adafruit_ad5693r>;
10+
dac-channel-id = <0>;
11+
dac-resolution = <16>;
12+
};
13+
};
14+
15+
&zephyr_i2c {
16+
status = "okay";
17+
18+
dac_adafruit_ad5693r: dac@4c {
19+
status = "okay";
20+
compatible = "adi,ad5693";
21+
reg = <0x4c>;
22+
#io-channel-cells = <1>;
23+
};
24+
};
39.4 KB
Loading
Lines changed: 73 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,73 @@
1+
.. _adafruit_ad5693r:
2+
3+
Adafruit AD5693R DAC Shield
4+
###########################
5+
6+
Overview
7+
********
8+
9+
The `Adafruit AD5693R DAC Shield`_ features an `Analog Devices AD5693R 16-bit DAC`_ and
10+
two STEMMA QT connectors. It has an output span of 2.5 Volt.
11+
12+
.. figure:: adafruit_ad5693r.webp
13+
:align: center
14+
:alt: Adafruit AD5693R DAC Shield
15+
16+
Adafruit AD5693R DAC Shield (Credit: Adafruit)
17+
18+
19+
Requirements
20+
************
21+
22+
This shield can be used with boards which provide an I2C connector, for
23+
example STEMMA QT or Qwiic connectors.
24+
The target board must define a ``zephyr_i2c`` node label.
25+
See :ref:`shields` for more details.
26+
27+
28+
Pin Assignments
29+
===============
30+
31+
+--------------+-------------------------------+
32+
| Shield Pin | Function |
33+
+==============+===============================+
34+
| SDA | AD5693R I2C SDA |
35+
+--------------+-------------------------------+
36+
| SCL | AD5693R I2C SCL |
37+
+--------------+-------------------------------+
38+
| A0 | AD5693R I2C address selection |
39+
+--------------+-------------------------------+
40+
| VREF | AD5693R reference voltage out |
41+
+--------------+-------------------------------+
42+
| LDAC | AD5693R Load DAC input |
43+
+--------------+-------------------------------+
44+
45+
When using this shield via the STEMMA QT connector, the supply voltage is 3.3 Volt, so the
46+
maximum output voltage is 2.5 Volt.
47+
48+
The LDAC pin is pulled down on the shield, forcing an updated output voltage as soon as
49+
the input register has been written.
50+
51+
See :dtcompatible:`adi,ad5693` for documentation on how to adjust the
52+
devicetree file, for example to adjust the power-down mode.
53+
54+
55+
Programming
56+
***********
57+
58+
Set ``--shield adafruit_ad5693r`` when you invoke ``west build``. For example
59+
when running the :zephyr:code-sample:`dac` sample:
60+
61+
.. zephyr-app-commands::
62+
:zephyr-app: samples/drivers/dac
63+
:board: adafruit_feather_rp2040
64+
:shield: adafruit_ad5693r
65+
:goals: build flash
66+
67+
Connect a voltmeter to the shield output and observe how the voltage changes.
68+
69+
.. _Adafruit AD5693R DAC Shield:
70+
https://learn.adafruit.com/adafruit-ad5693r-16-bit-dac-breakout-board
71+
72+
.. _Analog Devices AD5693R 16-bit DAC:
73+
https://www.analog.com/en/products/ad5693r.html
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
# SPDX-License-Identifier: Apache-2.0
2+
#
3+
# Copyright (c) 2025, Jonas Berg
4+
5+
shield:
6+
name: adafruit_ad5693r
7+
full_name: Adafruit AD5693R DAC Shield
8+
vendor: adafruit
9+
supported_features:
10+
- dac

samples/drivers/dac/sample.yaml

Lines changed: 12 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,20 @@
11
sample:
22
name: DAC driver sample
3+
common:
4+
tags: DAC
5+
harness: console
6+
harness_config:
7+
type: one_line
8+
regex:
9+
- Generating sawtooth signal at DAC channel ([0-9]*).
310
tests:
411
sample.drivers.dac:
5-
tags: DAC
612
depends_on: dac
713
filter: CONFIG_DAC_SAMPLE_RUN
814
integration_platforms:
915
- nucleo_l152re
10-
harness: console
11-
harness_config:
12-
type: one_line
13-
regex:
14-
- Generating sawtooth signal at DAC channel ([0-9]*).
16+
sample.drivers.dac.shields:
17+
platform_allow:
18+
- adafruit_feather_rp2040/rp2040
19+
extra_args:
20+
- platform:adafruit_feather_rp2040/rp2040:SHIELD="adafruit_ad5693r"

0 commit comments

Comments
 (0)