User avatar
Doctorwho8
Posts: 56
Joined: Mon Dec 31, 2012 11:00 pm
Location: Astoria NY
Contact: Website

Logic and the GPIO

Mon Oct 12, 2015 10:50 pm

Hello!
I'm busy working on a project that uses TTL logic As I recall from a discussion elsewhere, the Pi (all of them) runs on 3.3 Volt logic and as such the GPIO connections require specialty methods to translate from one to the other.

(Author Don Lancaster describes a method in one of his books on how to interface 5 Volt logic, that is in his discussion, both CMOS at 5 Volts, and TTL (which always runs at 5 Volts) to CMOS logic at 3 Volts. Oddly enough the parts to do it were then originally made by RCA, they are now available from TI, and the part number is CD4041UB.)

Would such a method do that for the PI? In a nod to the announcement of 10/07/2015 regarding the new Scratch programming language I've decided that instead of using one of the other platforms here, it be running on the Pi and using (new) Scratch for the language. :mrgreen:

Incidentally my first hardware project involved Mono and a library written especially for the job.
-------------------
Gregg
Doctor Who8

User avatar
mahjongg
Forum Moderator
Forum Moderator
Posts: 12327
Joined: Sun Mar 11, 2012 12:19 am
Location: South Holland, The Netherlands

Re: Logic and the GPIO

Mon Oct 12, 2015 10:56 pm

sorry, but IMHO the CD4041UB cannot be used as a level converter, it is also not designed as such to convert between 3V3 and 5V logic. The simple fact is that when powered with 5V the inputs of the device must be raised above 4V, to be reliable recognized as "high".
there are probably more suitable IC's than can do the feat, but not this IC.

User avatar
Doctorwho8
Posts: 56
Joined: Mon Dec 31, 2012 11:00 pm
Location: Astoria NY
Contact: Website

Re: Logic and the GPIO

Tue Oct 13, 2015 12:53 am

mahjongg wrote:sorry, but IMHO the CD4041UB cannot be used as a level converter, it is also not designed as such to convert between 3V3 and 5V logic. The simple fact is that when powered with 5V the inputs of the device must be raised above 4V, to be reliable recognized as "high".
there are probably more suitable IC's than can do the feat, but not this IC.
Perhaps.
Can you suggest otherwise? And can you (or anyone here) suggest an appropriate chip in a DIP16 format? (Or a DIP14 one.) :roll:
-------------------
Gregg
Doctor Who8

klricks
Posts: 6609
Joined: Sat Jan 12, 2013 3:01 am
Location: Grants Pass, OR, USA
Contact: Website

Re: Logic and the GPIO

Tue Oct 13, 2015 5:17 am

These are not in DIP format but maybe you can Google for a data sheet and see if the chip is made in DIP format.
https://www.sparkfun.com/products/12009
https://www.adafruit.com/products/395
Unless specified otherwise my response is based on the latest and fully updated Raspbian Buster w/ Desktop OS.

User avatar
Doctorwho8
Posts: 56
Joined: Mon Dec 31, 2012 11:00 pm
Location: Astoria NY
Contact: Website

Re: Logic and the GPIO

Tue Oct 13, 2015 5:43 am

klricks wrote:These are not in DIP format but maybe you can Google for a data sheet and see if the chip is made in DIP format.
https://www.sparkfun.com/products/12009
https://www.adafruit.com/products/395
Hello!
As it happens whilst writing the post that started us off, I needed to confirm my musings, and that brought me to the TI site. There I came across the original part number. As it happens the second one, from our friends at Adafruit has made into a breakout board, I looked at it, initially I wasn't interested in the chip alone, because as it happens the current PCB building interest is towards SMT parts, hence that one's layout on a breakout board base.

However I will grant you that the second one is a good selection. The page also contains several suggestions. Including one for the I2C bus also supported on the Pi. Meanwhile I shall consider it greatly and get back to all of you.
-------------------
Gregg
Doctor Who8

User avatar
mahjongg
Forum Moderator
Forum Moderator
Posts: 12327
Joined: Sun Mar 11, 2012 12:19 am
Location: South Holland, The Netherlands

Re: Logic and the GPIO

Tue Oct 13, 2015 9:34 am

There are gazillions of level shifter IC's these days, a ten second search at Farnell brought up 417 of them.
http://uk.farnell.com/webapp/wcs/stores ... reId=10151

take your pick.

User avatar
Doctorwho8
Posts: 56
Joined: Mon Dec 31, 2012 11:00 pm
Location: Astoria NY
Contact: Website

Re: Logic and the GPIO

Tue Oct 13, 2015 1:34 pm

mahjongg wrote:There are gazillions of level shifter IC's these days, a ten second search at Farnell brought up 417 of them.
http://uk.farnell.com/webapp/wcs/stores ... reId=10151

take your pick.
Hello!
Ah, but I'm based in the US not in the UK or in the Netherlands.
I'm leaning towards the two of them from Adafruit. Oddly enough both Sparkfun and a local outfit Tinkerkit complete with a website here http://tinkerkit.com are selling much the same thing.

Interestingly enough, the same device was used by an individual described here http://playground.arduino.cc/Main/Inter ... are#Output and then in much greater detail here:
http://codeandlife.com/2012/12/27/raspb ... mi-shield/ .

Originally I had an idea along his lines. That of having the Raspberry Pi work with the Arduino to display on a regular HDTV set what the Arduino is thinking. The problems surfaced when I realized it was the software on the Arduino which did in the original idea. So I put it aside.

Now I'll probably start with the FET based ones for starters, but if this one moves along and gets more involving, it will probably use the specific chip design that Adafruit came up with as a second.

Thank you folks.
-------------------
Gregg
Doctor Who8

User avatar
mahjongg
Forum Moderator
Forum Moderator
Posts: 12327
Joined: Sun Mar 11, 2012 12:19 am
Location: South Holland, The Netherlands

Re: Logic and the GPIO

Tue Oct 13, 2015 3:36 pm

Doctorwho8 wrote: Ah, but I'm based in the US not in the UK or in the Netherlands.
Doesn't matter, just use the site to search for the optimal IC, then buy the actual IC elsewhere.
You can also do exactly the same kind of search at Digi-Key, and they are in the USA.
You can also use these sites to get datasheets.

BTW. A colleague of mine has had great success with the SN74LVC2T45DC, especially as it can go very low, as low as 1.65V is no problem. It also has a direction signal, which is much safer (if you can use it) than using an auto-detect system.

Note, I'm approaching this as a professional developer, for hobby stuff you can use the solutions offered by adafruit (not that I have anything against adafruit, they are, she is, great!).

Return to “Interfacing (DSI, CSI, I2C, etc.)”