RS232 and space parity

Hi

I want to use the serial port to communicate with an external device via the
serial port. The protocol is 19200 baud, 8 data bits, space parity and one
stopbit. I don’t know with UART is used in my PC but the device manager
devc-ser8250 ist running. I use the QNX/Neutrino-API calls to open the port
an to set the protocol. The command stty -a < dev/ser1 shows the parity I
have set.

My source code looks like this:

struct termios data;
fd = open(“dev/ser1”, O_RDWR);
tcgetattr(fd, &data)

data.c_cflag &= ~(PARENB | PARODD | PARSTK);
data.c_cflag |= (PARENB | PARSTK);
data.c_lflag |= IEXTEN;

tcsetattr(fd, TCSADRAIN, &data);

I tried several setting but I never got space parity I always got even
parity.
It seems that the QNX doesn’t support the stick parity bit. So it’s not
possible to use space parity (and the mark parity too).

Any idea?

Thanks

Harald
<h.kube@ideasoft.de>

Harald Kube <harald.kube@gmx.de> wrote:

Hi

I want to use the serial port to communicate with an external device via the
serial port. The protocol is 19200 baud, 8 data bits, space parity and one
stopbit. I don’t know with UART is used in my PC but the device manager
devc-ser8250 ist running. I use the QNX/Neutrino-API calls to open the port
an to set the protocol. The command stty -a < dev/ser1 shows the parity I
have set.

My source code looks like this:

struct termios data;
fd = open(“dev/ser1”, O_RDWR);
tcgetattr(fd, &data)

data.c_cflag &= ~(PARENB | PARODD | PARSTK);
data.c_cflag |= (PARENB | PARSTK);
data.c_lflag |= IEXTEN;

tcsetattr(fd, TCSADRAIN, &data);

I tried several setting but I never got space parity I always got even
parity.
It seems that the QNX doesn’t support the stick parity bit. So it’s not
possible to use space parity (and the mark parity too).

Any idea?

Thanks

Harald
h.kube@ideasoft.de

Hi,

Both the space parity and mark parity are supported in QNX, see the tcgetattr()
docs. I tried your code on my machine (QNX 6.0B) and it worked fine. I ran stty
and it showed me that parity had been changed to space.

Regards,

Barry

Yes, I know that this code work fine and I know that stty shows that the
parity was changed but if I use MS Windows Hyperterminal set to space parity
the communication fails and if communicate to my external device it fails
too!!!

At this time I use a workaround to get real space parity. I set the space
paritiy mode. Before sending a byte I calculate its parity by myself and if
the parity is even if switch to mark parity then I send the byte and after
sending I switch back to space parity. Because this works fine, the QNX
support of space parity must be wrong!

Could this be a bug device driver? I use devc-ser82500.

Kind regards,

Harald

“Operating System for Tech Supp” <os@qnx.com> schrieb im Newsbeitrag
news:9hclgp$ivj$1@nntp.qnx.com

Hi,

Both the space parity and mark parity are supported in QNX, see the
tcgetattr()
docs. I tried your code on my machine (QNX 6.0B) and it worked fine. I ran
stty
and it showed me that parity had been changed to space.

Regards,

Barry

Harald Kube <> harald.kube@gmx.de> > wrote:
Hi

I want to use the serial port to communicate with an external device via
the
serial port. The protocol is 19200 baud, 8 data bits, space parity and
one
stopbit. I don’t know with UART is used in my PC but the device manager
devc-ser8250 ist running. I use the QNX/Neutrino-API calls to open the
port
an to set the protocol. The command stty -a < dev/ser1 shows the parity
I
have set.

My source code looks like this:

struct termios data;
fd = open(“dev/ser1”, O_RDWR);
tcgetattr(fd, &data)

data.c_cflag &= ~(PARENB | PARODD | PARSTK);
data.c_cflag |= (PARENB | PARSTK);
data.c_lflag |= IEXTEN;

