How to generate BREAK-Signal on UART?
Posted: Mon Jan 16, 2017 8:42 am
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
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