RS 232 port com 0 configuration Net+OS 7.3

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

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

Jirka

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…