From owner-freebsd-usb@FreeBSD.ORG Fri Aug 26 09:37:12 2005 Return-Path: X-Original-To: freebsd-usb@freebsd.org Delivered-To: freebsd-usb@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id E0C1D16A41F for ; Fri, 26 Aug 2005 09:37:11 +0000 (GMT) (envelope-from ticso@cicely12.cicely.de) Received: from srv1.cosmo-project.de (srv1.cosmo-project.de [213.83.6.106]) by mx1.FreeBSD.org (Postfix) with ESMTP id 520AF43D48 for ; Fri, 26 Aug 2005 09:37:10 +0000 (GMT) (envelope-from ticso@cicely12.cicely.de) Received: from cicely5.cicely.de (cicely5.cicely.de [10.1.1.7]) (authenticated bits=0) by srv1.cosmo-project.de (8.12.10/8.12.10) with ESMTP id j7Q9b5BS089575 (version=TLSv1/SSLv3 cipher=EDH-RSA-DES-CBC3-SHA bits=168 verify=OK); Fri, 26 Aug 2005 11:37:07 +0200 (CEST) (envelope-from ticso@cicely12.cicely.de) Received: from cicely12.cicely.de (cicely12.cicely.de [10.1.1.14]) by cicely5.cicely.de (8.12.10/8.12.10) with ESMTP id j7Q9aeKi059654 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Fri, 26 Aug 2005 11:36:40 +0200 (CEST) (envelope-from ticso@cicely12.cicely.de) Received: from cicely12.cicely.de (localhost [127.0.0.1]) by cicely12.cicely.de (8.12.11/8.12.11) with ESMTP id j7Q9adsM048989; Fri, 26 Aug 2005 11:36:39 +0200 (CEST) (envelope-from ticso@cicely12.cicely.de) Received: (from ticso@localhost) by cicely12.cicely.de (8.12.11/8.12.11/Submit) id j7Q9acKZ048988; Fri, 26 Aug 2005 11:36:38 +0200 (CEST) (envelope-from ticso) Date: Fri, 26 Aug 2005 11:36:38 +0200 From: Bernd Walter To: User Tomdean Message-ID: <20050826093638.GU37930@cicely12.cicely.de> References: <200508200344.j7K3irmQ021004@asus.tddhome> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <200508200344.j7K3irmQ021004@asus.tddhome> X-Operating-System: FreeBSD cicely12.cicely.de 5.2-CURRENT alpha User-Agent: Mutt/1.5.9i X-Spam-Status: No, hits=-4.9 required=3.0 tests=BAYES_00 autolearn=ham version=2.64 X-Spam-Report: * -4.9 BAYES_00 BODY: Bayesian spam probability is 0 to 1% * [score: 0.0000] X-Spam-Checker-Version: SpamAssassin 2.64 (2004-01-11) on cicely12.cicely.de Cc: freebsd-usb@freebsd.org Subject: Re: Interfacing FT245BM With Ucom X-BeenThere: freebsd-usb@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: ticso@cicely.de List-Id: FreeBSD support for USB List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 26 Aug 2005 09:37:12 -0000 On Fri, Aug 19, 2005 at 08:44:53PM -0700, User Tomdean wrote: > I am running FreeBSD 5.4, GENERIC. > > I have a UMP2 module based on the FTDI FT8U245BM chip, a USB to > parallel chip. The module in intended to interface processors like > the AVR or 68HC1x to the USB. I am using the FTDI ATmega16, clocked > at 16 mHz. > > My project will have 3 or 3 bytes put into the USB every 6.0 to 7.8 > uSec or every 11.2 to 12.8 uSec, depending on the degradation of > precision due to over-clocking the ATMega16 ADC. > > Most of the data flow is into FreeBSD. So, I need about 0.75 mBytes > thruput. Maybe a few bytes per second out of FreeBSD. > > The UMP2 is recognized as a ucom device, > > vendor 0x0403 > product 0x6001 > release 0x0200 > > If I 'kldload uftdi', I get uftdi.ko and ucom.ko loaded. Then, > powering up the UMP2 results in the device being connected. From > dmesg: > > ucom0: FTDI USB HS Serial Converter, rev 1.10/2.00, addr 2 > > I can connect to the device with tip. But, I cannot disconnect! '~.' > displays [EOT] but tip does not exit. I can disconnect as root! The > device is > > crw-rw---- 1 uucp dialer 232, 128 Aug 18 04:43 ucom0 > > When tip is hung, > # ps > ... > 1001 17030 553 0 6 0 1272 728 ttywai IE+ p1 0:00.00 /usr/bin/tip ucom > 1001 17031 17030 0 -84 0 0 0 - Z+ p1 0:00.00 > ... There shouldn't be any differences about which user opens the device, but you may want to retest with 6.0. PHK did a massivly update on tty-layer, lots of ucom shortcomings have been identified. > I have to cycle power on the UMP2 to get tip to exit! And, cycle > power on the UMP2 to get it recognized again!. Sometimes, it takes > several minutes before one of the drivers gets in sync with the > hardware. > > BTW, the behavior of tip has changed from a UNIX-style 0x0a to a > WINDOZE style 0x0d,0x0a to get UNIX display behavior! > > I plan to try tip with ucom0 with an echo process in the AVR to just > return any char received by the UMP2. > > Can I get the 0.75 mByte thruput with uftdi driver, accessed thru > ucom? Yes - as long a nothing else is using the same USB channel you can expect rates of up to 1MByte/s. But you shouldn't expect transmission of injected bytes in less than a few msec, as tranporting bytes mean starting a new request, which then get scheduled on the next USB frame - a USB frame is started every 1ms. In case of the FTDI-chip it is buffered by default for full 10ms unless the receive buffer of the FTDI gets full. I asume it is the AVR sending just a few bytes, otherwise you may see reduced bandwidth because of this. Ideally you should inject a few hundret bytes at once for transmission from userland to the USB hardware - don't know how good the tty-code can cache this problem by buffering. Your userland application should also read with large requests whenever possible. -- B.Walter BWCT http://www.bwct.de bernd@bwct.de info@bwct.de