From owner-freebsd-usb@FreeBSD.ORG Tue Aug 30 18:59:16 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 7A6AB16A41F for ; Tue, 30 Aug 2005 18:59:16 +0000 (GMT) (envelope-from hselasky@c2i.net) Received: from swip.net (mailfe15.tele2.se [212.247.155.193]) by mx1.FreeBSD.org (Postfix) with ESMTP id E903643D53 for ; Tue, 30 Aug 2005 18:59:15 +0000 (GMT) (envelope-from hselasky@c2i.net) X-T2-Posting-ID: Y1QAsIk9O44SO+J/q9KNyQ== Received: from mp-216-88-128.daxnet.no ([193.216.88.128] verified) by mailfe15.swip.net (CommuniGate Pro SMTP 4.3.4) with ESMTP id 13770207; Tue, 30 Aug 2005 20:59:13 +0200 From: Hans Petter Selasky To: freebsd-usb@freebsd.org Date: Tue, 30 Aug 2005 21:00:09 +0200 User-Agent: KMail/1.7 References: <200508202157.j7KLv1GF005017@asus.tddhome> <20050826112422.GY37930@cicely12.cicely.de> <200508301751.j7UHpCt8000858@asus.tddhome> In-Reply-To: <200508301751.j7UHpCt8000858@asus.tddhome> MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Content-Disposition: inline Message-Id: <200508302100.12140.hselasky@c2i.net> Cc: ticso@cicely.de Subject: Re: Ucom/Uftdi Thru-put X-BeenThere: freebsd-usb@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: hselasky@c2i.net List-Id: FreeBSD support for USB List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 30 Aug 2005 18:59:16 -0000 On Tuesday 30 August 2005 19:51, User Tomdean wrote: > Sorry this is long, I have attached the code at the bottom. > ucom_read.c is the FreeBSD code. UMP2_send.c is the AVR code. > > # kldload ucom > # kldload uftdi > power up UMP2 and AVR > In dmesg, I see > ucom0: FTDI USB HS Serial Converter, rev 1.10/2.00, addr 2 > > With a scope, on the USB_DATA+ line, I see groups of 3 uSec activity, > every 1 mSec. Within the groups, I see 100 nSec pulses, or a 10 mBit > rate. > > # ./ucom_read > > With a scope, on the USB_DATA+ line, I see activity every 1 mSec. > But, the AVR has groups of activity every 2 mSEC! Just before the 52 > uSec of activity caused by the AVR, I see a 3 uSec group of activity. > So, the USB bus has its normal 3 uSec activity every 1 mSec overlayed > by 52 uSec of AVR activity every 2 mSec. So, ucom_read only gets the > USB bus every 2 msec. > > The AVR send loop takes 0.9 to 1.1 uSec. These happen in bursts of 74 > uSec every 2 mSec. The AVR waits for the UMP2 TX ready signal most of > the time. > > >From looking at the USB_DATA+ line and the UMP2 *TXE signal, the *TXE > > signal is not true until the buffer is empty. The doc states 'If this > signal is log.1, the buffer is full'. > > 10 mSec --+---------+---------+---------+--------- > USB --1---------123-------1---------123------ > *TXE ---------------4-------------------4----- > > > 1 - 3 uSec USB activity from FreeBSD > 2 - 10 uSec gap > 3 - 52 uSec USB activity from the UMP2 > 4 - 72 uSec activity on the *TXE line, high otherwise. > > The nominal return from the FreeBSD read is 62 bytes. The UMP2 has a > FT8U245BM chip, which has a 384 byte transmit buffer. > > The output from ucom_read, > > Read 1000060 bytes in 32.242824 seconds in chuncks of 62 bytes > > This is a thruput of 31017 bytes/second. > > Does FreeBSD only request 64 bytes from the UMP2???? cat /sys/dev/usb/uftdi.c | more ... #define UFTDIIBUFSIZE 64 ^^^ 64 bytes every 2 ms = 32000bytes/second Maybe you can increase this value, but I am not sure if the driver supports it. --HPS