[riot-notifications] [RIOT-OS/RIOT] cpu/sam0_common: implement periph/dac (#13965)
notifications at github.com
Fri May 1 16:49:38 CEST 2020
@benpicco commented on this pull request.
> + * @author Benjamin Valentin <benpicco at beuth-hochschule.de>
+ * @}
+#define DAC_CLOCK DAC_CLOCK_DEFAULT
+#define DAC_VAL(in) (in >> (16 - DAC_RES_BITS))
The problem is that the DAC API assumes a full 16-bit input value.
So setting a value > 1023 will make the DAC overflow back to zero - you can observe this with `tests/periph_dac`.
On other DACs (e.g. lpc2387) you write the full 16-bit value but this being a 10 bit DAC, the lower (least significant) 6 bytes are ignored.
Here the most significant bytes would be ignored, which leads to wrong output values.
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the notifications