Connecting RX/TX to another MCU
David Betz
Posts: 14,516
in Propeller 1
I want to connect a Sparkfun ESP8266 Thing Dev module to a Quickstart module and want to make sure I don't fry anything. I'm powering the Quickstart from the +5V output of the ESP8266 module and that seems to work fine. However, I also need to connect the Propeller TX, RX, and RESn pins to GPIO pins on the ESP8266. I'd like to use a series resistor to prevent issues if I for some reason end up driving the connection from both ends at the same time. (My programs never work correctly the first time!) What value resistor should I use?
Comments
On the totally unscientific basis that it will limit current to 15mA and that ought to be good enough to prevent damage.
What is the max output current of an ESP8266 pin?
No resistor in series on the RESn pin.
https://nurdspace.nl/ESP8266#Specifications
It says that the maximum current is 12mA.
After going through the "what resistor to use for 5V inputs" discussion several times on the forum I have gone from 1K to 2.7K, 3.3K, 3.9K, and am now using 4.7K. I have never damaged a pin using the lower values but that may just be luck. The 4.7K (and occasionally 10K when I was out of 4.7K) have worked quite well for interfacing propeller, Pi, Odroid, and various interface hardware up to 2.5MHz clock speed.
True, but 4.7K also works for 5V <> 3.3V and 3.3V <> 2.5V as well, and with lower currents through the clamping diodes, which is always a good thing. Also reduces the number of components I need to stock.
The idea here is that if both ends of the line are being driven, one high and one low, we want to limit the resulting current between them so that nothing blows. If we know what the pins in question can safely sink/source then Ohms law tells us what we need.
Example, 3.3v devices, max 10ma, R = V / I = 330 ohms.
As that is the max current then that is the minimum resistor value we would use.
One could err on the side of caution and decide that 5ma is the worst we want to see. Then 680 ohms would be the choice. Or 1ma and 3.3K ohms.
But, get too cautious and all that resistance is going to cause communications to fail, especially at high frequencies. How high would the resistance be to cause a problem? No idea. Never pushed it up that way.
Things are different when mixing 3.3 an 5 volt devices. Then we have to worry about the 5v device pushing current through the input protection diodes of the 3.3v device and popping them. Anyway we certainly don't want the 5v input overcoming the 3.3v devices power supply and effectively powering it with 5v through the pin.
I have never heard a hard and fast rule for series resistor selection. There is a wide range that will do the job. Too low does nothing, too high and comms might start to fail. Except we know there is a hard limit on the low value end of the range.
Normally it comes down to whatever is to hand at the time