I'm thinking that the output of an esp8266 can upshifted to drive a 5v device input with a simple series diode and resistor to a 5 V supply. That would mean the esp8266 would see about 4.4v on it's output pin. Supposedly the esp8266 pins are 5V tolerant so I assume this is workable.
I know it's not the best solution, but I am low on PCB space and I think I can squeeze this in. I'd probably use a 10k pullup with the diode as the switching frequency is below 1000hz.
Wow, thanks everyone for the replies. I’ll try and answer all of the questions raised in this note.
The minimum high level for the chip I’m driving is 3.15v, maximum low level is 1.35v.
There are 3 inputs that I have to drive.
The chip is a stepper motor driver and is described as a CMOS device and the only input impedance spec I could find says max 20ua leakage.
It’s not really for hobby use, there will be maybe 20 or so units made for other people.
I’m not sure what the “DOA” comment refers to.
I have been driving this chip on a couple of devices without any level shifting for about 4 years. Lately I’m seeing some intermittent operation that I’m guessing is related to the poor driving logic level voltages. I am aware of logic level chips that can handle multiple channels and can save space for many circumstances. However, these chips necessarily concentrate a lot of circuit tracks to themselves. In my already crowded PCB design that would be tough to accommodate. Alternatively diodes and resistors can be distributed over some small existing spaces and they can bridge over existing tracks to some extent.
I suppose the primary issue depends on the supposed fact that the esp8266 chips are indeed 5v tolerant. Are there any other issues?
Thanks,
Frank
BTW, I found this suggestion below that clamps the voltage seen by the esp8266 at maybe 3.9v. But it requires another diode that I would like to avoid.
Shall we have a look at it? The best solution really would be to properly shift up to 5V logic level. Several suggestions have been offered in this thread already. They don't take up much space. Odds are there's some space that can be made on your board by optimizing the design a bit.
Ok, you guys have convinced me to do it right. I think I’ll try Wawa’s mosfet technique as that also only uses two components.
My big problem is my poor knowledge of PCB design tools so keeping changes to a minimum is desirable. Not to mention soldering some of the small surface mount IC’s is a challenge for my old eyesight.
I’ll keep some of the other suggestions in-mind for any future new designs. BTW, there seems to be a lot of credible message board chatter that the esp8266 I/O is 5V tolerant, but it’s not clear if that applies to output or if it’s just input pins. Anyway if the datasheet doesn’t say that I guess it should be avoided.
Here’s a diagram from Microchip’s tips and tricks pdf that looks like Wawa’s solution. I’ll have to see if I have an appropriate mosfet.
Some CEO had mentioned on facebook that they are that statement has been retracted. They are not, they may break, as far as i can tell it's mainly exposure to 5v while in output mode and HIGH (3.3v) even with current limitting resistors. But if you want to minimize chances of something breaking (and i've thrown quite a few of them) Avoid 5v exposure at all times. The datasheet is quite clear about it being a maximum of Vcc + 0.3v as a maximum.
What is 'credible message board chatter' anyway ?
That is always a challenge, but thank the lord for magnifying glasses.
First I’ll look through my supply of small signal Mosfets and hope one of them satisfy’s the specs I need. Otherwise there were a couple of Mosfets mentioned on this thread that I’ll look to buy.
As requested, here is my PCB layout. I use EasyEda which I found to be quicker to learn then others I looked at. I still struggle as may be evident in the layout below. I'm not sure if anyone can make sense of this layout, but you asked for it. The level shifting involves the pins in the lower left side where the stepper driver IC (U5) is mounted on the back side of he PCB.