+ Reply to Thread
Results 1 to 8 of 8

Thread: SX driving a DAC

  1. #1

    Default SX driving a DAC

    Hello,

    I want my SX to produce an adjustable output voltage from 0-5v. The DAC is a LTC1257, 12 bit resolution.

    The problem I have is that the output is "choppy" to use a non-electrical term.

    My data connection to the chip works fine and my voltmeter is reading the voltage that the DAC chip should be putting out. The basic setup works just fine. Amperage output is very limited directly from the chip as it will only dimly light an LED. I've amplified the output of the DAC through a LM358AN op-amp. No problem lighting a LED now. Also the output is what it should be according to my voltmeter, but still the same choppy output. I'm using the Parallax USB oscilloscope to view the output.

    I'm guessing that what I'm seeing is exactly what I'm supposed to see. I know the DAC turns on, creates a voltage, then turns off, repeating this many hundreds or thousands of times a second. I've tried a few capacitors on the output and it has helped, but I'm afraid if I use one that is too big, then it will create a delay when changing the output voltage.

    Am I going about this all wrong? Web searches return lots of info on ADC's, but very little on DAC's. Even the datasheet on the DAC isn't very informative. It talks about noise filters, but I don't see this as noise from an external source.

    Any ideas? direction to go? things to read?

    Thanks for any input.

    Alex

    Post Edited (Alex41) : 12/18/2009 3:35:03 AM GMT
    Last edited by ForumTools; 09-30-2010 at 11:05 AM. Reason: Forum Migration

  2. #2

    Default

    Alex,
    I'm not sure what you mean by "choppy". But a DAC like the LTC1257 does not turn on and off. It creates a stable voltage and holds it there.

    If you could post your code, we could maybe see what is wrong.

    Bean.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    1st rule of finance...Don't lose money.
    Never be ashamed of making an honestprofit.
    Live within your means...Make do, or do without.
    Last edited by ForumTools; 09-30-2010 at 11:05 AM. Reason: Forum Migration

  3. #3

    Default

    Bean,

    I didn't post the code before thinking this was a problem on the hardware end. It is attached.

    By choppy I mean the output, when viewed on an oscilliscope, looks like it has a lot of noise. I'll see if I can capture it and post it.

    I've attached a LCD to view the variables for debugging away frommy computer.

    Alex
    Attached Files Attached Files
    Last edited by ForumTools; 09-30-2010 at 11:05 AM. Reason: Forum Migration

  4. #4

    Default

    Forget the other hardware for now - simply output a fixed value to the DAC, and see what you get. Then try a ramp and check it with the scope. That should help you locate the problem.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Amateur radio callsign: G1HSM
    Last edited by ForumTools; 09-30-2010 at 11:05 AM. Reason: Forum Migration

  5. #5

    Default

    Here is a post when I was working on this a while ago.


    http://forums.parallax.com/forums/default.aspx?f=7&m=251301&g=254365#m254365

    The Link has a much shorter version of the one posted a few days ago. The code running the LTC1257 is identical.


    Here is the meat of the program running the chip.

    PinLoad = 0 ' activate chip to receive data
    SHIFTOUT Din,Clk,MSBFIRST,Pottime_MSB ' send high nib
    SHIFTOUT Din,Clk,MSBFIRST,Pottime_LSB ' send low byte
    PinLoad = 1 ' de-active chip to output voltage

    I don't know for sure if the above is even correct. It works, but I don't know if de-activating the chip is correct. Above Bean said that the DAC chips put out a constant voltage. When I deactivate the chip am I shutting off the chip and is that why I get such a rough signal? I figured out the above code by trial and error and not sure if it is the right way to go about it.


    This project has been sitting in my "to finish" box for a while and I want to know if it will work. It seems like I'm pretty close.


    Leon,
    The DAC does put out a fixed voltage when using a fixed value. My voltmeter reads it as a steady voltage. My scope shows a signal with a lot of noise in it. That's my problem.


    Thanks for everyones help so far.
    Last edited by ForumTools; 09-30-2010 at 11:05 AM. Reason: Forum Migration

  6. #6

    Default

    Alex41,

    How much noise are we talking about here? 1/2 volt? 1/4 volt? Smaller? Larger? A 12 bit DAC running at 5 volts means each step is roughly 1 millivolt. What is the setup you're working on? A breadboard with long wires everywhere? If you don't have a PCB with a ground plane, don't expect a clean output from a hi-rez DAC. The funkier your setup is, the funkier the output will be.

    Thanks,
    PeterM
    Last edited by ForumTools; 09-30-2010 at 11:05 AM. Reason: Forum Migration

  7. #7

    Default

    Peter,

    it was first setup on 2 seperate breadboards. Now it's soldered to a circuitboard with several 5-6 inch wires running to a SX-28 protoboard. I guess that sure could be a problem.

    Right now I don't have a good answer on the amount of noise. I'll see if I can get a screen capture from the scope and post it tonight.

    Thanks,
    Last edited by ForumTools; 09-30-2010 at 11:05 AM. Reason: Forum Migration

  8. #8

    Default

    OK,

    I have some more info/answers to questions to post.

    I appreciate everyones input, sorry it took a while to post this. Food poisoning tends to slow you down a bit.

    I have 2 pics attached. The setup is this, SX talks to DAC, then DAC output is amplified with an OpAmp. The output from the DAC is the same as from the OpAmp.


    DAC01 shows the output on the Parallax 'scope. The "Noise" is about 0.15 volts plus and minus the generated voltage of about 0.9 volts, for a total amplitude of about 0.3 volts. Also the 3 dips in voltage I haven't seen before.

    DAC02 shows the same output, but a higher voltage of about 1.3 volts. Total amplitude of the noise is still the same as the other pic.



    Any ideas?
    Alex


    PeterM,
    I have the DAC and OpAmp soldered to a Radioshack circuitboard, they are close together, but have no ground plane. The longwires of about 5-6 inches come from the SX Protoboard to the circuitboard. They are carrying the data to talk to the DAC.

    Post Edited (Alex41) : 12/29/2009 8:59:52 PM GMT
    Attached Images Attached Images
    Last edited by ForumTools; 09-30-2010 at 11:05 AM. Reason: Forum Migration

+ Reply to Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts