Go Down

Topic: Arduino Due DAC0 problem (not working) (Read 8459 times) previous topic - next topic

Magician

Quote
Arduino, which uses the software reset command of the control register (SWRST) never resets the ACR as per Table 45-3.
I agree on this, table clearly says reset status 0x0 , and obviously it's not.
My understanding, based on table 46-38,
Quote
Sleep Mode
Fast Wake Up
Normal Mode with 1 Output On (IBCTLDACCORE = 01,
IBCTLCHx =10)
Normal Mode with 2 Outputs On (IBCTLDACCORE =01,
IBCTLCHx =10)
that setting ACR to 0x0 you send all unit down to sleep mode. IBCTLHx most likely control reference current level for S/H circuitry, and daccore explains itself. I can't resist  to drive all unit up, to 30F, setting max bias current for core and two S/H. My mini DSO shows no noticeable difference -).
Code: [Select]
//  dacc_set_analog_control(DACC, DACC_ACR_IBCTLCH0(0x02) | DACC_ACR_IBCTLCH1(0x02) | DACC_ACR_IBCTLDACCORE(0x01));
  dacc_set_analog_control(DACC, DACC_ACR_IBCTLCH0(0x03) | DACC_ACR_IBCTLCH1(0x03) | DACC_ACR_IBCTLDACCORE(0x03));
Will keep it working all night, mini-stress testing

dlloyd

#16
Mar 27, 2014, 03:22 pm Last Edit: Mar 27, 2014, 05:27 pm by dlloyd Reason: 1
Some differences regarding DAC0 ...
  • After SWRST, Channel 0 is selected in the MR for data requests (USER_SEL).

  • After SWRST, DAC0 is selected while ACR status is 0x1AA (bits 5 and 7 on with unknown purpose).
    By the time DAC1 is selected, ACR status would be 0x10A as per datasheet.

  • The DAC0 pin serves as a wake-up source for the supply controller (DAC0/WKUP12). By default, DAC1 would not be selected during any wake-up event.

Note from datasheet (29.2.10 Fast Startup):
Important: Prior to asserting any WFE instruction to the processor, the internal sources of
wakeup provided by RTT, RTC and USB must be cleared and verified too, that none of the
enabled external wakeup inputs (WKUP) hold an active polarity.

dlloyd

Quote
Will keep it working all night, mini-stress testing

With ACR at 30F ... could be unchartered slew rate. If it passes, I think it deserves getting some sleep  ;)

Magician

#18
Mar 27, 2014, 10:30 pm Last Edit: Mar 27, 2014, 10:34 pm by Magician Reason: 1
10 hours test pass. Probably,  writing 0x3 (DACC_ACR_IBCTLCH0(0x03)) instead of 0x2  has no difference.  
I checked what is arduino IDE using inside analogWrite - it's 0x2.

Go Up