tcsetattr(fd, TCSADRAIN, &data);

I tried several setting but I never got space parity I always got even
parity.
It seems that the QNX doesn’t support the stick parity bit. So it’s not
possible to use space parity (and the mark parity too).

Any idea?

Thanks

Harald
h.kube@ideasoft.de

“Harald Kube” <h.kube@ideasoft.de> wrote in message
news:9hf153$7v7$1@inn.qnx.com

Yes, I know that this code work fine and I know that stty shows that the
parity was changed but if I use MS Windows Hyperterminal set to space
parity
the communication fails and if communicate to my external device it fails
too!!!

At this time I use a workaround to get real space parity. I set the
space
paritiy mode. Before sending a byte I calculate its parity by myself and
if
the parity is even if switch to mark parity then I send the byte and after
sending I switch back to space parity. Because this works fine, the QNX
support of space parity must be wrong!

Could this be a bug device driver? I use devc-ser82500.

You could check yourself the source are in the CVS repository :wink:

Kind regards,

Harald

“Operating System for Tech Supp” <> os@qnx.com> > schrieb im Newsbeitrag
news:9hclgp$ivj$> 1@nntp.qnx.com> …
Hi,

Both the space parity and mark parity are supported in QNX, see the
tcgetattr()
docs. I tried your code on my machine (QNX 6.0B) and it worked fine. I
ran
stty
and it showed me that parity had been changed to space.

Regards,

Barry

Harald Kube <> harald.kube@gmx.de> > wrote:
Hi

I want to use the serial port to communicate with an external device
via
the
serial port. The protocol is 19200 baud, 8 data bits, space parity and
one
stopbit. I don’t know with UART is used in my PC but the device
manager
devc-ser8250 ist running. I use the QNX/Neutrino-API calls to open the
port
an to set the protocol. The command stty -a < dev/ser1 shows the
parity
I
have set.

My source code looks like this:

struct termios data;
fd = open(“dev/ser1”, O_RDWR);
tcgetattr(fd, &data)

data.c_cflag &= ~(PARENB | PARODD | PARSTK);
data.c_cflag |= (PARENB | PARSTK);
data.c_lflag |= IEXTEN;

tcsetattr(fd, TCSADRAIN, &data);

I tried several setting but I never got space parity I always got even
parity.
It seems that the QNX doesn’t support the stick parity bit. So it’s
not
possible to use space parity (and the mark parity too).

Any idea?

Thanks

Harald
h.kube@ideasoft.de
\

“Mario Charest” <mcharest@zinformatic.com> schrieb im Newsbeitrag
news:9hf5mp$a8e$1@inn.qnx.com

“Harald Kube” <> h.kube@ideasoft.de> > wrote in message
news:9hf153$7v7$> 1@inn.qnx.com> …
Yes, I know that this code work fine and I know that stty shows that the
parity was changed but if I use MS Windows Hyperterminal set to space
parity
the communication fails and if communicate to my external device it
fails
too!!!

At this time I use a workaround to get real space parity. I set the
space
paritiy mode. Before sending a byte I calculate its parity by myself and
if
the parity is even if switch to mark parity then I send the byte and
after
sending I switch back to space parity. Because this works fine, the QNX
support of space parity must be wrong!

Could this be a bug device driver? I use devc-ser82500.


You could check yourself the source are in the CVS repository > :wink:

How can I access the CVS repository?

Harald Kube <h.kube@ideasoft.de> wrote:

“Mario Charest” <> mcharest@zinformatic.com> > schrieb im Newsbeitrag
news:9hf5mp$a8e$> 1@inn.qnx.com> …
“Harald Kube” <> h.kube@ideasoft.de> > wrote in message
news:9hf153$7v7$> 1@inn.qnx.com> …
Yes, I know that this code work fine and I know that stty shows that the
parity was changed but if I use MS Windows Hyperterminal set to space
parity
the communication fails and if communicate to my external device it
fails
too!!!

