From KB#0XFA0EEO
The UART on all our serial products supports 5 to 8 data bits, even/odd/mark/space/no parity and 1/1.5/2 stop bits. Since the UART does not support 9-bits directly, there is no provision in the driver to accomplish this. However, the parity bit can be used as a 9-th bit. Ofcourse, the transmission will no longer be able to use the parity bit for error checking.
Transmission:
Mark and Space is a high and low parity bit respectively. To add a ninth bit to your tranmission, you will need to either have the parity bit be set to mark or space for every byte that is transmitted. For example, if you want to transmit binary 100010000, you can transmit hex 88 and set the parity to be space. If you want to transmit binary 100010001 ins
tead, then you can still transmit hex 88 but set the parity to be mark.
Reception:
Reception is even more tedious. You will need to set the port up for 8-bits and parity checking enabled. Every byte you receive will need to be examined. For example, if you had set the port for even parity, and the byte received has a parity error, and the byte has odd number of 1s, then the parity bit was 0. Similarly, if the byte received has a parity error, and the byte has even number of 1s, then the parity bit was 1. As you can see, its a very tedious way of using the 9th bit and its not recommended.
Randy Solomonson
Application Engineer
National Instruments