9 Bit UART
Posted: Mon Jan 14, 2019 6:29 pm
Hello, I have a need to use 9 bit communications with the ESP32. 1 start bit, one stop bit, and 9 data bits.
ESP32 supports up to 8 data bits, but it is possible to use a parity bit to send data.
To send, we can reconfigure the parity "polarity" prior to sending each byte, in order to control if it is one or zero. We may also be able to just manually enter the parity bit into registers, but I haven't looked into that yet.
In the technical reference manual, it sounds like we might be able to just receive data with a bad parity, and read it anyways, then figure out what the parity is. If the UART hardware doesn't let you read data that came with a bad parity, there seems to be the option to read data bit by bit as it comes in and manually transfer each bit to storage.
Does anyone know if the first method for receiving 9 bit data would work? It doesn't seem to say, since it's using the parity bit in a way it isn't meant for. I don't have a development board so can't try it out.
Also would anyone happen to know off the top of their head if the coprocessor is connected to the UART? Because doing things bit by bit would take up a measurable amount of processing time. It'd be like bitbanging, except using the UART hardware for timing and all that.
ESP32 supports up to 8 data bits, but it is possible to use a parity bit to send data.
To send, we can reconfigure the parity "polarity" prior to sending each byte, in order to control if it is one or zero. We may also be able to just manually enter the parity bit into registers, but I haven't looked into that yet.
In the technical reference manual, it sounds like we might be able to just receive data with a bad parity, and read it anyways, then figure out what the parity is. If the UART hardware doesn't let you read data that came with a bad parity, there seems to be the option to read data bit by bit as it comes in and manually transfer each bit to storage.
Does anyone know if the first method for receiving 9 bit data would work? It doesn't seem to say, since it's using the parity bit in a way it isn't meant for. I don't have a development board so can't try it out.
Also would anyone happen to know off the top of their head if the coprocessor is connected to the UART? Because doing things bit by bit would take up a measurable amount of processing time. It'd be like bitbanging, except using the UART hardware for timing and all that.