[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 112: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 112: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 112: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 112: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/functions.php on line 4756: Cannot modify header information - headers already sent by (output started at [ROOT]/includes/functions.php:3891)
[phpBB Debug] PHP Warning: in file [ROOT]/includes/functions.php on line 4758: Cannot modify header information - headers already sent by (output started at [ROOT]/includes/functions.php:3891)
[phpBB Debug] PHP Warning: in file [ROOT]/includes/functions.php on line 4759: Cannot modify header information - headers already sent by (output started at [ROOT]/includes/functions.php:3891)
[phpBB Debug] PHP Warning: in file [ROOT]/includes/functions.php on line 4760: Cannot modify header information - headers already sent by (output started at [ROOT]/includes/functions.php:3891)
Open Music Labs Forums • View topic - DAC in Audio Codec Shield

DAC in Audio Codec Shield

DAC in Audio Codec Shield

Postby liner » Fri Jun 29, 2012 2:13 am

Hi all,

I just want to use the DAC in the Audio Codec Shield in a way that the Arduino uno sets a digital number and we can get an analogue output.

Any approaches of how to start?

Thankx
liner
 
Posts: 6
Joined: Fri Jun 29, 2012 2:11 am

Re: DAC in Audio Codec Shield

Postby guest » Fri Jun 29, 2012 9:39 am

that should be pretty easy
but be sure to take your output
from the line_out solder pads
and not the headphone

the headphone output is only AC voltages

in all of the examples there is a line like this
AudioCodec_data(&left_in, &right_in, left_out, right_out);
you write your value to left_out or right_out
depending upon where you have the wire connected
guest
Site Admin
 
Posts: 449
Joined: Thu May 20, 2010 11:58 pm

Re: DAC in Audio Codec Shield

Postby liner » Thu Jul 05, 2012 1:48 am

Thank you, guest.

Just what I needed. It is quite simple in fact, I just did not understand well that function.
liner
 
Posts: 6
Joined: Fri Jun 29, 2012 2:11 am

Re: DAC in Audio Codec Shield

Postby vickyjungade » Tue Sep 18, 2012 3:35 am

What is acceptable value (range or discrete) as an argument to the function AudioCodec_data for giving out a voltage say 3.5V or 5V? I tried passing different values for left_out as well as right_out - 125, 500 or 32767. But none of these could give me any analog out (DAC out was zero).

I tried sine_generator sketch from the examples and could see sine wave on a scope (HP_Out); adjustable freq & amplitude with the mods - so nothing wrong with the hardware setup.

Inside sine_generator -
I am not able to understand the co-relation between values in the look up table (sinetable.inc) & the generated wave.
I would also like to know how pgm_read_word_near function works?
The Arduino IDE does not show this function in orange color like others. How is that???
I tried passing values from the lookup directly to this function, but that does not work as well.
vickyjungade
 
Posts: 6
Joined: Tue Sep 18, 2012 3:33 am
Location: Dombivli, Mumbai, Maharashtra, India

Re: DAC in Audio Codec Shield

Postby guest » Tue Sep 18, 2012 11:15 am

guest
Site Admin
 
Posts: 449
Joined: Thu May 20, 2010 11:58 pm

Re: DAC in Audio Codec Shield

Postby vickyjungade » Sat Sep 22, 2012 2:43 am

Attachments
2012-09-22 15.05.58.jpg
2012-09-22 15.05.58.jpg (92.77 KiB) Viewed 23251 times
vickyjungade
 
Posts: 6
Joined: Tue Sep 18, 2012 3:33 am
Location: Dombivli, Mumbai, Maharashtra, India

Re: DAC in Audio Codec Shield

Postby guest » Sat Sep 22, 2012 11:15 am

guest
Site Admin
 
Posts: 449
Joined: Thu May 20, 2010 11:58 pm

Re: DAC in Audio Codec Shield

Postby guest » Sat Sep 22, 2012 12:28 pm

also
if you want to tell me a bit more about what youre doing
i might be able to help more
guest
Site Admin
 
Posts: 449
Joined: Thu May 20, 2010 11:58 pm

Re: DAC in Audio Codec Shield

Postby vickyjungade » Sun Sep 23, 2012 12:04 am

We could write through the DAC properly. Thanks!

We are implementing a PID as described in http://en.wikipedia.org/wiki/PID_controller. Any suggestions?

The ADC is to read the process variable, DAC is to transmit the control value.

Please explain how to:

0. Read the ADC properly. Which pin to connect the process variable signal? We could not correctly read a DC voltage (or sine) through function AudioCodec_data, (argument &left_in or &right_in) when connected to IN as shown in attachment.
1. set the interval of the ISR that calls the read & write functions, as we have to write our functionality in loop()
2. use the 24 bit ADC & 32 bit DAC for accuracy. Please explain how to? What is the 'maximum resulution' of ADC & DAC that can be used , i mean 16 bit or 18 bit or 24 bit. We need a ADC/DAC with max code width, hence this card!
1. the range for left_in & right_in is -32768 to 32767. Also the range for left_out & right_out is the same. Besides the defination of AudioCodec_data shows that these parameters are int. Why so?
2. the AudioCodec_readme.txt says, for the function AudioCodec_ADC - "the ADC is only a 10bit ADC". Why so?
3. Also, how to read & write, ADC & DAC by calls in loop function without using interrupt
Attachments
2012-09-23 16.30.56.jpg
2012-09-23 16.30.56.jpg (99.13 KiB) Viewed 23238 times
vickyjungade
 
Posts: 6
Joined: Tue Sep 18, 2012 3:33 am
Location: Dombivli, Mumbai, Maharashtra, India

Re: DAC in Audio Codec Shield

Postby guest » Sun Sep 23, 2012 12:40 pm

guest
Site Admin
 
Posts: 449
Joined: Thu May 20, 2010 11:58 pm

Next

Return to Audio Codec Shield

Who is online

Users browsing this forum: No registered users and 1 guest


cron