I am looking to interface a 3.3V device with a 5V one. This will require the shifting of the logic levels between the two devices.
Doing this in one direction is a trivial matter, but I need to do it in both directions (reading and writing – it's a data bus).
I know there are bus drivers that can do this but I'm a skinflint, so I'm looking to see if I can do it with the discretes I have at my fingertips.
I came up with this circuit:
I don't know if it will actually do what I want, but from reading other sources (including Is it possible to drive TTL inputs from 3.3v microcontroller and Bi-Directional Step up and Step down (3.3v <-> 5, etc) [the latter mentions a sparkfun tutorial that no longer exists]) it might.
My thinking is, data from 5v to 3.3v goes through D2 and the series resistor R2 to drop the voltage. Data from 3.3v to 5v goes through D1 and gets pulled up by R1.
Would this work? Is it complete gibberish?
Ok, so we have agreed that circuit is total gibberish.
I have made some tweaks, and come up with this:
Playing around with my scope gives me levels of around 1V-4V on the +5V side, and 0V to 3V on the 3.3V side. Both sides default to a high level and connecting to ground on one side causes a low level on the other side.
The resistors are all 10KΩ, and I have had both ends feeding through 100KΩ resistors to simulate some form of load. The diodes are all Schottky.