> At the lowest level, a TS-UART is enabled when its speed is set to a
> non-zero baud rate. When the baud rate is 0 the port is disabled.
> From the software perspective under Linux, the port is disabled when
> the corresponding device node(s) are closed, and enabled when a
> corresponding device node is open. (I put "(s)" because many TS-UARTs
> have a separate device node for 9-bit mode.)
>
> If you never open the device and never write a different value to the
> STAT register of that port you are effectively keeping it disabled.
Still no luck. I produced a test application (source included at the end of
this message) in order to test both hypotheses:
1) Never opening /dev/ttts5.
2) Opening /dev/ttts5 and configuring a baud rate of 0.
To test only accessing /dev/ttts4 run:
'sertest -rts=/dev/ttts4'
To test accessing /dev/ttts4 with /dev/ttts5 set to 0 baud run:
'sertest -rts=/dev/ttts4 -dis=/dev/ttts5'
In either case (when executed from a cold reboot) the scope shows the RTS line
held low at ~ -6V without toggling. Conversely if the application is compiled
for Linux or Cygwin the scope shows a nice 1Hz toggle (executed with 'sertest
-rts=/dev/ttyS0')
Many thanks for the assistance,
- Malcolm
/************ sertest.c follows *************/
#include <sys/termios.h>
#include <sys/ioctl.h>
#include <unistd.h>
#include <string.h>
#include <fcntl.h>
int main(int argc, const char **argv)
{
const char *rts_dev = "/dev/ttts4";
const char *dis_dev = NULL;
int rts_fh;
int dis_fh;
int i;
/* Process Command-line Arguments */
for (i = 1; i < argc; ++i)
{
if (strcmp(argv[i], "-?") == 0 || strcmp(argv[i], "--help") == 0)
{
printf("sertest [-rts=devname] [-dis=devname]\n");
printf(" -rts : RTS-Toggling device (e.g /dev/ttts4)\n");
printf(" -dis : Optional Port to Disable (e.g /dev/ttts5)\n");
return 1;
}
else if (strncmp(argv[i], "-rts=", 5) == 0)
{
rts_dev = argv[i] + 5;
}
else if (strncmp(argv[i], "-dis=", 5) == 0)
{
dis_dev = argv[i] + 5;
}
}
/* Test for disable port */
if (dis_dev != NULL)
{
struct termios options;
/* Open disable port */
printf("Opening Port %s to Disable\n", dis_dev);
dis_fh = open(dis_dev, O_RDWR | O_NOCTTY | O_NONBLOCK);
if (dis_fh < 0)
{
perror("open");
return 1;
}
/* Initialize options */
memset(&options, 0, sizeof(options));
options.c_cflag = IGNBRK;
options.c_oflag = 0;
options.c_cflag = CREAD | CLOCAL | CS8;
options.c_lflag = 0;
cfsetispeed(&options, B0);
cfsetospeed(&options, B0);
/* Set options */
if (tcsetattr(dis_fh, TCSANOW, &options) != 0)
{
perror("tcsetattr");
return 1;
}
}
/* Open ttts4 */
printf("Opening Port %s to Toggle RTS\n", rts_dev);
rts_fh = open(rts_dev, O_RDWR | O_NOCTTY | O_NONBLOCK);
if (rts_fh < 0)
{
perror("open");
return 1;
}
/* Loop Forever */
for (;;)
{
int rts_flg = TIOCM_RTS;
int nr;
/* Clear the RTS Line */
nr = ioctl(rts_fh, TIOCMBIC, &rts_flg);
if (nr != 0)
perror("ioctl(TIOCMBIC)");
/* Sleep 1 second */
sleep(1);
/* Set the RTS Line */
nr = ioctl(rts_fh, TIOCMBIS, &rts_flg);
if (nr != 0)
perror("ioctl(TIOCMBIS)");
/* Sleep 1 second */
sleep(1);
}
}
------------------------------------
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/
|