Skip to content

Commit a91e014

Browse files
committed
DM: fix dac not holding value bug
1 parent e4a41f3 commit a91e014

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

cores/arduino/wiring.c

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -138,8 +138,12 @@ void init( void )
138138
DAC->CTRLA.bit.SWRST = 1;
139139
while ( DAC->SYNCBUSY.bit.SWRST == 1 ); // Wait for synchronization of registers between the clock domains
140140

141-
DAC->CTRLB.reg = DAC_CTRLB_REFSEL_VREFPU; // TODO: make this work with VDDANA
141+
DAC->CTRLB.reg = DAC_CTRLB_REFSEL_VREFPU; // TODO: fix this once silicon bug is fixed
142142

143+
//set refresh rates
144+
DAC->DACCTRL[0].bit.REFRESH = 2;
145+
DAC->DACCTRL[1].bit.REFRESH = 2;
146+
143147
#else
144148
while(GCLK->STATUS.reg & GCLK_STATUS_SYNCBUSY);
145149

0 commit comments

Comments
 (0)