Fast reset of UART

betwixt
Posts: 1
Joined: Wed Mar 26, 2025 7:40 pm

Fast reset of UART

Postby betwixt » Wed Mar 26, 2025 8:03 pm

I have an application that receives a continuous stream of bits at 1200 bauds but does not have recognizable start or stop bits. The data is 8 bits long and has to be framed by recognizing a specific byte. The normal UART functions therefore do not work reliably. At the moment I pre-process the data with a PIC MCU which 'walks' along the bits one at a time until the UART recognizes the framing is correct. It is 100% reliable but the data is then passed on to an ESP8266 for formatting and sending to WiFi as JSON messages. I would like to eliminate the PIC if possible but for me to emulate the bit walking, it is necessary to reset the UART within the period of one bit so it sees the next arriving bit as a potential start bit. The algorithm is basically "if the byte isn't 0x66, stop the UART, wait half a bit time, restart the UART again then see if it frames 0x66. If not, repeat the process". There are further integrity checks to confirm framing was successful.

Question, is there a way I can do all this in an ESP8266 so I can eliminate the PIC?

I'm using Arduino IDE 2.3.3 but it doesn't allow low level access to the UART functions and I'm not sure sending "serial.begin" commands will do the reset I need.

Brian.

Who is online

Users browsing this forum: No registered users and 1 guest