Go Premium for a chance to win a PS4. Enter to Win

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 987
  • Last Modified:

9 Data Bits Serial Communication

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
daveson_lee
Asked:
daveson_lee
  • 8
  • 4
  • 2
1 Solution
 
nietodCommented:
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
 
daveson_leeAuthor Commented:
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
 
daveson_leeAuthor Commented:
Edited text of question.
0
Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
daveson_leeAuthor Commented:
Edited text of question.
0
 
daveson_leeAuthor Commented:
Edited text of question.
0
 
daveson_leeAuthor Commented:
Edited text of question.
0
 
daveson_leeAuthor Commented:
Edited text of question.
0
 
nietodCommented:
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
 
daveson_leeAuthor Commented:
Can low level language capable of doing this ?
0
 
nietodCommented:
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
 
tdubroffCommented:
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
 
daveson_leeAuthor Commented:
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
 
tdubroffCommented:
Most modern PC's use 16550-compatiable UARTs.
0
 
nietodCommented:
>> 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

Free Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

  • 8
  • 4
  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now