Solved

9 Data Bits Serial Communication

Posted on 2000-03-17
14
970 Views
Last Modified: 2008-02-01
Hi,

Currently, I am using C,C++ or Visual C++ to communicate with a hardware using serial communication through com 1 or com 2.

This hardware using a strange protocol.

It communicate using 9 Data Bits rather than 8 Data Bits,9600bps,Even parity and one stop bit.

Do anyone know how to configure the com port to accept 9 Data Bits ?

The Configuration is 9600 bps, Even parity, 1 Stop Bit but 9 data bits not 8 data bits.

I have tried programming in Unix Platform, it works well. But when it comes to Windows Platform, there is a bit of problem.

Anyone knows how to configure it in Windows Platform ?
0
Comment
Question by:daveson_lee
  • 8
  • 4
  • 2
14 Comments
 
LVL 22

Expert Comment

by:nietod
ID: 2628812
I strongly suspect that then 9th bit is a parity bit.  Otherwise how will the 9 data bist be stored?  They won't fit in a byte.  The will fit in a word, but that is a terrible waste and may severly limit the type of data that can be sent.
0
 

Author Comment

by:daveson_lee
ID: 2628913
I have tried the configuration above with Sun workstation and it works perfectly.

Why does such configuration work with Sun Workstation but not Windows Platform ?

Does each of them use different UART Chips ?

0
 

Author Comment

by:daveson_lee
ID: 2628918
Edited text of question.
0
 

Author Comment

by:daveson_lee
ID: 2628919
Edited text of question.
0
 

Author Comment

by:daveson_lee
ID: 2628920
Edited text of question.
0
 

Author Comment

by:daveson_lee
ID: 2628922
Edited text of question.
0
 

Author Comment

by:daveson_lee
ID: 2628924
Edited text of question.
0
Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

 
LVL 22

Expert Comment

by:nietod
ID: 2629080
Please don't edit the question after a dialog has started.  It makes it harder for other experts to follow the question.  just post a comment instead.

I don't think windows is capable of this.  SetCommProperties doesn't have any options for data bits more than 8 that aren't multiples of 8.  I
0
 

Author Comment

by:daveson_lee
ID: 2629750
Can low level language capable of doing this ?
0
 
LVL 22

Expert Comment

by:nietod
ID: 2629910
In windows you either need to use the windows API functions for this--which don't seem to support it, or write a device driver to access the hardware directly.  (its unclear if even the hardware is capable of handling it.)  
0
 
LVL 2

Accepted Solution

by:
tdubroff earned 100 total points
ID: 2630466
I've come across hardware like this before.  We ended up using an HC11 board with a 'multi-drop' mode serial port to communicate to the device, as well as a standard 16550 UART to talk to our controlling PC.  

The HC11 processor converted the 8 bits it received from the PC to the 9 bits the target hardware needed.

See http://www.cer.com/notes/an_b12.htm for a brief explanation.  Also as this link says you may get around having to buy a special board by playing tricks with the parity...maybe, maybe not.

Hope this answers your question.

-Ted
0
 

Author Comment

by:daveson_lee
ID: 2633126
One more question,

Does normal PC uses UART chip 8250 ? rather the UART chip 16650 ?

So buying the special card will solve the program.

Is there any other way to solve it ?

Thanks.
0
 
LVL 2

Expert Comment

by:tdubroff
ID: 2633306
Most modern PC's use 16550-compatiable UARTs.
0
 
LVL 22

Expert Comment

by:nietod
ID: 2633312
>> Does normal PC uses UART chip 8250 ?
>> rather the UART chip 16650 ?
Yes.  No.

Any UART can be used.  As of the early 90's some that were in used were 8350, 82450, 16450, and 16550.

The manufacturer can use any UART so long as the BIOS is written to communicate correctly with the UART.  If you assume a particular UART is in use and you try to by-pass the BIOS you can be in trouble.
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
maze travler 6 51
Need some help with listview limit text 20 98
sorting efficency of sorting algorithm 30 103
Problem with SqlConnection 4 160
What is C++ STL?: STL stands for Standard Template Library and is a part of standard C++ libraries. It contains many useful data structures (containers) and algorithms, which can spare you a lot of the time. Today we will look at the STL Vector. …
Many modern programming languages support the concept of a property -- a class member that combines characteristics of both a data member and a method.  These are sometimes called "smart fields" because you can add logic that is applied automaticall…
The goal of the tutorial is to teach the user how to use functions in C++. The video will cover how to define functions, how to call functions and how to create functions prototypes. Microsoft Visual C++ 2010 Express will be used as a text editor an…
The goal of the video will be to teach the user the difference and consequence of passing data by value vs passing data by reference in C++. An example of passing data by value as well as an example of passing data by reference will be be given. Bot…

895 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

20 Experts available now in Live!

Get 1:1 Help Now