Page 1 of 1
Serial.swap() only for RX?
Posted: Fri Dec 01, 2023 7:08 am
by rin67630
Does a solution exist on the ESP8266 to perform a Serial.swap only for Rx?
I am short on pins and need GPIO15 for another purpose.
Re: Serial.swap() only for RX?
Posted: Fri Dec 01, 2023 10:06 am
by hobby_guy
You can repurpose the RX and TX pins independently:
https://arduino.stackexchange.com/quest ... -gpio-pins
In my project, using ESP-1 (which only exposes/breaks out GPIO0 and GPIO2), I have remapped RX (GPIO3) as an output. This allows me to still use Serial.println for debugging. Also, interestingly, it still works to flash the device even when there is a resistor and an LED connected to the RX pin
Re: Serial.swap() only for RX?
Posted: Fri Dec 01, 2023 6:48 pm
by rin67630
hobby_guy wrote: ↑Fri Dec 01, 2023 10:06 am
You can repurpose the RX and TX pins independently:
https://arduino.stackexchange.com/quest ... -gpio-pins
In my project, using ESP-1 (which only exposes/breaks out GPIO0 and GPIO2), I have remapped RX (GPIO3) as an output. This allows me to still use Serial.println for debugging. Also, interestingly, it still works to flash the device even when there is a resistor and an LED connected to the RX pin
That appears to be specific to the ESP-1
With the ESP-12 I'm not aware of another repurpose instruction.
Re: Serial.swap() only for RX?
Posted: Sat Dec 02, 2023 9:30 am
by hobby_guy
I would expect it works on the ESP8266 chip, regardless of breakout board... As far as I know, it's the same chip on all the 8266 breakouts? Did you try it on the ESP-12? Would be interesting to hear if it works. I could try it on an Adafruit Huzzah 8266.
Re: Serial.swap() only for RX?
Posted: Sun Dec 03, 2023 2:53 am
by rin67630
hobby_guy wrote: ↑Sat Dec 02, 2023 9:30 am
I would expect it works on the ESP8266 chip, regardless of breakout board... As far as I know, it's the same chip on all the 8266 breakouts? Did you try it on the ESP-12? Would be interesting to hear if it works. I could try it on an Adafruit Huzzah 8266.
That appears to liberate the TX pin for use as a GPIO
only if you never uses any Serial() or Serial.read() command.
But I need to read from Serial. Just don't need to TX.
Re: Serial.swap() only for RX?
Posted: Tue Dec 05, 2023 7:52 am
by hobby_guy
Well, in my case, I use the RX pin as a third GPIO (the ESP-1 is a very small breakout). Point is, I can still use TX pin to transmit serial at the same time
Re: Serial.swap() only for RX?
Posted: Fri Dec 15, 2023 12:12 pm
by rin67630
hobby_guy wrote: ↑Tue Dec 05, 2023 7:52 am
Well, in my case, I use the RX pin as a third GPIO (the ESP-1 is a very small breakout). Point is, I can still use TX pin to transmit serial at the same time
That is the opposite.
I just would want to liberate the TX pin that is not used and pulled up with 470 Ω, which draws quite a respectable quantity of energy