I'm trying to capture a signal much like UART communication.
This specific signal is composed by:
1 start bit(low)
16 data bits
1 stop bit (high)
From testing, I figured out that signal is about ~8-9μs / bit. This led me to believe that the baud is around 115.2kbps.
My frist idea was to try a "manual" approach, and wrote a small C program. Although I couldn't sample the signal at the proper timing.
From here, I decided to look for libraries that could do the job. I did try "termios" and "asio::serial_port" from boost, but those don't seem to be able to receive 16 bit characters.
Am I being naive trying to configure a 16 bit receiver? Does a "16 bit UART" even make sense?
Thanks!
-nls
There's nothing fundamentally wrong with the idea of a UART which supports a 16-data-bit configuration, but I'm not aware of any which do. 8 or 9 is usually the limit.
If you're communicating with a device which only supports that configuration (what the heck kind of device is that?), your only real option is bit-banging, which would be best done by a MCU dedicated to the purpose. You are not going to get microsecond-accurate timing in user space on a multitasking operating system, no matter what libraries you bring to bear.
EDIT: Note that you could do this, more or less, with bit-banging from a dedicated kernel-space driver. But that would make the system nearly unusable. The whole reason UARTs exist is because the CPU has better things to do than poll a line every few microseconds.