@@ -32,16 +32,26 @@ Feedback, issues, improvements are welcome.
3232Please file an issue on GitHub.
3333
3434
35+ ### Differences
36+
37+ The parts incorporate a power-on reset circuit to ensure that the DAC output
38+ powers up to 0 V (AD5620/AD5640/AD5660-1-2) or midscale (AD5620-3 and AD5660-3)
39+ and remains there until a valid write takes place.
40+
41+
3542### Compatibles
3643
37- Overview devices, nr of bits, setValue range and indicative LSB
44+ Overview of related devices, nr of bits, setValue range and indicative LSB
3845
39- | device | bits | range | LSB @ 5V | notes |
40- | :--------:| :------:| :-----------:| :-----------:| :-------:|
41- | AD5620 | 12 | 0..4095 | 1.221 mV | see AD5620 library
42- | AD5640 | 14 | 0..16383 | 0.3053 mV | see AD5620 library
43- | AD5660 | 16 | 0..65535 | 0.0763 mV |
44- | AD5680 | 18 | 0..262143 | 19.07 uV | see AD5680 library
46+ | device | bits | range | % stepsize | LSB @ 5V | notes |
47+ | :--------:| :------:| :-----------:| :------------:| :-----------:| :-------:|
48+ | AD5620 | 12 | 0..4095 | 0.025 | 1.221 mV | see AD5620 library
49+ | AD5640 | 14 | 0..16383 | 0.0065 | 0.3053 mV | see AD5620 library
50+ | AD5660 | 16 | 0..65535 | 0.0017 | 0.0763 mV |
51+ | AD5680 | 18 | 0..262143 | 0.0005 | 19.07 uV | see AD5680 library
52+
53+
54+ The AD5662 is compatible, however it does not support the Vref functions.
4555
4656
4757### Related
@@ -62,8 +72,6 @@ Overview devices, nr of bits, setValue range and indicative LSB
6272
6373### Base class
6474
65- The AD5640 has identical constructors.
66-
6775- ** AD5660(uint8_t slaveSelect, SPIClassRP2040 \* mySPI = &SPI)** constructor hardware SPI (RP2040 specific).
6876Sets internal value to zero.
6977- ** AD5660(uint8_t slaveSelect, SPIClass \* mySPI = &SPI)** constructor hardware SPI.
@@ -72,7 +80,7 @@ Sets internal value to zero.
7280Sets the software SPI pins.
7381Sets internal value to zero.
7482- ** void begin()** initializes the SPI and sets internal state.
75- - ** uint8_t getType()** returns nr of bits, 12 for AD5660, 14 for AD5640 .
83+ - ** uint8_t getType()** returns nr of bits, 16 for AD5660.
7684
7785
7886### Set DAC
@@ -81,10 +89,11 @@ Sets internal value to zero.
8189effectively a prepare + update in one call.
8290Returns false if value out of range.
8391- ** uint16_t getValue()** returns the set value from cache.
84- At power up the device will be reset to 0 (== 0 volt).
92+ At power up the device will be reset to 0 (== 0 volt). (not always).
8593- ** uint16_t getMaxValue()** returns 65535 for AD5660.
8694- ** bool setPercentage(float percentage)** sets the output as a percentage 0..100%.
8795If percentage is out of range, it is ** not** set and the function returns false.
96+ The stepsize is about 0.002% for the AD5660.
8897- ** float getPercentage()** returns percentage, wrapper around ** getValue()** .
8998Might return a slightly different value than ** setPercentage()** due to
9099rounding math.
@@ -104,7 +113,7 @@ See datasheet P19 for details.
104113| 0 | normal mode (default) |
105114| 1 | 1 KOhm to GND |
106115| 2 | 100 KOhm to GND |
107- | 3 | Threestate |
116+ | 3 | ThreeState |
108117
109118
110119### SPI
@@ -116,7 +125,7 @@ please read datasheet of the ADC first to get optimal speed.
116125- ** uint32_t getSPIspeed()** gets current speed in ** Hz** .
117126- ** bool usesHWSPI()** returns true if HW SPI is used.
118127
119- Datasheet maximum frequency. Overclocking is not tested.
128+ Datasheet P7 maximum frequency. Overclocking is not tested.
120129
121130| Voltage | Max Speed |
122131| :---------:| :-----------:|
@@ -135,17 +144,17 @@ produce different numbers.
135144
136145| version | board | clock | SPI | calls / sec | Notes |
137146| :---------:| :-------:| :---------:| :-----:| :-------------:| :--------|
138- | 0.1.0 | UNO | 16 MHz | HW | | max SPI speed
139- | 0.1.0 | UNO | 16 MHz | SW | |
147+ | 0.1.0 | UNO | 16 MHz | HW | 58800 | max SPI speed
148+ | 0.1.0 | UNO | 16 MHz | SW | 3300 |
140149| 0.1.0 | ESP32 | 240 MHz | HW | | 1
141150| 0.1.0 | ESP32 | 240 MHz | SW | |
142151
143152
1441531 . ESP32 HW is equal performant for HSPI and VSPI.
145154 Unknown why HW SPI is 20% slower than SW SPI (transaction overhead?)
146155
147- xxxxxx calls per second means that a 1 KHz wave can be
148- constructed with xxxx values per period (max).
156+ 58800 calls per second means that a 1 KHz wave can be
157+ constructed with 58 values per period (max).
149158
150159Please share your performance data, open an issue to report.
151160
@@ -159,8 +168,8 @@ Please share your performance data, open an issue to report.
159168
160169#### Should
161170
162- - add examples
163- - create a similar library for AD5660
171+ - sync with AD5620.
172+ - power on reset level 0 or midscale.
164173
165174#### Could
166175
0 commit comments