A to D
Jen H
Posts: 3
Is there a way that I can program the bs2 to output a certain analog signal.· For example, if i want to get 3.2 volts, how would I go about doing it besides using PWM?· I have tried using PWM for my motor control but I keep getting random pulses.
Comments
· You could do a rudimentary D-to-A with a summing amplifier (op-amp), but that would cost you I/O pins (16-bit resolution = 4 pins.)
· If all you want is a particular voltage there are ways to approach that, too (if it is < VDD, then a voltage divider on the STAMP output pin would be easiest.)
· Either way, the result would be a reference voltage, not one that you could drive with, necessitating use of an amplifier.
· At any rate, you cannot achieve this objective through programming alone.
As they make A/D (analog to digital) chips, they also make D/A (digital to analog) chips. This is especially helpful if your requirements change over time, since the output is variable.
Regards,
Bruce Bates
Post Edited (Bruce Bates) : 7/25/2006 3:18:17 AM GMT
The following messages have code for a couple of different 12 bit (4096 step) DACs...
MAX5722:
http://forums.parallax.com/showthread.php?p=553090
TLV5618A:
http://forums.parallax.com/showthread.php?p=555268
I think you may be misapplying the PWM. What do you mean by "I have tried using PWM for my motor control but I keep getting random pulses."? You may need both an RC filter and an op amp x1 buffer between the Stamp PWM and the MD03. The buffer is described in the Stamp manual.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Tracy Allen
www.emesystems.com