• AVR Freaks

dsPIC33FJ128GP206 Correct DAC connection?

Author
x74
New Member
  • Total Posts : 4
  • Reward points : 0
  • Joined: 2009/02/23 10:24:25
  • Location: 0
  • Status: offline
2009/02/23 10:29:29 (permalink)
0

dsPIC33FJ128GP206 Correct DAC connection?

Hello,

as i read in other threads the dsPIC33FJ DAC-Outputs -> OPAMP Connection is shown wrong in the Microchip documentation.
When i build my circuit just as shown in the schematic it won't work. But i can measure the correct output on the
positive DAC output, so my code is correct. I would be glad if someone could post or send me a correct schematic
of how to connect the DAC-Outputs to the OPAMP and the 10k resistors.

Thanks in advance!
(Sorry for my bad english)
#1

16 Replies Related Threads

    graele
    Starting Member
    • Total Posts : 37
    • Reward points : 0
    • Joined: 2009/02/07 15:44:10
    • Location: 0
    • Status: offline
    RE: dsPIC33FJ128GP206 Correct DAC connection? 2009/02/23 10:47:55 (permalink)
    0
    Hello!

    In the schema the only mistake is that + and - are indicated in the wrong, so you should
    just substitute the - with the +, and it should work..

    For my curiosity, since I had to do as well with the DAC of the dsPIC33FJ128GP802,.. which
    voltages do you measure from the DAC-outputs??

    Manu
    #2
    x74
    New Member
    • Total Posts : 4
    • Reward points : 0
    • Joined: 2009/02/23 10:24:25
    • Location: 0
    • Status: offline
    RE: dsPIC33FJ128GP206 Correct DAC connection? 2009/02/23 10:52:13 (permalink)
    0
    Hey Manu,
     
    thanks for your reply. In another thread i read that the 10k resistor which goes to GND should go to 3.3V instead. So i'm very confused now ;)
     
    I did not measured with a scope, i simply connected the positive output to an audio-amplifier and sampled the signal with my PC.
    I got a sawtooth signal, just as expected, so my code seems to be correct.
     
    #3
    graele
    Starting Member
    • Total Posts : 37
    • Reward points : 0
    • Joined: 2009/02/07 15:44:10
    • Location: 0
    • Status: offline
    RE: dsPIC33FJ128GP206 Correct DAC connection? 2009/02/23 11:04:17 (permalink)
    0
    Well, I've checked again the schema.

    I confirm that you can just consider the plus as the minus (and viceversa), and everything will work fine.

    That's a normal opamp that realizes the difference between the two signals. You can find schema like
    that wherever on the net as confirmation.
    Usually the feedback is realized on the minus... but remember that the output voltage is inverted (that means
    with the opposite sign) 'cause the operational amplifier is used in its inverting mode. So, probably you should
    consider this for your application.

    Don't you really have a way to measure what's the minimum and maximum voltage it gives you?

    Ciao, Manu
    post edited by graele - 2009/02/23 11:11:26
    #4
    x74
    New Member
    • Total Posts : 4
    • Reward points : 0
    • Joined: 2009/02/23 10:24:25
    • Location: 0
    • Status: offline
    RE: dsPIC33FJ128GP206 Correct DAC connection? 2009/02/23 11:06:23 (permalink)
    0
    Thank you. I'm currently redesigning the board, if it's ready i will measure with a voltmeter and post results here.
     
    #5
    saipan59
    Super Member
    • Total Posts : 191
    • Reward points : 0
    • Joined: 2006/06/19 11:27:36
    • Location: 0
    • Status: offline
    RE: dsPIC33FJ128GP206 Correct DAC connection? 2009/02/24 08:12:40 (permalink)
    0
    Hi,
    I'm the person who posted the problems with the example schematic.
     
    Regarding the 10K to ground:
    If you use a single-supply op-amp (such as the MCP6022 shown), then connecting the 10K to ground is a problem because the output of the op-amp will sit at the "0 V" rail, and have no way to swing negative. However, if you use a dual-supply op-amp configuration (which includes a negative voltage supply), the the 10K should be connected to *ground*, as shown in the datasheet example.
     
    The idea is that the 10K should be connected to something that is *between* your highest and lowest power supply values (as seen by the op-amp). So with a dual-supply op-amp, the in-between value is typically "Ground".
     
    In my circuit, I tied the 10K to 3.3V, because it was already available on my board (power for the dsPIC). I run the MCP6022 from 5V, so *ideally* it could be tied to 2.5V. But 3.3V is "close enough", since the DAC output does not swing far enough to make a difference.
     
    Pete
     
    #6
    saipan59
    Super Member
    • Total Posts : 191
    • Reward points : 0
    • Joined: 2006/06/19 11:27:36
    • Location: 0
    • Status: offline
    RE: dsPIC33FJ128GP206 Correct DAC connection? 2009/02/24 08:25:45 (permalink)
    5 (1)
    This is my circuit:

    #7
    x74
    New Member
    • Total Posts : 4
    • Reward points : 0
    • Joined: 2009/02/23 10:24:25
    • Location: 0
    • Status: offline
    RE: dsPIC33FJ128GP206 Correct DAC connection? 2009/02/24 09:18:51 (permalink)
    0
    Thank you saipan59!
     
    #8
    bugwhiskers
    Starting Member
    • Total Posts : 32
    • Reward points : 0
    • Joined: 2009/01/25 18:18:21
    • Location: 0
    • Status: offline
    RE: dsPIC33FJ128GP206 Correct DAC connection? 2009/03/04 22:54:29 (permalink)
    0
    I think there may be a valid reason for the "mistake" in the schematic referred to earlier.
     
    I have lashed up a board with a dsPIC33FJ804 and with 8000 hex in the DACDFLT register pin 14 which is supposed to be positive is producing 1.14 volts and pin 15 which is supposed to be negative is producing 2.26 volts.
     
    Outputting music and you won't notice anything wrong, just a phase reversal that the ear couldn't discriminate but try using it for DC like I am the the output is not what is expected.
     
    regards
    bugwhiskers
    #9
    saipan59
    Super Member
    • Total Posts : 191
    • Reward points : 0
    • Joined: 2006/06/19 11:27:36
    • Location: 0
    • Status: offline
    RE: dsPIC33FJ128GP206 Correct DAC connection? 2009/03/05 19:02:24 (permalink)
    0
    Hi,
    I don't follow how your observation explains either of the errors in the datasheet schematic. Which mistake are you referring to - the incorrect 'positive feedback', or the input R connected to ground?

    You configured it for signed data?

    One thing I can say for sure is that the circuit I posted is working as expected.

    Pete
    post edited by saipan59 - 2009/03/05 19:23:28
    #10
    bugwhiskers
    Starting Member
    • Total Posts : 32
    • Reward points : 0
    • Joined: 2009/01/25 18:18:21
    • Location: 0
    • Status: offline
    RE: dsPIC33FJ128GP206 Correct DAC connection? 2009/03/06 03:46:03 (permalink)
    0
    If you are using the DAC for music or speech you will not notice the problem.
    If you put say 8000 hex into the DACDFLT register the pin marked DAC POSITIVE will have a LOWER voltage that the pin marked DAC NEGATIVE. The polarity of the outputs is incorrectly annotated.
     
    regards
    bugwhiskers
    #11
    saipan59
    Super Member
    • Total Posts : 191
    • Reward points : 0
    • Joined: 2006/06/19 11:27:36
    • Location: 0
    • Status: offline
    RE: dsPIC33FJ128GP206 Correct DAC connection? 2009/03/06 07:43:51 (permalink)
    0
    ORIGINAL: bugwhiskers

    If you are using the DAC for music or speech you will not notice the problem.
    If you put say 8000 hex into the DACDFLT register the pin marked DAC POSITIVE will have a LOWER voltage that the pin marked DAC NEGATIVE. The polarity of the outputs is incorrectly annotated.
    regards
    bugwhiskers

    I agree with your assessment here (I have not measured it myself, but I trust you when you say the outputs are reversed). This seems like yet another documentation error (the other big error would be the output voltage range).
    But are you still saying that either of the datasheet schematic errors is NOT an error?
    My contention is that the two errors I pointed out are show-stoppers, and the circuit is not usable for audio (or any other purpose).
     
    Pete
     
    #12
    BobK
    Super Member
    • Total Posts : 1404
    • Reward points : 0
    • Joined: 2008/04/16 12:13:38
    • Location: Worcester, MA
    • Status: offline
    RE: dsPIC33FJ128GP206 Correct DAC connection? 2009/03/06 10:58:42 (permalink)
    0
    If using a single supply op-amp, connect 2R to ground and 2R to Vdd in order to get output that is centered around half the supply voltage.  This connection is equivalent to connecting R to Vdd / 2.

    Bob
    post edited by BobK - 2009/03/06 11:10:05
    #13
    bugwhiskers
    Starting Member
    • Total Posts : 32
    • Reward points : 0
    • Joined: 2009/01/25 18:18:21
    • Location: 0
    • Status: offline
    RE: dsPIC33FJ128GP206 Correct DAC connection? 2009/03/06 15:53:34 (permalink)
    0
    The data sheet states that the output from the DAC is a Positive and a Negative voltage centered around a Middle voltage of 1.65 volts.
    It goes on to say that the maximum excursion either side is about 1 volt. With this information one would expect the DAC to have 2 volts between the two outputs with maximum input value and 0 volts with minimum input value.
    The use of a differential amp is necessary to see only the difference between the two outputs and exclude the voltage offset caused by the midpoint sitting 1.65 volts above ground.
     
    The pin labelled Positive is always a lower voltage than the pin labelled Negative and this will cause constructors grief until it is rectified by an errata.
     
    The above is discerned from my observations of an in circuit dsPIC33FJ128MC804, other variants of the dsPIC 33 may have correct labelling.
     
    regards
    bugwhiskers
    #14
    saipan59
    Super Member
    • Total Posts : 191
    • Reward points : 0
    • Joined: 2006/06/19 11:27:36
    • Location: 0
    • Status: offline
    RE: dsPIC33FJ128GP206 Correct DAC connection? 2009/03/07 10:10:19 (permalink)
    0
    ORIGINAL: BobK

    If using a single supply op-amp, connect 2R to ground and 2R to Vdd in order to get output that is centered around half the supply voltage.  This connection is equivalent to connecting R to Vdd / 2.
    Bob

    Yes - that's a good solution too.
    In the schematic I posted, I tied to 3.3V instead, because it didn't require adding any resistors, and I had already made my PCB before I noticed the problem.
    Fortunately, I *did* notice the incorrect feedback before making my PCB...
     
    Pete
     
    #15
    BobK
    Super Member
    • Total Posts : 1404
    • Reward points : 0
    • Joined: 2008/04/16 12:13:38
    • Location: Worcester, MA
    • Status: offline
    RE: dsPIC33FJ128GP206 Correct DAC connection? 2009/03/09 07:24:26 (permalink)
    0
    Saipan59,
     
    Since your schematic shows first an opamp then the headphone amp, I wonder if the opamp was necessary.  Since the headphone amp has differential inputs, could it not be configured the same way, as a differential amp?
     
    Bob
    #16
    saipan59
    Super Member
    • Total Posts : 191
    • Reward points : 0
    • Joined: 2006/06/19 11:27:36
    • Location: 0
    • Status: offline
    RE: dsPIC33FJ128GP206 Correct DAC connection? 2009/03/09 12:28:37 (permalink)
    0
    ORIGINAL: BobK
    Saipan59,
    Since your schematic shows first an opamp then the headphone amp, I wonder if the opamp was necessary.  Since the headphone amp has differential inputs, could it not be configured the same way, as a differential amp?
    Bob

    Hi Bob,
    It seems likely that your idea would work, but I haven't tried it.
     
    I had used the dsPIC datasheet example as my starting point. They used a different headphone amp that does not expose both the +/- inputs, so the op-amp is useful in that case. When I changed to the LM4808, it didn't occur to me that it might work to skip the op-amp stage...
    I wonder if the headphone amp has adequate input impedance and such? It probably does, but params like that should be checked.
     
    Pete
     
    #17
    Jump to:
    © 2019 APG vNext Commercial Version 4.5