Page 1 of 1

UART 9bit workaround?

Posted: Sat May 19, 2018 11:06 am
by commx93
I need to transfer frames of 9bits over UART (9 data bits + no parity + 1 stop bit). Having already checked, I see there is no native support for 9bit data frames on ESP32. However, I'd like to ask if the following is possible?

When transmitting:
1. Construct the 9 bits that need to be transferred.
2. Observe the 9th bit, depending on its value, set the parity to either odd or even so that the parity bit would be equal to the 9bit.
3. Transmit the 8bit frame (and automatically the parity bit that represents the 9th bit).

When receiving:
1. Get the received 8bit frame. Get the parity check result.
2. Depending on the currently set parity, calculate what would be considered the "valid" bit for the selected parity. Then, based on whether there was a parity success/error, find out what the 9th bit is.

I need to know:
- Would this approach work on ESP32?
- Does the chip retain the 8 bits received over RX even in the case of parity check error (or does it empty the register in such case automatically)?

Re: UART 9bit workaround?

Posted: Mon Aug 13, 2018 12:59 pm
by victor.kostycha
Hi howdy! did you got this? does it possible?

thanks!!