Using the P2 as a 5V DAC
Duane Degn
Posts: 10,588
in Propeller 2
I need several 5V DACs for a project I'm working on. In the past I've used MCP492x chips.
Can I take advantage of the P2's DACs in such a way as to use it a better 5V DAC?
My initial plan is just to use an op amp with a small gain in order to boost the voltage to the appropriate level. Are there better options than this?
The output is close to DC. At most the level changes will occur a few times a second.
Can I take advantage of the P2's DACs in such a way as to use it a better 5V DAC?
My initial plan is just to use an op amp with a small gain in order to boost the voltage to the appropriate level. Are there better options than this?
The output is close to DC. At most the level changes will occur a few times a second.
Comments
You could also include some RC filtering, to allow use of the dithered dac options in P2, (if the load does not already average).
The accuracy of that will depend on the precision & noise of your 3v3 regulators, and the gain resistors.
We actually use 5.1V rather than 5V just to make sure we can reach full scale on a DAC output. We'll likely do the same thing with the op amp.
Thank you for verifying the op amp is a good option and thanks for your other suggestions.
Since you seems to be concerned that the selected op amp will be able to achieve full rail-to-rail 5V output-swing at 5.1V supply levels, then consider using Analog Devices ADA4500-2 duals, or similar devices.
You'll also need to verify the selected op amps will be able to sink/source the expected output current drive levels, without disturbing (causing imbalances at) their input bias resistor networks, or the "small gain' you'd mentioned at the first post will not be stable enough to achieve design goals.
Also, the "several" you'd mentioned is a bit "vague" quantity. If the numbers could reach the "outrageous" level, and design contraints does permit (timing), perhaps you could even consider using 74HC/HCT4067D analog muxes with small sample-and-hold capacitors at their outputs, in order to be able to transfer the intended analog voltage levels to each output gain stage, and scan them, sparing some (many) of P2 pins for further creative uses.
Hope it helps
Henrique
If high impedance u need some kind of amp anyway..
These DACs are used in a flow meter for variety of purposes.
Here's a list of some of these uses.
0V to 5V output for legacy control devices which like an analog interface.
0V to 5V output for a valve control which uses an analog interface.
A DAC may also be used in conjuction with platnium resistors and other circuity as one sensor option.
The meter includes conventional digital interfaces such as Bluetooth, USB and Modbus over RS485 but some customers like the oldschool analog outputs.
We also have a 4mA to 20mA current driver output but this is electically isolated so I don't see a way around using an external DAC with optoisolators on the digital interface.
We still have lots of unused I/O pins so far. I make a habbit of always bringing these pins out to at least some sort of pad so they can be accessed in the future if needed. This habit is kind of selfish since I end up with all sorts of prototype boards which I like to repurpose into robots and other fun personal projects.
Thanks for all the great suggestions.
Did you read "DAC" as "ADC"?
The attached schematic is a 3rd order sallen-key low-pass filter I use for converting a 5V PWM signal to +/-10V analogue voltage. You can change the R and C values to adjust gain, offset and corner frequency.
Correction, it's been so long that I had forgotten but I just checked and it is 7.6kHz 8-bit PWM at the standard 80MHz P1 clock.