Closed dglaude closed 3 years ago
Reproduced on SAMD21, but SAMD51 is OK.
6.0.1 is OK on SAMD21.
@jepler I bisected this to https://github.com/adafruit/circuitpython/pull/3541/commits/fb768dfc14ab3b98905927f984a080e551513ea8
What I see when debugging is that the AnalogOut
object is getting smashed between the first and second call to common_hal_analogio_analogout_set_value()
. It seems to be OK immediately after the dac_sync_write()
.
OK:
$2 = {base = {type = 0x35cc0 <analogio_analogout_type>}, descriptor = {device = {hw = 0x42004800}, sel_ch = {{
buffer = 0x0, length = 0}}}, channel = 1 '\001', deinited = false}
later:
$4 = {base = {type = 0x35cc0 <analogio_analogout_type>}, descriptor = {device = {hw = 0x42004800}, sel_ch = {{
buffer = 0x0, length = 0}}}, channel = 224 '\340', deinited = 125}
Channel number is getting set wrong; will fix.
Testing on
analogio seems to fail when I try to change the value:
The result is and error on the line that set the value to 2000:
When trying the guide code from https://learn.adafruit.com/circuitpython-essentials/circuitpython-analog-out it fail on the line:
analog_out.value = i