# RS 232 port com 0 configuration Net+OS 7.3

**URL:** <https://forums.digi.com/t/rs-232-port-com-0-configuration-net-os-7-3/3676>\
**Category:** NET+OS\
**Tags:** rs232\
**Created:** [August 12, 2008, 2:21pm UTC](https://forums.digi.com/t/rs-232-port-com-0-configuration-net-os-7-3/3676 "2008-08-12T14:21:23Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![darapuce](https://avatars.discourse-cdn.com/v4/letter/d/3ec8ea/32.png) [@darapuce](https://forums.digi.com/u/darapuce)\
**Post date:** [August 12, 2008, 2:21pm UTC](https://forums.digi.com/t/rs-232-port-com-0-configuration-net-os-7-3/3676/1 "2008-08-12T14:21:23Z")

</div>

Hello,

I am total new user. I recieved my development kit Connect-Me a week ago.  
But I couldn’t manage to configure my port com 0 and open it.

7 bit data  
1 bit stop  
Parity Even  
hardware None

How can I open the port?

Cheers mate

---

<div class="post-metadata">

**Author:** ![kubiajir](https://avatars.discourse-cdn.com/v4/letter/k/e19b73/32.png) [@kubiajir](https://forums.digi.com/u/kubiajir)\
**Post date:** [August 13, 2008, 7:44pm UTC](https://forums.digi.com/t/rs-232-port-com-0-configuration-net-os-7-3/3676/2 "2008-08-13T19:44:46Z")

</div>

This is support forum without support from digi…

There are two way how to access serial port:

1. using STDIO, its the same as it is in linux, you can use printf, getchar …
2. direct acces to serial port - I guess that this is what you need.

If you want to use direct access, you need to switch off stdio output. You can find it here: properties of your project-\> NET+OS -\> Options-\>bsp\_sys.h-\>STDIO Port-\> set to NULL

Now try this code:

#include “termios.h”

int fd = open(“/com/0”,O\_RDWR);  
if(fd \< 0)  
{  
// handle error  
}  
char data[10];  
sprintf(data,"Hi!  
");  
write(fd,data,4);  
close fd;

So if you want to configure serial port you have to use this functions:

int tcsetattr(int fd, int optional\_actions, struct termios \* termios\_p );  
int tcgetattr(int fd, struct termios \* termios\_p );

See documentation for this functions or see this page  
[http://linux.about.com/library/cmd/blcmdl3\_tcgetattr.htm](http://linux.about.com/library/cmd/blcmdl3_tcgetattr.htm)

Jirka

---

<div class="post-metadata">

**Author:** ![darapuce](https://avatars.discourse-cdn.com/v4/letter/d/3ec8ea/32.png) [@darapuce](https://forums.digi.com/u/darapuce)\
**Post date:** [August 14, 2008, 11:25am UTC](https://forums.digi.com/t/rs-232-port-com-0-configuration-net-os-7-3/3676/3 "2008-08-14T11:25:38Z")

</div>

Hello Jirka,

Many thanks mate.  
I spent the morning to configure my RS 232 port without hardware handshaking.  
With your help I could manage to send from the port to the hyperterminal.

Thanks again mate for the advice…
