[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: serial port DTR RTS direct control failed !!




----- Original Message ----- 
From: "Pin Yang Ang" <P.Y.Ang@xxxxxxx.uk>
To: "Johan Adolfsson" <johana@xxxxxxx.com>
Cc: <dev-etrax@xxxxxxx.com>
Sent: Thursday, May 27, 2004 2:27 PM
Subject: Re: serial port DTR RTS direct control failed !!


> Hello.
>
> Hardware: ETRAX 100 board with ETRAX 100LX chip, used in AXIS 2120
cameara.
>
> Software: cris-dist-1.15-1.i386.rpm, default elinux, devboard-R1_1_0.tgz.
>
> The original kernelconfig has the following settings:
>
> CONFIG_ETRAX_SER0_DTR_RI_DSR_CD_ON_PB=y
> CONFIG_ETRAX_SER0_DTR_ON_PB_BIT=4
> CONFIG_ETRAX_SER0_RI_ON_PB_BIT=5
> CONFIG_ETRAX_SER0_DSR_ON_PB_BIT=6
> CONFIG_ETRAX_SER0_CD_ON_PB_BIT=7
>
> I replace these settings with your suggestions but the situation remains
the
> same. Can you please tell me what should I do? Shall I download other set
of
> software?

The settings I provided is for a devboard, and it looks like that what you
originally have as well, the kernelconfig provided with a devboard release
will probably not work with other hardware.
We don't really support development on the cameras, but a
quick look at the schematics for 2120 says that the RS-232 port is on ser1
(dev/ttyS1), although the DTR, RI, DSR and CD pins on that port is
controlled
with the same PB bits as the config you got, so I guess that controlling
DTR should work anyway.
You wrote:
> The PC serial port pins (1,6,8) had a voltage swing of +/- 11V, where

but on a serial 9-pin male DSUB connecter those pin doesn't match DTR etc.
DTR is pin 4, and RTS is pin 7.

> Many thanks.
>
> Regards,
> Pin

/Johan

> Quoting Johan Adolfsson <johan.adolfsson@xxxxxxx.com>:
>
> > Hi,
> > What hardware are you using?
> > What software release are you using?
> > What does the serial port settings in the kernelconfig look like?
> > Depending on your hardware it should say something like this:
> > CONFIG_ETRAX_SER0_DTR_ON_PA_BIT=-1
> > CONFIG_ETRAX_SER0_RI_ON_PA_BIT=-1
> > CONFIG_ETRAX_SER0_DSR_ON_PA_BIT=-1
> > CONFIG_ETRAX_SER0_CD_ON_PA_BIT=-1
> > CONFIG_ETRAX_SER0_DTR_ON_PB_BIT=4
> > CONFIG_ETRAX_SER0_RI_ON_PB_BIT=5
> > CONFIG_ETRAX_SER0_DSR_ON_PB_BIT=6
> > CONFIG_ETRAX_SER0_CD_ON_PB_BIT=7
> >
> > Best regards
> > /Johan
> >
> > ----- Original Message ----- 
> > From: "Pin Yang Ang" <P.Y.Ang@xxxxxxx.uk>
> > To: <dev-etrax@xxxxxxx.com>
> > Sent: Wednesday, May 26, 2004 7:11 PM
> > Subject: serial port DTR RTS direct control failed !!
> >
> >
> > > Hi all,
> > >
> > > Please give me some advices on this!!
> > >
> > > I tried to directly control the RTS and DTR pins on the ETRAX 100
> > serial
> > > port. I ran the C programme on a PC with Redhat 7.0, it worked
> > perfect.
> > But
> > > when I ran on the ETRAX board (with latest elinux), they is no
response
> > at
> > all.
> > >
> > > The PC serial port pins (1,6,8) had a voltage swing of +/- 11V, where
> > as
> > in
> > > the ETRAX the voltage of the same pins remains at +7V all the time.
> > >
> > > Many thanks in advance!!
> > >
> > > Below is the source code:
> > >
> > >
> >
**************************************************************************
> > >
> > > #include <sys/types.h>
> > > #include <sys/stat.h>
> > > #include <fcntl.h>
> > > #include <termios.h>
> > > #include <stdio.h>
> > > #include <errno.h>
> > >
> > > #include <sys/ioctl.h>
> > >
> > > #define BAUDRATE B38400
> > > #define PORT "/dev/ttyS0"
> > >
> > > int main(int argc, char **argv)
> > > {
> > > int fd,c, res;
> > >         struct termios oldtio,newtio;
> > >         char buf[255];
> > >
> > > //
> > > int rtsEnable, rtsflags;
> > > int dtrEnable, dtrflags;
> > > //
> > > int tdEnable, tdflags;
> > >
> > >         /* Open modem device for reading and writing and not as
> > controlling tty
> > >            because we don't want to get killed if linenoise sends
> > CTRL-C.*/
> > >         fd = open(PORT, O_RDWR | O_NOCTTY );
> > >         if (fd <0)
> > > {
> > > perror(PORT);
> > > printf("cannot open serial port");
> > > exit(-1);
> > > }
> > >
> > > sscanf(PORT, "%d", &dtrEnable);
> > > fprintf(stderr, "dtrEnable are %x.\n", dtrEnable);
> > >
> > > ioctl(fd, TIOCMGET, &dtrflags);
> > >   fprintf(stderr, "dtrFlags are %x.\n", dtrflags);
> > > sleep(2);
> > > dtrflags &= ~TIOCM_DTR;
> > > ioctl(fd, TIOCMSET, &dtrflags);
> > >   fprintf(stderr, "Setting %x.\n", dtrflags);
> > > sleep(2);
> > > ioctl(fd, TIOCMGET, &dtrflags);
> > >   fprintf(stderr, "dtrFlags are %x.\n", dtrflags);
> > >
> > > return 1;
> > > }
> > >
> > > ****************************************************************
> > >
> > >
> >
> >
>
>
> -- 
> Dr Pin Yang Ang
> Research Engineer
> IENSYS Ltd
> Intelligent Engineering Systems
> Holywell Building
> Holywell Way
> Loughborough
> Leicestershire LE11 3UZ
> UK
> Tel: + 44 (0) 1509 226570
> Fax +44 (0)1509 226577
>
>