From owner-freebsd-questions@FreeBSD.ORG Fri Aug 29 03:37:35 2003 Return-Path: Delivered-To: freebsd-questions@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id E2CDE16A4BF for ; Fri, 29 Aug 2003 03:37:35 -0700 (PDT) Received: from smtp1.adl2.internode.on.net (smtp1.adl2.internode.on.net [203.16.214.181]) by mx1.FreeBSD.org (Postfix) with ESMTP id C935C43FE3 for ; Fri, 29 Aug 2003 03:37:34 -0700 (PDT) (envelope-from malcolm.kay@internode.on.net) Received: from beta.home (ppp104-131.lns1.adl1.internode.on.net [150.101.104.131])h7TAbWx1088582; Fri, 29 Aug 2003 20:07:33 +0930 (CST) Content-Type: text/plain; charset="iso-8859-1" From: Malcolm Kay Organization: At home To: "Marcelo Schmidt" , Date: Fri, 29 Aug 2003 20:07:31 +0930 User-Agent: KMail/1.4.3 References: In-Reply-To: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Message-Id: <200308292007.31910.malcolm.kay@internode.on.net> Subject: Re: How do I change the speed on ttyd0? X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 29 Aug 2003 10:37:36 -0000 On Fri, 29 Aug 2003 15:56, Marcelo Schmidt wrote: > Hi, > > I need to read data from a temperature sensor (PIC12C509) that requires= : > serial data at 2400 baud, 8 bits, no parity, one or two stop bits. I t= ried > several things, tip, cu, > Device-SerialPort-0.13, etc. It seems to be the ttyd0 speed is locked = in > 9600: > > # stty -a -f /dev/ttyd0 Since you are calling out it is probably better to use /dev/cuaa0; but must admit I don't fully understand the implications of cuaa0 vs ttyd= 0. In any case you can set the default parameters on ttyd0 with ttyid0 or cuaa0 with cuaia0. This pseudo ports are for the sole purpose of setting the defaults on ttyd0 and cuaa0. So assuming you use /dev/cuaa0 then you want: # stty -f /dev/cuaia0 speed 2400 You probably also want to set some other parameters such as: # stty -f /dev/cuaia0 clocal > speed 9600 baud; 0 rows; 0 columns; > lflags: -icanon -isig -iexten -echo -echoe -echok -echoke -echonl > -echoctl -echoprt -altwerase -noflsh -tostop -flusho -pendin > -nokerninfo -extproc > iflags: -istrip -icrnl -inlcr -igncr -ixon -ixoff -ixany -imaxbel -ignb= rk > -brkint -inpck -ignpar -parmrk > oflags: -opost -onlcr -ocrnl -oxtabs -onocr -onlret > cflags: cread cs8 -parenb -parodd hupcl -clocal -cstopb -crtscts -dsrfl= ow > -dtrflow -mdmbuf > cchars: discard =3D ^O; dsusp =3D ^Y; eof =3D ^D; eol =3D ; > eol2 =3D ; erase =3D ^?; erase2 =3D ^H; intr =3D ^C; kil= l =3D ^U; > lnext =3D ^V; min =3D 1; quit =3D ^\; reprint =3D ^R; start =3D= ^Q; > status =3D ^T; stop =3D ^S; susp =3D ^Z; time =3D 0; werase =3D= ^W; > > My /etc/ttys: > ttyd0 "/usr/libexec/getty std.2400" unknown off secure local > > I also got sometimes: /kernel: sio0: 26 more tty-level buffer overflows > (total 8805). > > So how do I change the speed on ttyd0? > Malcolm Kay