go_away

Author Topic: Level shifting chip  (Read 1262 times)

0 Members and 1 Guest are viewing this topic.

Offline cyberfishTopic starter

  • Robot Overlord
  • ****
  • Posts: 163
  • Helpful? 3
Level shifting chip
« on: May 09, 2010, 10:01:25 PM »
I have a bipolar analog signal (-2.5 to 2.5V) that I want to shift to 0V to 5V.

I could use a few op amps (I also need high input impedance), but I'm trying to minimize component count.

I thought it should be a common thing, so maybe someone has made a chip to do just that?

Has anyone heard of something like that?

Thanks!

Offline Soeren

  • Supreme Robot
  • *****
  • Posts: 4,672
  • Helpful? 227
  • Mind Reading: 0.0
Re: Level shifting chip
« Reply #1 on: May 10, 2010, 01:59:43 AM »
Hi,

I have a bipolar analog signal (-2.5 to 2.5V) that I want to shift to 0V to 5V.

I could use a few op amps (I also need high input impedance), but I'm trying to minimize component count.

I thought it should be a common thing, so maybe someone has made a chip to do just that?

Has anyone heard of something like that?
Yes, they're called op-amps ;D
The op-amp (Operational Amplifier) is truly a versatile component and should be worshipped daily on a little shrine by any true followers of Electronics Jutsu!

What exactly does your signal look like?
What power supply do you have in the circuit?
Regards,
Søren

A rather fast and fairly heavy robot with quite large wheels needs what? A lot of power?
Please remember...
Engineering is based on numbers - not adjectives

Offline cyberfishTopic starter

  • Robot Overlord
  • ****
  • Posts: 163
  • Helpful? 3
Re: Level shifting chip
« Reply #2 on: May 10, 2010, 11:40:55 AM »
Oh yeah I do love op amps, just curious if there's an easier way.

I'm trying to make a ghetto USB oscilloscope, so the input can pretty much be anything. DC bias for sure. Since the ADC and MCU will limit the sampling rate to ~10Msps, the signal won't be too fast (or it could be, but I won't be able to see it anyways).

The supply is +-5. +5V from USB, and -5V by doubling (10V), inverting (-10V), then regulating (7905). I'm not actually sure if I need the -5V to be that clean (an inverter alone has really bad output impedance), but I guess it can't hurt.

Actually, if you don't mind, it would be great if you can comment on my overall design, since I have never done anything like this before :).

The inputs (probably 4) go into a voltage divider, then a buffered bipolar video mux. Then I'd shift the voltage to unipolar (just so I won't need 4 level shifters), and that goes into an unipolar differential ADC's Vin+.

The Vin- and Vref are driven by a DAC (through a buffer) to set the vertical offset and gain, respectively.

The rest is all microcontroller.

Thanks!

Offline Soeren

  • Supreme Robot
  • *****
  • Posts: 4,672
  • Helpful? 227
  • Mind Reading: 0.0
Re: Level shifting chip
« Reply #3 on: May 10, 2010, 05:36:48 PM »
Hi,

Oh yeah I do love op amps, just curious if there's an easier way.

Before I read your post, I adapted this circuit, but it's way too slow for what you wanna do, so don't mind the IC, it has to be another type.
The circuit remains the same though.

un-"crimped" view
If 10k resistors doesn't suit your app. you could make them 1k or 100k, the important thing is that they're all the same.
It might need a bit care in layout at 10MHz and perhaps a resistor between pin 3 and ground (value= R1//R2) to get the largest possible CMRR.


~10Msps, the signal won't be too fast (or it could be, but I won't be able to see it anyways).

You need video op-amps for this,


The supply is +-5. +5V from USB, and -5V by doubling (10V), inverting (-10V), then regulating (7905). I'm not actually sure if I need the -5V to be that clean (an inverter alone has really bad output impedance), but I guess it can't hurt.

If you make a virtual ground at +2.5V for the ground connection of the inputs, you don't need level translators at all.
(Decouple to system ground by a large(ish) capacitor.


The inputs (probably 4) go into a voltage divider, then a buffered bipolar video mux. Then I'd shift the voltage to unipolar (just so I won't need 4 level shifters), and that goes into an unipolar differential ADC's Vin+.

If you wanna go that route (contrary to just lifting input ground to +2.5V), you might wanna give it a second thought. If you feed 4 signals through 1 amp, it will have to switch between voltages that might be 5V different and that will take a very fast amplifier. at least 100 times your bw, i.e. 1GHz minimum and those high frequency op-amps are both expensive and quite temperamental.

Why multiplex it at all?  4 separate inputs will be easier and faster.


Btw. A quad op-amp is cheaper than 4 single op-amps and takes less area of PCB.
Regards,
Søren

A rather fast and fairly heavy robot with quite large wheels needs what? A lot of power?
Please remember...
Engineering is based on numbers - not adjectives

Offline cyberfishTopic starter

  • Robot Overlord
  • ****
  • Posts: 163
  • Helpful? 3
Re: Level shifting chip
« Reply #4 on: May 10, 2010, 06:25:25 PM »
Thanks.

