Pages: [1]   Go Down
Author Topic: DUE DAC output  (Read 4687 times)
0 Members and 1 Guest are viewing this topic.
Offline Offline
Newbie
*
Karma: 0
Posts: 4
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Hello Everyone,

I am new to Arduino and hence, new to everything.
So can anyone please tell How to use 2 of the DAC pins present in Arduino Due, can they provide constant voltage output, if yes, then How ????

Sorry if this Question is a silly one but please, do guide.

Thank you

Logged

Manchester (England England)
Offline Offline
Brattain Member
*****
Karma: 597
Posts: 33292
Solder is electric glue
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

Well using
Code:
analogWrite(DAC0, value );
will do it.
Guess how you access DAC1.

This will give you 8 bits resolution. To get the full 12 bits use:-
Code:
  analogWriteResolution(12);
in the setup.
Logged

Offline Offline
Newbie
*
Karma: 0
Posts: 4
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Thanks, It worked.

But can one tell me what is the min and max voltage output by these pins, because i tried this code:

Code:
int value=0;

void setup()
{
  analogWriteResolution(12);
}

void loop()
{
analogWrite(DAC1, value ); 
value++;
delay(10);
if(value>4094)
value=0;
}

And the output didn't exceed 2.8 V (Due's Pins Support I/O up to 3.3V).

Thank you
Logged

White River Junction, Vermont USA
Offline Offline
Full Member
***
Karma: 5
Posts: 106
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

But can one tell me what is the min and max voltage output by these pins, because i tried this code:
<snip>
And the output didn't exceed 2.8 V (Due's Pins Support I/O up to 3.3V).
This is expected.

See stimmer's response on February 26 here:
http://arduino.cc/forum/index.php/topic,139733.msg1134372.html#msg1134372
(Page 1033 of a similar datasheet)

-Chris
Logged

Manchester (England England)
Offline Offline
Brattain Member
*****
Karma: 597
Posts: 33292
Solder is electric glue
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

Quote
But can one tell me what is the min and max voltage output by these pins, because i tried this code:
yes that is the value I get from that code as well.
In fact you will see it does not go lower than 0.58V so the actual range is only 2.24V
Logged

Offline Offline
Newbie
*
Karma: 0
Posts: 4
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Got it.
Thanks for your Help  smiley-mr-green
Logged

Pages: [1]   Go Up
Jump to: