1. Welcome to our site! Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.
    Dismiss Notice

How to convert unipolar digital signals to bipolar digital signals?

Discussion in 'General Electronics Chat' started by pavanbabut, Oct 7, 2015.

  1. pavanbabut

    pavanbabut Member

    Joined:
    Apr 27, 2012
    Messages:
    242
    Likes:
    0
    I am using an AD7533 10bit multiplying DAC which can work with either unipolar or Bipolar (offset) binary codes. I have unipolar digital signals that are generated by a 4040N 12-tage binary counter that I input to AD7533 and it works fine in unipolar mode which goes from 0 (LSB) to -Vref (MSB), now I am trying to make it work in bipolar mode so that I can have -Vref(LSB) to +Vref(MSB). For this I need to input bipolar digital signals (-5V - +5V) rather than unipolar (0-5V), rather than using op-amps for each bit, are there any ready to use converters with multiple inputs and outputs available?

    thanks
     
  2. ronsimpson

    ronsimpson Well-Known Member Most Helpful Member

    Joined:
    Apr 17, 2007
    Messages:
    7,315
    Likes:
    970
    Location:
    Loveland, CO USA
    ONLINE
    NO!
    "Data in absolute max.= -0.3 to Vdd_0.3 volts."
    upload_2015-10-7_16-16-42.png
    In the above picture you can see that the digital inputs go from ground to VDD. (5 to 16 volts)
     
  3. pavanbabut

    pavanbabut Member

    Joined:
    Apr 27, 2012
    Messages:
    242
    Likes:
    0
    Exactly, I did see that in their max ratings, but when you scroll down to page 8, they say Bipolar (offset) binary code & on the inputs side, they say Bipolar digital inputs, which is confusing to me. Is there another kind of bipolar code that I am not aware of?
     
  4. dave

    Dave New Member

    Joined:
    Jan 12, 1997
    Messages:
    -
    Likes:
    0


     
  5. pavanbabut

    pavanbabut Member

    Joined:
    Apr 27, 2012
    Messages:
    242
    Likes:
    0

    I guess I figured out my problem here for not having bipolar analog output with my setup. For AD7533 to output full scale bipolar output, it needs to have all 10 bits actively working, in other words it should be running as 10bit multiplying DAC. In my case, I have only 9 active bits (512) so, it is not possible to run in full bipolar range. Once I change it to full 10bit, the output changed to bipolar. I think I am stuck with unipolar operation or now.
     
  6. MikeMl

    MikeMl Well-Known Member Most Helpful Member

    Joined:
    Mar 17, 2009
    Messages:
    11,104
    Likes:
    563
    Location:
    AZ 86334
    Or left-shift the 9bit input 1 bit, and wire the lsb to a zero...
     
  7. pavanbabut

    pavanbabut Member

    Joined:
    Apr 27, 2012
    Messages:
    242
    Likes:
    0
    I have the option to do full 10bit, but for my application I need to do 512(9bits) only. There maybe another way I guess to achieve this or I may not be understanding properly what you said.

    thanks
     
  8. KeepItSimpleStupid

    KeepItSimpleStupid Well-Known Member Most Helpful Member

    Joined:
    Oct 30, 2010
    Messages:
    9,941
    Likes:
    1,099
    I didn't read the datasheet, but if it' s 2' complement, you can "sign extend" the bits. To make things simple suppose I had a -128 to +127 8 bit 2's complement, but I wanted to work with 16 bit numbers. You can take the sign bit and replicate it.

    e.g. 11111111b is -1 decimal in 8 but mode, but 11111111 11111111 is -1 in 16 bit mode Same for 01111111 which is +127.
    replicating the 0, gives you 00000000 011111111 which is also +127 in 16 bit mode.
     
    • Like Like x 1
  9. pavanbabut

    pavanbabut Member

    Joined:
    Apr 27, 2012
    Messages:
    242
    Likes:
    0
    In my setup, I have a clk input that comes from an external hardware which when counted for 512 lines using a 4040 IC, produces a ~30Hz pulse at Q8 or bit 9 which I use to reset another 4040 that is connected to 7533 DAC which then produces a ramp at 30Hz. Both 4040s use the same clk input. Since I am resetting my second 4040 at bit 9, only 9 bits are active on 7533and hence no bipolar output.

    Any suggestions in this setup that I can add to make it bipolar while keeping the ramp output at 30Hz ?

    thanks
     
  10. ronsimpson

    ronsimpson Well-Known Member Most Helpful Member

    Joined:
    Apr 17, 2007
    Messages:
    7,315
    Likes:
    970
    Location:
    Loveland, CO USA
    ONLINE
    You need the "30hz" on bit 10. Ground bit 1.
     
  11. pavanbabut

    pavanbabut Member

    Joined:
    Apr 27, 2012
    Messages:
    242
    Likes:
    0
    Great, that worked perfect. Thanks to Mike for suggesting this and Ron for reiterating it differently.
     
  12. pavanbabut

    pavanbabut Member

    Joined:
    Apr 27, 2012
    Messages:
    242
    Likes:
    0
    Is there any way to ensure that the output is truly bipolar? Currently the output seems to be more towards -ve or is this behavior due to LSB bit being tied to zero?

    thanks
     
  13. BobW

    BobW Active Member

    Joined:
    Apr 28, 2010
    Messages:
    516
    Likes:
    54
    Location:
    Canada
    If your input is ranging from 0 to 511 (9 bits) then we must assume that a zero output voltage occurs at the halfway position which is either 255 or 256. Whichever it is, that will leave an unequal number of counts on either side of the zero point, which means that the output will have a bias one way or the other. Since your output is slightly negative, it implies that your zero output occurs when the count is 256 (which makes sense). That means that you get a negative output for values 0..255 and positive for 257..511. That gives you 256 counts on the negative side and only 255 counts on the positive side. The solution would be to make count 0 an illegal state. In other words, make your 4040 counter reset to one instead of zero whenever it hits the maximum count. Unfortunately, I don't think there's any way of doing that with a 4040.
     
  14. KeepItSimpleStupid

    KeepItSimpleStupid Well-Known Member Most Helpful Member

    Joined:
    Oct 30, 2010
    Messages:
    9,941
    Likes:
    1,099
    You have 2's complement or magnitude+sign types of representation, The advantage to two's complement is that there isn't 2 representations for zero.

    16 bit ranges = -32768 to +32767 two's complement or +-32767 magnitude + sign.
     
  15. pavanbabut

    pavanbabut Member

    Joined:
    Apr 27, 2012
    Messages:
    242
    Likes:
    0
    After doing some more tests, I came to notice that this offset is not always -ve, sometimes its +ve as well, but at the same reference voltage I get both -ve offset and +ve offset randomly. Does it make sense?

    Let say at 1V reference voltage, I get -xmV offset, I moved to different reference voltage and came back to 1V again, now its +ymV offset. The difference in the absolute offset is quite small but its there.
     
    Last edited: Nov 14, 2017

Share This Page