I like the virtual ground idea very much, I think I'll do that. If the system is powered by USB, which is powered by the PC power supply, it's isolated right? So I can measure anything except the same PC.

For the circuit you posted, the first amp is a summer, but the second one is a sgn(Vin)? There is no negative feedback.

I didn't think about the switching speed required, good point.

I'm multiplexing so I can use just one ADC (it only has 1 input), and the microcontroller is not fast enough read from many ADCs at the same time anyways. Also, since it's a parallel ADC (serial/SPI is way too slow), it would also save a lot of traces.

I guess I can try to find an ADC with more inputs, too.

Offline Soeren

  • Supreme Robot
  • *****
  • Posts: 4,672
  • Helpful? 227
  • Mind Reading: 0.0
Re: Level shifting chip
« Reply #5 on: May 10, 2010, 10:04:05 PM »
Hi,

I like the virtual ground idea very much, I think I'll do that. If the system is powered by USB, which is powered by the PC power supply, it's isolated right? So I can measure anything except the same PC.
Well, it's hard to be specific with a PC you don't know, but you need to check if there's a connection between the USB 0V supply and Protective Ground/Earth (the box of the PC). You need to check for AC connectivity as well, just in case.


For the circuit you posted, the first amp is a summer, but the second one is a sgn(Vin)? There is no negative feedback.
Sorry, that's what happen when you do things sober ;D
It should have been an inverter, but I added it as an afterthought, with a certain lack of thought it seems.
It's not really needed, as it is easy to invert the signal in software, but two resistors will get it back in shape.


I'm multiplexing so I can use just one ADC (it only has 1 input), and the microcontroller is not fast enough read from many ADCs at the same time anyways. Also, since it's a parallel ADC (serial/SPI is way too slow), it would also save a lot of traces.

I guess I can try to find an ADC with more inputs, too.
Better find a controller with with the needed amount of A/D-C - that'll save you some PCB as well.
I don't know which controller you use now, but with an 80 MHz controller you could really get something done.
Regards,
Søren

A rather fast and fairly heavy robot with quite large wheels needs what? A lot of power?
Please remember...
Engineering is based on numbers - not adjectives

Offline cyberfishTopic starter

  • Robot Overlord
  • ****
  • Posts: 163
  • Helpful? 3
Re: Level shifting chip
« Reply #6 on: May 11, 2010, 12:06:24 AM »
Ah I see.

I think anything I will measure will either be battery or 2-prongs transformer powered, so it should be fine. I'll buffer the virtual ground just in case (using the op amp's short circuit protection).

I was thinking about a built-in ADC, too, but microcontrollers with fast ADCs are very hard to find. Most use very slow SARs. The 2 fastest I found are an atxmega (2Msps) and a dsPIC that I forgot the part number of. With a 40 MIPS MCU and a stand-alone ADC it should be possible to do quite a bit higher than that (a few clocks per sample), but then that's higher cost, more space, and the multiplexing problem to worry about.

So I'm still undecided.

I was looking at some ARM microcontrollers, too, but that seems like way overkill. I wonder why they don't make fast 8-bit or 16-bit MCUs.

I don't quite feel like going with an FPGA for this project if not just for the millions of pins to solder.

Offline cyberfishTopic starter

  • Robot Overlord
  • ****
  • Posts: 163
  • Helpful? 3
Re: Level shifting chip
« Reply #7 on: May 11, 2010, 12:20:38 AM »
I think I found it.

http://www.analog.com/static/imported-files/Data_Sheets/AD9201.pdf

20 Msps, 2 channels buffered.

Offline Soeren

  • Supreme Robot
  • *****
  • Posts: 4,672
  • Helpful? 227
  • Mind Reading: 0.0
Re: Level shifting chip
« Reply #8 on: May 11, 2010, 02:57:52 AM »
Hi,

That might do it  :)
Regards,
Søren

A rather fast and fairly heavy robot with quite large wheels needs what? A lot of power?
Please remember...
Engineering is based on numbers - not adjectives

Offline cyberfishTopic starter

  • Robot Overlord
  • ****
  • Posts: 163
  • Helpful? 3
Re: Level shifting chip
« Reply #9 on: May 12, 2010, 05:36:54 PM »
After some more thinking and researching, I think I will go with a wicked fast (100-200MHz) CPLD with a dedicated SRAM chip to do the acquisition. Even at the same clock speed, a CPLD will be able to read from the ADC much faster than a microcontroller, because it can do a bunch of things at the same time. It will be like a "smart" DMA controller, sort of. Just reading from the ADC as fast as it can, and write the values to the RAM chip.

I will probably still have a lowly microcontroller to do the non time critical stuff, though (UART, free-running mode, etc). Don't really feel like coding everything in VHDL...

That will allow my oscilloscope to go much faster, with little increase in price (my primary concern).

There's got to be something wrong, though... Otherwise if all goes to plan I'd have made a way better USB scope than anything on the market, at a tiny fraction of the price...

I've never used a CPLD before, so that will be fun. I've used an FPGA, though.

 


Get Your Ad Here