At this time I use a workaround to get real space parity. I set the
space
paritiy mode. Before sending a byte I calculate its parity by myself and
if
the parity is even if switch to mark parity then I send the byte and
after
sending I switch back to space parity. Because this works fine, the QNX
support of space parity must be wrong!

Could this be a bug device driver? I use devc-ser82500.


You could check yourself the source are in the CVS repository > :wink:

How can I access the CVS repository?

Go to http://cvs.qnx.com and click on CVS Repository link.
The devc-ser8250 code is under nto/drivers/devc/ser8250.

Barry

I think the QNX homepage really needs a popper sitemap. I think it is quite hard
to navigate and find the things I’m looking for on the QNX web pages… If you
ask someone at QNX they come up with a new site like http://cvs.qnx.com, which
you’ve never heard of until then… At least I can not find any link to such a
site on the www.qnx.com homepage.

Just a suggestion… Do people agree or disagree??

-Arve

Operating System for Tech Supp wrote:

Harald Kube <> h.kube@ideasoft.de> > wrote:
“Mario Charest” <> mcharest@zinformatic.com> > schrieb im Newsbeitrag
news:9hf5mp$a8e$> 1@inn.qnx.com> …
“Harald Kube” <> h.kube@ideasoft.de> > wrote in message
news:9hf153$7v7$> 1@inn.qnx.com> …
Yes, I know that this code work fine and I know that stty shows that the
parity was changed but if I use MS Windows Hyperterminal set to space
parity
the communication fails and if communicate to my external device it
fails
too!!!

At this time I use a workaround to get real space parity. I set the
space
paritiy mode. Before sending a byte I calculate its parity by myself and
if
the parity is even if switch to mark parity then I send the byte and
after
sending I switch back to space parity. Because this works fine, the QNX
support of space parity must be wrong!

Could this be a bug device driver? I use devc-ser82500.


You could check yourself the source are in the CVS repository > :wink:

How can I access the CVS repository?

Go to > http://cvs.qnx.com > and click on CVS Repository link.
The devc-ser8250 code is under nto/drivers/devc/ser8250.

Barry

“Arve Slenes” <arve@datarespons.no> wrote in message
news:3B3C4A51.B23937F3@datarespons.no

I think the QNX homepage really needs a popper sitemap. I think it is
quite hard
to navigate and find the things I’m looking for on the QNX web pages… If
you
ask someone at QNX they come up with a new site like > http://cvs.qnx.com> ,
which
you’ve never heard of until then… At least I can not find any link to
such a
site on the > www.qnx.com > homepage.

If you are a developper try qdn.qnx.com.

Just a suggestion… Do people agree or disagree??

-Arve

Operating System for Tech Supp wrote:

Harald Kube <> h.kube@ideasoft.de> > wrote:
“Mario Charest” <> mcharest@zinformatic.com> > schrieb im Newsbeitrag
news:9hf5mp$a8e$> 1@inn.qnx.com> …
“Harald Kube” <> h.kube@ideasoft.de> > wrote in message
news:9hf153$7v7$> 1@inn.qnx.com> …
Yes, I know that this code work fine and I know that stty shows
that the
parity was changed but if I use MS Windows Hyperterminal set to
space
parity
the communication fails and if communicate to my external device it
fails
too!!!

At this time I use a workaround to get real space parity. I set
the
space
paritiy mode. Before sending a byte I calculate its parity by
myself and
if
the parity is even if switch to mark parity then I send the byte
and
after
sending I switch back to space parity. Because this works fine, the
QNX
support of space parity must be wrong!

Could this be a bug device driver? I use devc-ser82500.


You could check yourself the source are in the CVS repository > :wink:

How can I access the CVS repository?

Go to > http://cvs.qnx.com > and click on CVS Repository link.
The devc-ser8250 code is under nto/drivers/devc/ser8250.

Barry