Serial.swap() only for RX?

rin67630
Posts: 138
Joined: Sun Mar 11, 2018 5:13 pm

Serial.swap() only for RX?

Postby rin67630 » Fri Dec 01, 2023 7:08 am

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.

hobby_guy
Posts: 20
Joined: Sat Jan 29, 2022 3:29 pm

Re: Serial.swap() only for RX?

Postby hobby_guy » 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 :)

rin67630
Posts: 138
Joined: Sun Mar 11, 2018 5:13 pm

Re: Serial.swap() only for RX?

Postby rin67630 » Fri Dec 01, 2023 6:48 pm

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.

hobby_guy
Posts: 20
Joined: Sat Jan 29, 2022 3:29 pm

Re: Serial.swap() only for RX?

Postby hobby_guy » 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.

rin67630
Posts: 138
Joined: Sun Mar 11, 2018 5:13 pm

Re: Serial.swap() only for RX?

Postby rin67630 » Sun Dec 03, 2023 2:53 am

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.

hobby_guy
Posts: 20
Joined: Sat Jan 29, 2022 3:29 pm

Re: Serial.swap() only for RX?

Postby hobby_guy » 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

rin67630
Posts: 138
Joined: Sun Mar 11, 2018 5:13 pm

Re: Serial.swap() only for RX?

Postby rin67630 » Fri Dec 15, 2023 12:12 pm

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

Who is online

Users browsing this forum: No registered users and 71 guests