Arduino Forum

Products => Arduino Due => Topic started by: giants_fan3 on Dec 10, 2012, 04:52 am

Title: Solution for the 5V vs 3.3V problem
Post by: giants_fan3 on Dec 10, 2012, 04:52 am
(This post is based partly on suggestions by @hiduino, @Graynomad, and @CrossRoads seen here: http://arduino.cc/forum/index.php/topic,128582.msg972824.html#msg972824
http://arduino.cc/forum/index.php/topic,128582.msg967376.html#msg967376
http://arduino.cc/forum/index.php/topic,136243.msg1026496.html#msg1026496)

Since there are numerous existent Arduino shields with 5V signal levels, versus the 3.3V level at which the Arduino Due runs, users would need to have some solution to maintain interfacing compatibility.

So, how about something like the following:

Design an "in-between shield" with a level translator IC, for example GTL2000 ( http://www.nxp.com/documents/data_sheet/GTL2000.pdf ). This IC does 22 channel level translation and costs < US $2

This in-between shield would be inserted first into the Due, and on top of the shield would be inserted any arbitrary existent Arduino shield.

To allow separation for routing between the 5V shield lines and the 3.3V Due lines via the level translators, the in-between shield could have either slightly offset headers&sockets, or else surface mount headers on the bottom.

In contrast to resistor/diode-based methods, the above level-translator IC based solution should work bi-directionally, for all signal types (digital I/O, PWM, analog lines, Serial, SPI, I2C), and thus for all shields.

Any thoughts or issues seen regarding this Adapter-Shield approach?

Perhaps someone (or the Arduino dev team) can design a shield like the above.
Title: Re: Solution for the 5V vs 3.3V problem
Post by: Osgeld on Dec 10, 2012, 05:27 am
sounds like the perfect kludge for a poor design
Title: Re: Solution for the 5V vs 3.3V problem
Post by: giants_fan3 on Dec 10, 2012, 06:59 am
@Osgeld: Don't understand. Are you saying the suggestion I am making is poor? If so, do please provide comments.
Title: Re: Solution for the 5V vs 3.3V problem
Post by: Osgeld on Dec 10, 2012, 07:08 am
no I am saying that using an ARM in a ecosystem where 5 volts is common in the first place was pretty dumb
Title: Re: Solution for the 5V vs 3.3V problem
Post by: CrossRoads on Dec 10, 2012, 08:07 am
Think I've got ok start for it:
Title: Re: Solution for the 5V vs 3.3V problem
Post by: mbanzi on Dec 10, 2012, 02:50 pm
@Osgeld

Please provide your invaluable contribution when you have something more interesting to say.
If you don't like Arduino Due nobody is forcing you to be on this forum.

Saying "dumb" doesn't contribute to the discussion.

m

Title: Re: Solution for the 5V vs 3.3V problem
Post by: giants_fan3 on Dec 10, 2012, 04:01 pm
@CrossRoads:
Looking good -- That layout image of yours is just to show the orientation and not the actual level translation itself, yes? Have you looked into the GTL2000... or the TXB0108 would work too, although I believe the GTL2000 is significantly cheaper.
Title: Re: Solution for the 5V vs 3.3V problem
Post by: derekmjenkins on Dec 10, 2012, 04:19 pm
Yes, it was just to get the headers defined, to show that 2 sets of headers could be made to fit next to each other - males down to the Due, and females up to shields.
I think I'll slide the 2nd set over some more to make room for signals to be buffered in the middle area  and then go back out, especially in the double row area.
Are there many mega shields? Maybe just drop that area and make sure the 20 Uno IO + power + ICSP headers are supported. Need to beef up the power traces.

Crossroads
(with the system calling me "derekmjenkins" for some reason - hopefully just a test towards solving my week day log in problems)
Title: Re: Solution for the 5V vs 3.3V problem
Post by: OsuDan on Dec 12, 2012, 12:45 am
Hey guys,

I've been looking into something like this for a while as well. One thing that caught my eye was this pin converter shield for the UNO/Leo to go between the old pinout and 1.0

http://mayhewlabs.com/products/go-between-shield (http://mayhewlabs.com/products/go-between-shield)

Something like this could be implemented with logic converters between the connection points. This could also leads in some other interesting directions as well:


EDIT: Just read the post about the GTL2000 and it got me thinking there has got to be a chip that could route pins and shift logic levels... Yup.

http://www.intersil.com/en/products/audiovideo/video-switching/unbuffered-crosspoint-switches/CD22M3494.html (http://www.intersil.com/en/products/audiovideo/video-switching/unbuffered-crosspoint-switches/CD22M3494.html)

Thoughts?
Title: Re: Solution for the 5V vs 3.3V problem
Post by: graynomad on Dec 12, 2012, 01:56 am
Quote
Being able to select/designate individual pins as 5v or 3.3v logic

Needs a lot of hardware, in banks of 4, 6, or 8 not so bad.

A crosspoint switch would be one way to go, you'd need a lot for them and last I looked they were not cheap. Also I don't think they level shift but at least they should pass the analog.

As for the analog you can get programmable gain chips or just make your own with opamps.

Either way you need more IO to control this lot, so add 1 or 2 I2C IO expander chips with jumpers to set the address so they don't clash with any shields.

In general I like the basic concept but it could very quickly turn into a cluster f*ck with 30 chips that cost 2x the Due and the shield you want to use.

Crossroads (aka derekmjenkins!?), you've obviously made a start, any thoughts on doing something?

Quote
Are there many mega shields?

I don't think so, I'd drop the extra stuff and just go for a standard shield.

EDIT: I just looked at the price for that CD22M3494 crosspoint switch, it's not too bad but still too much for this I think.

______
Rob

Title: Re: Solution for the 5V vs 3.3V problem
Post by: CrossRoads on Dec 12, 2012, 02:19 am
I was thinking just TXB0108s or maybe a couple of GTL2000 for the bank of 18 header pins.
Bring the analog straight over, with TXB0108 in parallel, maybe a jumper to enable the OE/ when digital was required.
Or couple TXB0104s so analog/digital could be split up some.

Really stinks not being able to log in during the day except occasionally due to system conflicts or something.
Title: Re: Solution for the 5V vs 3.3V problem
Post by: graynomad on Dec 12, 2012, 02:25 am
Remember that the SPI pins are already 5v, they may need to be shifted the other way.

EDIT: I think I take that back, it's just the power pin that's 5v.

_____
Rob
Title: Re: Solution for the 5V vs 3.3V problem
Post by: CrossRoads on Dec 12, 2012, 05:30 am
TXB0108 & TXB0104 seem to work & fit pretty well.
One ground wire to clean up still.
Title: Re: Solution for the 5V vs 3.3V problem
Post by: OsuDan on Dec 12, 2012, 09:37 am

Quote
Being able to select/designate individual pins as 5v or 3.3v logic

Needs a lot of hardware, in banks of 4, 6, or 8 not so bad.

A crosspoint switch would be one way to go, you'd need a lot for them and last I looked they were not cheap. Also I don't think they level shift but at least they should pass the analog.

As for the analog you can get programmable gain chips or just make your own with opamps.

Either way you need more IO to control this lot, so add 1 or 2 I2C IO expander chips with jumpers to set the address so they don't clash with any shields.

In general I like the basic concept but it could very quickly turn into a cluster f*ck with 30 chips that cost 2x the Due and the shield you want to use.

Crossroads (aka derekmjenkins!?), you've obviously made a start, any thoughts on doing something?

Quote
Are there many mega shields?

I don't think so, I'd drop the extra stuff and just go for a standard shield.

EDIT: I just looked at the price for that CD22M3494 crosspoint switch, it's not too bad but still too much for this I think.

______
Rob




Hey Rob, got a solution for ya.

http://www.ti.com/product/sn74lvc16t245 (http://www.ti.com/product/sn74lvc16t245)  (I think there is a 32 channel unit as well)

Use something like this after a crosspoint switch and before exiting the shield. That way, each pin's output voltage can be selected and each pin can by dynamically assigned. Also, why do you think this would be too expensive? Mouser has the level shifter I just mentioned at $2 and the crosspoint at $4 or 6. Plus other parts and custom fab, you could almost surely get away under $20.

EDIT: Just thinking, you would just need the crosspoint for the pins that need to be moved like SCL and SDA, then just use a couple more of the level shifters I mentioned for the rest of the I/O. That way, the pins that might need to be moved can be, while all the pins can still be selected to be either 5v or 3.3v.
Title: Re: Solution for the 5V vs 3.3V problem
Post by: graynomad on Dec 12, 2012, 10:06 am
That's a nice chip, I was aware of it's cousin the 74LVC16245 but this is more flexible.

One "problem" is that it's a wide package it won't fit where Crossroads has the TXB chips but that's easily fixed.

Quote
each pin's output voltage can be selected
Are you suggesting


                       |---5v buffer
SAM---switch---|
                       |---3v3 buffer

That way you could select 5v or 3v3 for each pin but you'd have to double the headers wouldn't you?

If not can you provide a drawing.

Quote
Also, why do you think this would be too expensive?
I was referring to the crosspoint switch, they used to be quite expensive but I've just found it for $3.04 1-off so that's pretty good.

______
Rob
Title: Re: Solution for the 5V vs 3.3V problem
Post by: OsuDan on Dec 12, 2012, 11:26 pm
Hey Rob,

Here is what I'm thinking. This first drawing is a rough schematic for just the crosspoint section of pins. Other pins could be added to these and all the rest of the pins would need to be passed through 74LVC16245's as well.

(http://dl.dropbox.com/u/55783756/Photos/possible%20diagram.png)

Red trace is on bottom

Blue is on top

Black is on bottom (5v, 3.3v, gnd)

To answer you question about the pins, Mayhew Labs came up with a pretty nice solution.

http://dl.dropbox.com/u/55783756/Photos/go_between_shield_front%20(1).jpg (http://dl.dropbox.com/u/55783756/Photos/go_between_shield_front%20(1).jpg)

http://dl.dropbox.com/u/55783756/Photos/go_between_shield_back%20(1).jpg (http://dl.dropbox.com/u/55783756/Photos/go_between_shield_back%20(1).jpg)

As you can see, the headers don't go through the pcb, but are instead surface mounted. This way, we could have separate top and bottom circuits.


Dan
Title: Re: Solution for the 5V vs 3.3V problem
Post by: CrossRoads on Dec 13, 2012, 12:50 am
Here's the schematic & layout, please create a version with the parts you are suggesting.
Top & bottom mount surface mount headers would be one way to keep the physical board the same size, as long as its cut back from the USB header.
Title: Re: Solution for the 5V vs 3.3V problem
Post by: graynomad on Dec 13, 2012, 02:31 am
@OsuDan
At this stage a simple block diagram would be clearer, too many parallel lines for me to follow there.

_____
Rob
Title: Re: Solution for the 5V vs 3.3V problem
Post by: graynomad on Dec 13, 2012, 02:36 am
This is one way I see it working,

(http://www.robgray.com/temp/due-converter-shield.png)

It would need the above for every 8 pins you wanted to handle, but if you stick to the standard shield (not Mega) that's only 3x the above I think.

Bear in mind that some control circuitry would be required as well.

XPS = crosspoint switch
BUF = buffer, probably TXB0108

______
Rob
Title: Re: Solution for the 5V vs 3.3V problem
Post by: GorillaBuilderz on Dec 13, 2012, 05:34 am
Also take a look at our http://playground.arduino.cc/GorillaBuilderz/LeoShield (http://playground.arduino.cc/GorillaBuilderz/LeoShield) which is another pin adaptor.

Dale
www.GorillaBuilderz.com (http://www.GorillaBuilderz.com)


Hey guys,

I've been looking into something like this for a while as well. One thing that caught my eye was this pin converter shield for the UNO/Leo to go between the old pinout and 1.0

http://mayhewlabs.com/products/go-between-shield (http://mayhewlabs.com/products/go-between-shield)

Something like this could be implemented with logic converters between the connection points. This could also leads in some other interesting directions as well:

  • Being able to select/designate individual pins as 5v or 3.3v logic

  • Integrating dynamic pin assignment so the pinout could be adaptable to older shields configurations

  • And if you really wanted to get crazy, you could even wire the whole thing up to be driven by an integrated IC so you just add a library to your sketch and assign the pinout and voltage in software.

  • And since I've already gone way out in left field, to complete the prefect conversion shield, add either an IC to linearly scale the analog inputs or a separate 5v 12 or 16 bit ADC



EDIT: Just read the post about the GTL2000 and it got me thinking there has got to be a chip that could route pins and shift logic levels... Yup.

http://www.intersil.com/en/products/audiovideo/video-switching/unbuffered-crosspoint-switches/CD22M3494.html (http://www.intersil.com/en/products/audiovideo/video-switching/unbuffered-crosspoint-switches/CD22M3494.html)

Thoughts?
Title: Re: Solution for the 5V vs 3.3V problem
Post by: OsuDan on Dec 14, 2012, 10:31 am
Ok so here's the diagram of the circuit as I see it. Let me know what you guys think

Circuit for pins who's position might need to be changed

(http://dl.dropbox.com/u/55783756/Photos/crosspointIncluded.png)

And here is for the other pins who's position is fixed

(http://dl.dropbox.com/u/55783756/Photos/NoCrosspointIncluded.png)

For both the CD22M3494 (crosspoint) and the SN74LVC16T245 (logic shifter) I think the buses can be 16 bit wide. As for going with the SN74LVC16T245 over the TXB0108, the advantage I see is that with the SN74LVC16T245, you can select each pin's output so some pins could interface with 5v logic, while others with devices at 3.3v. Might as well keep the shield dynamic as we can, especially if things really are moving towards 3.3v logic. Just my two cents, what's your guys reaction?


Dan
Title: Re: Solution for the 5V vs 3.3V problem
Post by: graynomad on Dec 14, 2012, 11:04 am
Quote
the advantage I see is that with the SN74LVC16T245, you can select each pin's output

I can't see where the data sheet says this is possible, apart from two OE and two DIR pins there are no control signals.

______
Rob
Title: Re: Solution for the 5V vs 3.3V problem
Post by: swseansw on Dec 17, 2012, 06:20 am

Here's the schematic & layout, please create a version with the parts you are suggesting.
Top & bottom mount surface mount headers would be one way to keep the physical board the same size, as long as its cut back from the USB header.

I tried the TXB0108 and finally gave up.
The blue boxes in the attached picture contain 3 pcs pf TXB0108.
I made the beta board and tested it.
While I test the TXB0108 5V output with voltmeter, the voltage is 3V.
However, I test it with oscilloscope, the output is 5V. I touch the wire or chip with my finger, the voltage became unstable.
Well, I think, the TXB0108 is easy to go into self-excited oscillation process. And the load capacity is small. If I connect other devices to it through long cables, such as a digital sensor, the output may have problem. However, if I intert the sensor in the header of the beta DUE board directly, it works fine.
I tried many time but still didn't success.
Not sure if the TXB0108 performs not good enough.
Title: Re: Solution for the 5V vs 3.3V problem
Post by: OsuDan on Dec 17, 2012, 10:54 am

I can't see where the data sheet says this is possible, apart from two OE and two DIR pins there are no control signals.

______
Rob


Hey Rob,

Guess I had an optimistic read on that datasheet, you are right. Here is my solution.

(http://dl.dropbox.com/u/55783756/Photos/crosspointIncludedWithMux.png)

With the setup, each pin can be selected as 3.3v or 5v through the MUX, then routed through the logic shifter if it is 5v. After that, the crosspoint handles the pin reassignment if needed. How about this? We getting close?

Dan
Title: Re: Solution for the 5V vs 3.3V problem
Post by: graynomad on Dec 17, 2012, 05:13 pm
I assume that all the data busses are 8 bits. I don't get how the Logic shifter has bi-directional signals. What's on the 3v3 side?

TBH I'm treating this as an academic exercise because it's interesting, personally I really can't see much use for such a complex shield but I'm happy to help with a design if you do.

_____
Rob
Title: Re: Solution for the 5V vs 3.3V problem
Post by: ogre on Dec 20, 2012, 07:31 am
I have not looked at the circuits to evaluate....but i want one of these!
Title: Re: Solution for the 5V vs 3.3V problem
Post by: graynomad on Dec 20, 2012, 08:00 am
Quote
i want one of these!

Maybe there is a market after all, I always was 180 degrees out of phase with the consumer :)

Dan, my last question? How does the logic shifting circuit have bi-directional IO?

_____
Rob
Title: Re: Solution for the 5V vs 3.3V problem
Post by: ogre on Dec 21, 2012, 11:19 am

Maybe there is a market after all, I always was 180 degrees out of phase with the consumer :)

Dan, my last question? How does the logic shifting circuit have bi-directional IO?
_____
Rob


I would say if there is a market for the Due - then there is a market for this shield.  To choose the Due over the raspberry pi the main feature is the general purpose IO and the existing shields.  But to use either of these such a board is extremely useful.

Not only would a significant percentage of Due purchasers want such a shield- there would also be a market of people who current do NOT choose a Due to to shield incompatibility!


Title: Re: Solution for the 5V vs 3.3V problem
Post by: graynomad on Mar 22, 2013, 02:59 am
I just thought I'd resurrect this thread because I now have a good reason to actually do something like this.

Did anyone take this any further?

Going back to something I missed in the original post by giantsfan3

Quote
the above level-translator IC based solution should work bi-directionally, for all signal types (digital I/O, PWM, analog lines, Serial, SPI, I2C),


Does the GTL2000 pass analog OK, it's only a few FETs so I would assume so but haven't tried it.

______
Rob

Title: Re: Solution for the 5V vs 3.3V problem
Post by: JChrispy58 on Mar 22, 2013, 04:42 pm
I posted the question of how I can convert my 5 volt output from the hall effect sensors to a 3.3 volt output that the due can read.  I posted this in another forum.

I've been looking at these low voltage translators and I don't think I can use these. 

I want the 3.3 volts to change linearly as the 5 volt changes...ie when I am getting 2.5 volts from the sensor the arduino should be reading 1.65 volts.

I'm not sure if I should just use a voltage divider because I'm concerned with accuracy to a certain degree.

Could you please help me out...this is for my senior design project.
Title: Re: Solution for the 5V vs 3.3V problem
Post by: graynomad on Mar 22, 2013, 06:12 pm
Quote
I don't think I can use these

Probably not, I can't see that they are linear.

Quote
I'm not sure if I should just use a voltage divider because I'm concerned with accuracy to a certain degree.

A voltage divider is the easiest and probably the best way to do this. I see no reason to think there would be accuracy problems if you use good resistors.

______
Rob
Title: Re: Solution for the 5V vs 3.3V problem
Post by: bobcousins on Mar 23, 2013, 01:00 am
Just for interest, here is a board I am working on to interface Due to a 3D printer controller (RAMPS) (http://reprap.org/mediawiki/images/thumb/3/33/RAMPS-RIB-Front.jpg/800px-RAMPS-RIB-Front.jpg)

http://reprap.org/wiki/File:RAMPS-RIB-Back.jpg
http://reprap.org/wiki/File:RAMPS-RIB-Assembly.jpg

It is application specific, I am using TXS0108 to adapt some signals, with some gate drivers for MOSFETS.

I had trouble finding connectors with the same height, but they seem to connect ok.

Source files on github https://github.com/bobc/bobc_hardware/tree/master/RAMPS-FD
Title: Re: Solution for the 5V vs 3.3V problem
Post by: graynomad on Mar 23, 2013, 05:00 pm
Thanks for that Bob, looks interesting.

FWIW I think I've found a way to do this with very good compatibility for all/most shields.

BTW, nice Due pinout diagram you have there :)

______
Rob
Title: Re: Solution for the 5V vs 3.3V problem
Post by: JChrispy58 on Mar 25, 2013, 03:58 pm
Looks like i'm using a voltage divider....Thanks Rob for your help.
Title: Re: Solution for the 5V vs 3.3V problem
Post by: Louis90 on Nov 04, 2014, 05:40 pm
Hello, read through those comments and is amaze with it. But i still got doubt. Please help me. Im so wan the 12 bit PWM provided by the I/O pins from this arduino due. But my concern are:
1. whether those logic level converter IC  can work this 12 bits PWM? because im doing with hall sensor geared motor, worry that the accuracy will be affected.
2. is those bi-directional converter? means if i attach all the digital pins to the converter, can i read/write data as other arduino board?
3. can those work with analog pins?
Title: Re: Solution for the 5V vs 3.3V problem
Post by: muqthyar on Aug 17, 2015, 06:35 am
Guys please check the level translator from below link

http://www.tenettech.com/product/3263/bi-directional-logic-level-converter
Title: Re: Solution for the 5V vs 3.3V problem
Post by: zhivkec on Sep 19, 2015, 10:15 pm
I find this shield very usable. I would like to use it as interface for drivers of stepper drivers. These drivers require 5V, and arduino due can output only 3.3V.

So where is this "way to do this with very good compatibility for all/most shields"?
Schematic? Pcb ?

Can this shield be bought somewhere already? It's old post...

OK I found this guy: https://digistump.com/wiki/digix/tutorials/levelshifter (https://digistump.com/wiki/digix/tutorials/levelshifter)

http://digistump.com/products/51 (http://digistump.com/products/51)
I see it costs 14$ in USA, but i'm from Europe, can somebody suggest me similar shield and to be able to buy it here in old continent :) ?

regards,
Thanks for that Bob, looks interesting.

FWIW I think I've found a way to do this with very good compatibility for all/most shields.

BTW, nice Due pinout diagram you have there :)

______
Rob
Title: Re: Solution for the 5V vs 3.3V problem
Post by: graynomad on Sep 20, 2015, 02:00 am
Sorry zhivkec but that was 2.5 years ago, I have no idea what I was referring to at the time.

I do remember having a complicated design that required MUXes and analogue switches, but this is pre history to me these days.