Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 22 Oct 2005 14:18:19 +0200
From:      Bernd Walter <ticso@cicely12.cicely.de>
To:        "Daniel O'Connor" <doconnor@gsoft.com.au>
Cc:        Frank Behrens <frank@pinky.sax.de>, freebsd-hackers@freebsd.org, ticso@cicely.de
Subject:   Re: How disable attachment of sio(4) driver to device?
Message-ID:  <20051022121818.GR31913@cicely12.cicely.de>
In-Reply-To: <200510221601.07346.doconnor@gsoft.com.au>
References:  <200510210835.j9L8Zn2P001846@pinky.frank-behrens.de> <20051021203948.GQ31913@cicely12.cicely.de> <200510221601.07346.doconnor@gsoft.com.au>

next in thread | previous in thread | raw e-mail | index | archive | help
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




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20051022121818.GR31913>