Hi,
I don't have a TS-7500, so take this with a pinch of salt.
Looking at the TS-752 schematic, the RS485 TX Enable is connected to DIO_27 on
the 40 pin connector.
>From the code below, I can't see the control of the TX enable pin being
>specified, which would result in the data being sent to the chip, but not
>being sent out into the world.
I don't know how you'd control the TX Enable, but setting DIO_27 high prior to
sending and setting it low afterwards may help - but I expect the FPGA would
automatically control this line if it was told that the port were RS485...
Hope this helps,
PJE
--- In "nxtcomputing" <> wrote:
>
> I am trying to communicate over the RS-485 port on a TS-7500 with TS-752
> board. I have connected pins 1 and 6 on the DB-9M port of the TS-752 board to
> a RS-458 device. I have tried to configure the ports using the following...
>
> #xuartctl --port 0 --server --speed 9600
> ttyname=/dev/pts/0
> #xuartctl --port 1 --server --speed 9600
> ttyname=/dev/pts/1
>
> then in a program i tried to send over the both of the ports with no luck...
>
> #include <iostream>
> #include <stdio.h>
> #include <stdlib.h>
> #include <string>
> #include "convert.h"
> using namespace std;
> #include <sys/types.h>
> #include <sys/stat.h>
> #include <fcntl.h>
> #include <termios.h>
> #define BAUDRATE B9600
> #define _POSIX_SOURCE 1
> #define FALSE 0
> #define TRUE 1
> volatile int STOP=FALSE;
>
> int main(void) {
> int fd;
> struct termios oldtio, newtio;
> fd = open("/dev/pts/0", O_RDWR | O_NOCTTY);
> if (fd <0) {
> perror("/dev/pts/0");
> exit(-1);
> }
>
> tcgetattr(fd, &oldtio); //save current settings
> bzero(&newtio, sizeof(newtio)); //clear new port settings
>
> newtio.c_cflag = BAUDRATE | CS8 | CLOCAL | CREAD | PARENB;
> newtio.c_iflag = IGNPAR | IGNBRK;
> newtio.c_oflag = OPOST;
>
> newtio.c_lflag = 0;
> tcflush(fd, TCIFLUSH);
> tcsetattr(fd, TCSANOW, &newtio);
>
> char data[50];
> sprintf(data,"%c0101%cAC11R1C1A1P%c",0x02,0x1b,0x04);
>
> write(fd,&data[0],18);
> printf("sent on serial line: %s\n",&data[0]);
> tcsetattr(fd, TCSANOW, &oldtio); //restore old setting
> }
>
> any ideas?
>
------------------------------------
Yahoo! Groups Links
<*> To visit your group on the web, go to:
http://groups.yahoo.com/group/ts-7000/
<*> Your email settings:
Individual Email | Traditional
<*> To change settings online go to:
http://groups.yahoo.com/group/ts-7000/join
(Yahoo! ID required)
<*> To change settings via email:
<*> To unsubscribe from this group, send an email to:
<*> Your use of Yahoo! Groups is subject to:
http://docs.yahoo.com/info/terms/
|