UART 9bit workaround?

commx93
Posts: 2
Joined: Sat May 19, 2018 10:51 am

UART 9bit workaround?

Postby commx93 » Sat May 19, 2018 11:06 am

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)?

victor.kostycha
Posts: 2
Joined: Mon Aug 13, 2018 12:56 pm

Re: UART 9bit workaround?

Postby victor.kostycha » Mon Aug 13, 2018 12:59 pm

Hi howdy! did you got this? does it possible?

thanks!!

Return to “Hardware”

Who is online

Users browsing this forum: No registered users and 3 guests