Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Is it possible to use 9-bit serial communication in Linux?

RS-232 communication sometimes uses 9-bit bytes. This can be used to communicate with multiple microcontrollers on a bus where 8 bits are data and the extra bit indicates an address byte (rather than data). Inactive controllers only generate an interrupt for address bytes.

Can a Linux program send and receive 9-bit bytes over a serial device? How?

like image 831
joeforker Avatar asked Jun 30 '10 14:06

joeforker


People also ask

How many bits can a serial port send?

Most serial ports use between five and eight data bits. Binary data is typically transmitted as eight bits. Text-based data is transmitted as either seven bits or eight bits.

Is an 8-bit register used solely for serial communication?

SBUF is an 8-bit register used solely for serial communication in the 8051. For a byte of data to be transferred via the TxD line, it must be placed in the SBUF register. Similarly, SBUF holds the byte of data when it is received by the RxD line. SBUF can be accessed like any other register in the 8051.

Which bit is used for serial communication?

In serial communication, data is transmitted one bit at a time (Figure 4.20a). Thus if an 8-bit word is to be transmitted, the 8 bits are transmitted one at a time in sequence along a cable.


2 Answers

I also made complete demo for 9-bit UART emulation (based on even/odd parity). You can find it here.

All sources available on git.

You can easily adapt it for your device. Hope you like it.

like image 118
user2820295 Avatar answered Sep 24 '22 00:09

user2820295


9-bit data framing is possible even if a real world UARTs doesn't. Found one library that also does it under Windows and Linux. See http://adontec.com/9-bit-serial-communication.htm

like image 44
LinuxGuy001 Avatar answered Sep 22 '22 00:09

LinuxGuy001