Use this forum to chat about hardware specific topics for the ESP8266 (peripherals, memory, clocks, JTAG, programming)

User avatar
By Karstonn
#42402 Hello,
(2nd try, the page at my first draft)

Haven't found the info here or elsewhere, so:

I want/need to connect a serial interface/sensor that is fixed at 7E1(9600) to the ESP for accessing the values via webpage.

As i understand the datasheet, althouh UART1 is defined, and even pins assigned for both TX and RX,
RX cannot be used as it is in concurrent use for memory access, correct?

Q1: Can that be changed?
(I read about setting pin-functions, but a) am not sure how to do that yet and b) is it possible at all if i need the memory?)

If not, i could use UART0 of course, but:

Q2: If i change UART0 to 7E1, can the chip still be flashed?
( cause i did not find any settings for changing the flasher to 7E1)
Or:
Q3: Does the bootloader revert to 8N0 in flash-mode? Then i would be safe!
It is a cheap chip, but i don't want to brick it nonetheless.

or finally:
Q4: Has anyone used Softserial on another pin successfully, and with 7E1?
That would avoid the above problems altogether.


Thanks for listening and hoping for help or pointers in the right dircetion.

Karstonn
User avatar
By martinayotte
#42421 For Uart0, Yes, the settings is done at run-time when the Serial is initialized by your firmware, and No, it doesn't affect the Bootloader which will re-initialize it as 8N1 to upload new firmware.
For Uart1, it has TX only, no RX. What do you means by "if i need the memory", Serial port has nothing to do with memory.
For Softserial, although I've never use it on ESP, it is working, but limited to <=9600 baudrate.
User avatar
By Karstonn
#42479
martinayotte wrote:For Uart0, Yes, the settings is done at run-time when the Serial is initialized by your firmware, and No, it doesn't affect the Bootloader which will re-initialize it as 8N1 to upload new firmware.
Then all is well. i had hoped/expected that to be true but didn't want risking it just in case.

martinayotte wrote:For Uart1, it has TX only, no RX. What do you means by "if i need the memory", Serial port has nothing to do with memory.


Well, the ESP8266-datasheet explicitly mentions pin 23 (IO8) as RX1 (on page 21 of 31) in the table :
UART1
GPIO2 14 IO2 U1TXD
SD_D1 23 IO8 U1RXD
(So its apparently also used for SD_D1)
But directly below it says:
Since UART1 features only data transmit
signal (Tx), it is usually used for printing log.


In this page i found
Digital pins 6—11 are not shown on this diagram because they are used to connect flash memory chip on most modules. Trying to use these pins as IOs will likely cause the program to crash.
[...]Serial1 uses UART1, TX pin is GPIO2. UART1 can not be used to receive data because normally it's RX pin is occupied for flash chip connection.
which confirms it.

BUT: In the wiki halfway through THIS page it mentions setting pin-functions and shows a table, that basically says, that pin 23 is shared for: SD-Data1, SPID, GPIO8, and U1RXD !

Thats why i understood it COULD be possible to actually USE RX1 after all, if the function SD-D1 was not needed, which it apparently is for accessing external flash-memory.


Thats not important anymore for me if i can use UART0, but might be interesting for other projects.

Regards,
Karstonn
User avatar
By martinayotte
#42480
Karstonn wrote:Thats why i understood it COULD be possible to actually USE RX1 after all, if the function SD-D1 was not needed, which it apparently is for accessing external flash-memory.


Effectively, but SD-D1 is required to access the flash in both DIO and QIO mode. The only way to free up the pin would be that have the flash in SIO (single i/o with SD-D0), which I doubt we can.