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
- It is currently Thu Jun 30, 2022 7:20 am • All times are UTC - 8 hours [ DST ]
DAC in Audio Codec Shield
23 posts
• Page 1 of 3 • 1, 2, 3
Re: DAC in Audio Codec Shield
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
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
Thank you, guest.
Just what I needed. It is quite simple in fact, I just did not understand well that function.
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
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.
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
- Attachments
-
- 2012-09-22 15.05.58.jpg (92.77 KiB) Viewed 27436 times
- vickyjungade
- Posts: 6
- Joined: Tue Sep 18, 2012 3:33 am
- Location: Dombivli, Mumbai, Maharashtra, India
Re: DAC in Audio Codec Shield
also
if you want to tell me a bit more about what youre doing
i might be able to help more
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
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
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 (99.13 KiB) Viewed 27423 times
- vickyjungade
- Posts: 6
- Joined: Tue Sep 18, 2012 3:33 am
- Location: Dombivli, Mumbai, Maharashtra, India
23 posts
• Page 1 of 3 • 1, 2, 3
Who is online
Users browsing this forum: No registered users and 1 guest