[Linux-programlama] Setserial port programming

---------

New Message Reply About this list Date view Thread view Subject view Author view Attachment view

From: Mehmet K. (memetk@gmail.com)
Date: Mon 16 May 2005 - 15:47:39 EEST


Merhaba,

Bir süredir Şişecam'da veri toplama projeleri yapıyoruz. Şimdilik 100
civarında endüstriyel veri toplama istasyonunda Linux kullanıyoruz. Bu
sayı sene sonunda 200-300 arası bir yere oturacak. (3-4 proje
tamamlanmış oluyor)

Şu anda bir RS485 sorunumuz var.
ttyS1 RS485. Özel bir sürücüye ihtiyacımız var mı sorusunu donanımcı
firma aşağıdaki gibi yanıtladı.

Debian Sarge. Setserial mevcut.
Ayrıca bir sürücüye ihtiyacımız olmadığı söyleniyor ama C ve Java ile
yazdığımız test programlarında bir sonuca ulaşamadık.

Bir önerisi olan?

Örnek C kodunda port açma rutini:

int
tty_setup(char *dev, int baudrate)
{
        int fd;
        struct termios newtio;
        fd = open(dev, O_RDWR);
        if (fd==0)
                return 0;
        memset(&newtio,0, sizeof(newtio));
        newtio.c_cflag = baudrate | CS8 | CLOCAL | CREAD; // | CRTSCTS
- comment out;
        newtio.c_iflag = IGNPAR;
        newtio.c_oflag = 0;// | ONOCR | ONLRET;
        newtio.c_lflag = 0;
        newtio.c_cc[VTIME] = 10; // timeout = 1/10 sec
        newtio.c_cc[VMIN] = 0; // from read() call
        tcflush(fd, TCIFLUSH);
        tcsetattr(fd,TCSANOW,&newtio);
        return fd;
}

Mehmet K.
TRINOKS

The super I/O of PPC-103T is used W83877TF to provide UART signal (TX,
RX, RTS) to ADM-485 transceiver to implement RS-485 function,

so as driver view, Linux driver only take care of UART signal which is
provided by W83877TF,

as for RS-485 protocol (flow control), that has been performed by ADM-485 (H/W).

PPC-103T originally can support RS-485 function without any extra Linux driver.

_______________________________________________
Linux-programlama mailing list
Linux-programlama@liste.linux.org.tr
http://liste.linux.org.tr/mailman/listinfo/linux-programlama


New Message Reply About this list Date view Thread view Subject view Author view Attachment view

---------

Bu arsiv hypermail 2.1.2 tarafindan uretilmistir.