Documenti di Didattica
Documenti di Professioni
Documenti di Cultura
http://forum.arduino.cc/index.php?PHPSESSID=7hohsf0som9rvh9815ha6...
Arduino Forum
Using Arduino => Sensors => Topic started by: fredolm on April 27, 2013, 04:26:45 am
Title: Arduino DUE analog output with Digital to Analog Converter Post by: fredolm on April 27, 2013, 04:26:45 am Hello, I got an Arduino DUE board. I was trying to use the analog output, using the Digital to Analog Converter. I tried with both 10-bit resolution and 12-bit resolution (with function analogWriteResolution() ). When I try to generate 0 V at pin DAC0, using the command: analogWrite(DAC0,0) with a multimeter I measure about 0.56 V between pins DAC0 and GND, . This happens either with 10-bit and 12-bit resolutions. When I try to generate 3 V at pin DAC0, using the command: analogWrite(DAC0,4095) (I have set 12-bit resolution before) or analogWrite(DAC0,1023) (I have set 10-bit resolution before) with a multimeter I measure about 2.7 V between pins DAC0 and GND, . The same happens if I use DAC1 pin. Then, I bought a second Arduino DUE board and the behaviour is the same. Do I miss something? Thanks a lot
Powered by SMF 1.1.18 | SMF 2013, Simple Machines
1 de 1
http://forum.arduino.cc/index.php?PHPSESSID=ds0tec2s6fb0e6o9ovccr...
Arduino Forum
Products => Arduino Due => Topic started by: Adarsh_Verma on March 18, 2013, 08:40:53 am
Title: DUE DAC output Post by: Adarsh_Verma on March 18, 2013, 08:40:53 am 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
Title: Re: DUE DAC output Post by: Grumpy_Mike on March 18, 2013, 11:27:03 am
Code: analogWrite(DAC0, value );
Well using
will do it. Guess how you access DAC1. This will give you 8 bits resolution. To get the full 12 bits use:in the setup.
Code: analogWriteResolution(12);
Title: Re: DUE DAC output Post by: Adarsh_Verma on March 19, 2013, 05:01:31 am 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 Title: Re: DUE DAC output Post by: chriskner on March 19, 2013, 09:58:26 am
Quote from: adarshverma96 on March 19, 2013, 05:01:31 am 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 (http://arduino.cc /forum/index.php/topic,139733.msg1134372.html#msg1134372) (Page 1033 of a similar datasheet)
1 de 2
http://forum.arduino.cc/index.php?PHPSESSID=ds0tec2s6fb0e6o9ovccr...
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 Title: Re: DUE DAC output Post by: Adarsh_Verma on March 20, 2013, 05:11:39 am Got it. Thanks for your Help :smiley-mr-green:
Powered by SMF 1.1.18 | SMF 2013, Simple Machines
2 de 2