Continue to Site

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.

  • 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.

How to convert unipolar digital signals to bipolar digital signals?

Status
Not open for further replies.

pavjayt

Member
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
 
For this I need to input bipolar digital signals (-5V - +5V) rather than unipolar (0-5V)
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)
 
NO!
"Data in absolute max.= -0.3 to Vdd_0.3 volts."
View attachment 94559
In the above picture you can see that the digital inputs go from ground to VDD. (5 to 16 volts)

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?
 
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.
 
Or left-shift the 9bit input 1 bit, and wire the lsb to a zero...
 
Or left-shift the 9bit input 1 bit, and wire the lsb to a zero...
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
 
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
Reactions: jjw
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
 
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
 
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.
 
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.
 
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:
Status
Not open for further replies.

New Articles From Microcontroller Tips

Back
Top