-->
Page 1 of 1

How to generate BREAK-Signal on UART?

PostPosted: Mon Jan 16, 2017 8:42 am
by espenlaub
Hello,
i'm really new to ESP programming. Also my programming skills are limited, so don't blame me, if my questions are dump/stupid or whatever :-)

I found esp-link to fit my needs for a serial/wifi/vcp bridge for a serial device. My problem is, that my device needs to be "waked up" by a BREAK, which is a sequence of 25ms TX low, followed by a 25ms TX high phase. After that the device is ready to receive data, which should follow immediately.

Now, i wonder how to implement this break. I think(!) it should be in this order:
1. receive command to generate the break (extend the RFC2217 support of esp-link, which i can manage myself) and jump to a command subroutine.
2. wait until UART0 of ESP had all data sent out of it's TX-FIFO (think the "READ_PERI_REG" is to be used here in a loop?)
3. reprogramm Pin 26 (U0TXD) of ESP-Chip to be GPIO and set level to 0 (maybe "gpio_output_set()" is to be used here?)
4. wait 25ms (or better, a time given by the Telnet-command) and set Pin 26 (TX-Line) to 1 again. Again wait 25ms (assume that break always waits as long as it lasts)
5. reprogramm Pin 26 from GPIO back to UART-Mode (U0TXD)

Now, if this is correct, could anybody assist me in making the right changes in esp-link software?
If found that "serial/serbridge.c" is the right place to implement. What i need is just the sequence above, and maybe, for learning purpose, a little explanation of the solution :-)

THANK YOU IN ADVANCE!
Oliver

Re: How to generate BREAK-Signal on UART?

PostPosted: Tue Jun 23, 2020 7:21 pm
by ndjur
Hi Oliver,

I know this is a very old topic, but I'm just having the same problem to solve. Looking for similar problems online, I found your question so I just wanted to ask if your solution works. Actually, I'm using ESP32, but I guess the same solution should work with both 8266 and 32 versions of the MCU.
Thanks a lot.