Connecticut
Offline
Edison Member
Karma: 16
Posts: 1214
RTFD (Datasheet in our case)
|
 |
« on: January 16, 2011, 07:27:09 pm » |
This is on the way: http://www.sparkfun.com/products/8736I don't understand exactly how to operate it. I understand the I2C part, but what if I am putting in 5V, what number would I input digitally to get, say, 3.4V? I want to generate a sine wave for audio.... Also, how can I generate a negative voltage? (for this and op amp supplies) Thanks!
|
|
|
|
« Last Edit: January 16, 2011, 07:29:50 pm by baum »
|
Logged
|
I'm not kidding. If I am asking a question whose answer is found within the concerned product's datasheet, shame on me. If I am answering a similar question, shame on you!
|
|
|
|
Atlanta
Offline
Sr. Member
Karma: 0
Posts: 254
Arduino still rocks
|
 |
« Reply #1 on: January 16, 2011, 07:34:41 pm » |
Its a 12-Bit Digital-to-Analog Converter, so the output is Vref * count / 2^12 which is Vout = Vref * count / 4096.
|
|
|
|
|
Logged
|
|
|
|
|
Connecticut
Offline
Edison Member
Karma: 16
Posts: 1214
RTFD (Datasheet in our case)
|
 |
« Reply #2 on: January 16, 2011, 08:21:42 pm » |
what is "count" and "vref"? Are those the numbers?
i.e. If I had 5V supply rail and I wanted 2.5 volts I would send 2048 over I2C?
[glow]Also, how can I generate a negative voltage?[/glow]
|
|
|
|
|
Logged
|
I'm not kidding. If I am asking a question whose answer is found within the concerned product's datasheet, shame on me. If I am answering a similar question, shame on you!
|
|
|
|
0
Offline
Tesla Member
Karma: 71
Posts: 6625
Arduino rocks
|
 |
« Reply #3 on: January 16, 2011, 08:50:20 pm » |
Looks like its ratiometric to the supply. 4095 -> 5V, 0 -> 0V. 2048 -> 2.5V
|
|
|
|
|
Logged
|
|
|
|
|
Connecticut
Offline
Edison Member
Karma: 16
Posts: 1214
RTFD (Datasheet in our case)
|
 |
« Reply #4 on: January 16, 2011, 08:50:53 pm » |
And a negative voltage?
|
|
|
|
|
Logged
|
I'm not kidding. If I am asking a question whose answer is found within the concerned product's datasheet, shame on me. If I am answering a similar question, shame on you!
|
|
|
|
0
Offline
Tesla Member
Karma: 71
Posts: 6625
Arduino rocks
|
 |
« Reply #5 on: January 16, 2011, 08:53:13 pm » |
Also, how can I generate a negative voltage? By having a -5V supply as well, and an opamp in an inverting amplifier configuration perhaps? The DAC chip is only single rail and max supply of 5.5V so it won't do it by itself.
|
|
|
|
|
Logged
|
|
|
|
|
Left Coast, CA (USA)
Offline
Brattain Member
Karma: 279
Posts: 15314
Measurement changes behavior
|
 |
« Reply #6 on: January 16, 2011, 08:58:25 pm » |
Also, how can I generate a negative voltage? You can't directly. You can either take the D/A analog output into a unity gain op-amp that has a +2.5vdc offset to the - input of the opamp and that uses + and - voltage rails and then you would have a AC output voltage centered on 0v, going both positive and negative. For simple audio use, you can most likely just pass the D/A output through a say .5mfd series capacitor and using a common ground connection from the converter to the device you are wiring to, and it will be a true zero based ac voltage. Recall that a cap passes AC but blocks DC voltages. Lefty
|
|
|
|
« Last Edit: January 16, 2011, 09:01:33 pm by retrolefty »
|
Logged
|
|
|
|
|
Connecticut
Offline
Edison Member
Karma: 16
Posts: 1214
RTFD (Datasheet in our case)
|
 |
« Reply #7 on: January 16, 2011, 09:07:19 pm » |
With no relation to anything else I have talked about on this post, how can I generate the inverse voltage of the input? 5v generates maybe -4.98V and so forth.
|
|
|
|
|
Logged
|
I'm not kidding. If I am asking a question whose answer is found within the concerned product's datasheet, shame on me. If I am answering a similar question, shame on you!
|
|
|
|
Left Coast, CA (USA)
Offline
Brattain Member
Karma: 279
Posts: 15314
Measurement changes behavior
|
 |
« Reply #8 on: January 16, 2011, 10:15:20 pm » |
|
|
|
|
|
Logged
|
|
|
|
|
Connecticut
Offline
Edison Member
Karma: 16
Posts: 1214
RTFD (Datasheet in our case)
|
 |
« Reply #9 on: January 16, 2011, 11:08:34 pm » |
That makes negative integers. I want a negative voltage.
|
|
|
|
|
Logged
|
I'm not kidding. If I am asking a question whose answer is found within the concerned product's datasheet, shame on me. If I am answering a similar question, shame on you!
|
|
|
|
Global Moderator
Boston area, metrowest
Offline
Brattain Member
Karma: 249
Posts: 16544
Available for Design & Build services
|
 |
« Reply #10 on: January 16, 2011, 11:27:12 pm » |
You need a part like this then. http://www.analog.com/static/imported-files/data_sheets/AD1851_1861.pdfIt needs a negative supply so you can output a negative voltage. If you search further, either at analog devices or at maxim-ic.com, you might even find one with an internal negative supply source. These do not put out much current, so you may need a buffer after it depending on your needs.
|
|
|
|
|
Logged
|
|
|
|
|
Manchester (England England)
Offline
Brattain Member
Karma: 277
Posts: 25519
Solder is electric glue
|
 |
« Reply #11 on: January 17, 2011, 08:21:57 am » |
The simplest way it to have two power supplies one for the positive and one for the negative voltage. You then connect the -ve of one supply to the +ve of the other. This point then becomes your ground or reference point. Then the +ve end is the positive voltage and the -ve end is the negative voltage. You can then use these voltages to feed into your op-amps or A/D or D/A.
|
|
|
|
|
Logged
|
|
|
|
|
Connecticut
Offline
Edison Member
Karma: 16
Posts: 1214
RTFD (Datasheet in our case)
|
 |
« Reply #12 on: January 17, 2011, 03:28:37 pm » |
So like two batteries in series, with one wire at each end and ground in the center?
|
|
|
|
|
Logged
|
I'm not kidding. If I am asking a question whose answer is found within the concerned product's datasheet, shame on me. If I am answering a similar question, shame on you!
|
|
|
|
Global Moderator
Boston area, metrowest
Offline
Brattain Member
Karma: 249
Posts: 16544
Available for Design & Build services
|
 |
« Reply #13 on: January 17, 2011, 04:19:43 pm » |
Exactly. Two AAs will yield +/= 1.5V 6 will yield +/- 4.5V.
|
|
|
|
|
Logged
|
|
|
|
|
Connecticut
Offline
Edison Member
Karma: 16
Posts: 1214
RTFD (Datasheet in our case)
|
 |
« Reply #14 on: January 17, 2011, 04:23:00 pm » |
How can I do that with arduino? I don't want to power an op-amp off batteries.
|
|
|
|
|
Logged
|
I'm not kidding. If I am asking a question whose answer is found within the concerned product's datasheet, shame on me. If I am answering a similar question, shame on you!
|
|
|
|
|