-->
Page 2 of 2

Re: how to make Serial.swap() working

PostPosted: Fri Jun 18, 2021 4:03 am
by bdepauw
Is the combination of both also possible :
- swapping UART0 : TX0 GPIO 1 and RX0 GPIO 3 to GPIO15 (TX) and GPIO13 (RX)
- remapping UART1 TX pin GPIO 2 to pin GPIO 1 ? ( so UART1 uses the USB chip)

So here I would use the (4) pin set from UART0 for both UARTs

Why I would do this :
- need to use a hardware serial port to read (only) incoming data at 115200 (@ 3.3V)
- like to use the build-in USB chip to monitor to computer (only data out from ESP8266 to PC )

Re: how to make Serial.swap() working

PostPosted: Fri Jun 18, 2021 6:09 am
by QuickFix
Unfortunately not; this is one of the lesser handy properties of the ESP8266. :(

Image

The ESP8266 doesn't support remapping, only swapping (using the functions in the table above); the ESP32, however, does support remapping and even has three UART controllers.

You can swap UART0 from (TX/RX) GPIO1/3 to GPIO15/13, but of UART1 only TX (GPIO2) can be used, since the GPIO for RX is used by the flash memory and cannot be swapped.

For a more in-depth description, please read this topic in the Arduino-ESP8266 reference manual. :idea:

Re: how to make Serial.swap() working

PostPosted: Sat Jun 19, 2021 10:56 pm
by katesimon123
This delay problem comes with every Serial command .... why don't they just fix it in the library ??? Simply add polling or interrupt to check for serial data.