Open graeme-winter opened 1 year ago
OK, looks like this is misconfigured (i.e. there is a real bug fix needed here)
>>> from machine import DAC
>>> d0 = DAC(0)
>>> d0.write(0)
>>> d0.write(4095)
>>> d0.write(0)
>>> d1 = DAC(1)
>>> d1.write(0)
>>> d1.write(4095)
>>> d0.write(4095)
>>> d0.write(0)
>>> d0.write(0)
>>> d1.write(0)
before d1
is configured d0 works correctly, but after d1 is configured d0 is "unplugged"
Also
d2 = DAC(2)
should throw an error; it does not 🤔
OK, DAC creation writes to SWRST -> softwre reset which resets all registers.
That is probably not what we want... I don't know how to avoid that though, without some nasty global "DAC reset" flag
Would also explain the drift on the other DAC when you configure one
Fixed in 9ac42c7d28dd074fb1914f8d89723ba3610a602f
Verify that the µPython DAC control code works correctly with the assigned pins
Hint: it does not work correctly