From owner-freebsd-hackers@FreeBSD.ORG Sat Oct 22 12:18:33 2005 Return-Path: X-Original-To: freebsd-hackers@freebsd.org Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id C140816A41F for ; Sat, 22 Oct 2005 12:18:33 +0000 (GMT) (envelope-from ticso@cicely12.cicely.de) Received: from ant.bwct.de (ant.bwct.de [85.159.14.68]) by mx1.FreeBSD.org (Postfix) with ESMTP id 2D09E43D45 for ; Sat, 22 Oct 2005 12:18:32 +0000 (GMT) (envelope-from ticso@cicely12.cicely.de) Received: from cicely5.cicely.de ([10.1.1.7]) by ant.bwct.de (8.12.11/8.12.11) with ESMTP id j9MCIThM029473; Sat, 22 Oct 2005 14:18:30 +0200 (CEST) Received: from cicely12.cicely.de (cicely12.cicely.de [10.1.1.14]) by cicely5.cicely.de (8.13.4/8.13.4) with ESMTP id j9MCINvZ058033 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Sat, 22 Oct 2005 14:18:23 +0200 (CEST) (envelope-from ticso@cicely12.cicely.de) Received: from cicely12.cicely.de (localhost [127.0.0.1]) by cicely12.cicely.de (8.13.4/8.13.3) with ESMTP id j9MCINKr041143; Sat, 22 Oct 2005 14:18:23 +0200 (CEST) (envelope-from ticso@cicely12.cicely.de) Received: (from ticso@localhost) by cicely12.cicely.de (8.13.4/8.13.3/Submit) id j9MCIJf2041142; Sat, 22 Oct 2005 14:18:19 +0200 (CEST) (envelope-from ticso) Date: Sat, 22 Oct 2005 14:18:19 +0200 From: Bernd Walter To: "Daniel O'Connor" Message-ID: <20051022121818.GR31913@cicely12.cicely.de> References: <200510210835.j9L8Zn2P001846@pinky.frank-behrens.de> <20051021203948.GQ31913@cicely12.cicely.de> <200510221601.07346.doconnor@gsoft.com.au> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <200510221601.07346.doconnor@gsoft.com.au> X-Operating-System: FreeBSD cicely12.cicely.de 5.4-STABLE alpha User-Agent: Mutt/1.5.9i X-Spam-Status: No, score=-5.9 required=5.0 tests=ALL_TRUSTED,BAYES_00 autolearn=ham version=3.0.4 X-Spam-Report: * -3.3 ALL_TRUSTED Did not pass through any untrusted hosts * -2.6 BAYES_00 BODY: Bayesian spam probability is 0 to 1% * [score: 0.0000] X-Spam-Checker-Version: SpamAssassin 3.0.4 (2005-06-05) on cicely12.cicely.de Cc: Frank Behrens , freebsd-hackers@freebsd.org, ticso@cicely.de Subject: Re: How disable attachment of sio(4) driver to device? X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: ticso@cicely.de List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 22 Oct 2005 12:18:34 -0000 On Sat, Oct 22, 2005 at 04:00:59PM +0930, Daniel O'Connor wrote: > On Sat, 22 Oct 2005 06:09, Bernd Walter wrote: > > I personally build specialized USB and Ethernet devices for doing > > Modbus/RTU RS485 timing. > > We use 9 bit data RS485 (the ninth bit is used as an address mark so > microcontrollers can sleep until it turns up then check if it's addressed to > it and go back to sleep). That's the big win with 9 bit. Modbus uses 8 bit so each controller has to actively listen. The RTU variant uses fixed idle times to mark packet ends, which is hard to do right in kernel and unreliable to do from userland. Since I needed multi-OS support and have at least one customer with many busses the kernel was no option. > I have been told it could be implemented as a line discipline but I am not so > sure (since to do 9 bit transmition you need to change between mark & space > parity on a byte by byte basis) Don't know about line discipline abilities, but I remember that some trustfull persons declared this to be doable. It is the whole hardware design that won't fit. As long as timing is not critical and you have legacy serials it is OK. But many USB uarts don't have native 9 bit support as well, and the nature of USB is that you really want large FiFos. This is a dead track IMHO. > We (well msmith originally) implemented it as a cut down hacked up copy of sio > - this IS suboptimial so I think I'll have a look at implementing it via > uart. The whole thing is suboptiomal. Today there are no reasons to not offload the tricky parts into external devices. I'd originaly used Atmel Mega8 plus Philips PDIUSBD11 for this. It was a slow but reliable and cheap combination, but Piliphs stopped production of the chip. Today I use Mega64 and PDIUSBD12 for USB and Mega128 with RTL8019AS for Ethernet, which gives me two UART for use in a single device. The controller have 9 bit wide FiFos. If you are already in the 8051 world, you might look at TI TUSB3410. -- B.Walter BWCT http://www.bwct.de bernd@bwct.de info@bwct.de