Post topics, source code that relate to the Arduino Platform

User avatar
By ArnieO
#9625 I am using the resistor/diode setup in the first post here, and it has worked like a charm all the time, tested up to 115 200 baud. Before that I used only a resistor voltage divider, no problems there too.

I think many that have issues with these solutions in reality have a power supply issue. If the reisistors are too small they will draw quite a bit of current.

Connecting a 3.3V unit lime the ESP to a 5V unit like the Arduino Uno is like taking your Sunday stroll along the middle line of a road with traffic. You might get away with it without problem, but that does not mean it's a good idea.

Solutions that are inherently wrong but "seem to work OK" have a tendency to lead to endless hours of debugging later - when some time has passed, some components' parameters have drifted and settled after aging a little ("initial burn-in") - and you have forgotten that little "dirty trick" solution you chose. ;)
User avatar
By oxijin
#10444 I like to use 74AHC series logic ICs rather than fets or transistors. They're cheap, fast and precise, and I always end up finding a use for the unused gates. Almost everyone who uses logic uses the 74HC4050 buffer. This and the 74HC4049 inverter are unusual devices in the HC series as these two are specially designed exceptions within the family that tolerate input voltages in excess of the supply voltage. But the entire 74AHC logic family can tolerate 5V inputs when using 3.3 V (or another low voltage) for the supply. That allows you to select a device with AND, OR, NAND, NOR, XOR, Buffer or Inverter gates that often come in handy as your project evolves.

I especially like to use NAND gates like the SN74AHC132. When implementing "sum of products" logic, i.e. functions like

(A AND B) OR (C AND D)

this can be done with only NAND gates. You don't need both AND gates and OR gates. This is because you can effectively move the output inversion "dot" on the first stage NAND gates to the inputs of the second stage NAND gates. When you invert both the inputs and the output on an AND gate, you turn it into an OR gate. Similarly, when you invert both the inputs and the output on an OR gate, you turn it into and AND gate. Think about it. It's also simple to use a NAND gate as an inverter. So basically, you can implement any logic function from NAND gates. Depending on whether the majority of your signals are positive (true when high) or negative (true when low) logic, you can apply the same principles with NOR gates.

You can't build more complex logic out of inverters or buffers like the 74HC4049 or 74HC4050. The upside of inverters or buffers though is that if you need lots of level shifting and no other logic, you get more level shifters per IC.

Finally, you need to be careful with transistor and FET based approaches when the data rate gets high, as is the case with SPI and also with UARTs when the baud rate is very high, since the rise times with these approaches can be slow and the waveforms can be kind of cruddy.

You can search for 74AHC logic at Digikey. Once you know what part number you're interested in, you can find the best price using findchips.com.
User avatar
By GengusKahn
#10450 This may be a silly question but at <£3 each have you tried nothing, I am running a PL230 USB serial no converter but a 3V Ldo btween the 5v and ESP Vcc I have been using this and a CP2102 at 5v Logic(with 3v LDO for power) for 3 weeks.........
I deliberately took one to its limit - 5.9v above which PERMANENT damage occurs (it FRIES), because I was having all sorts of problems with commercial and home made logic converters.