Silly Serial Speeds (RS422)

Silly Serial Speeds (RS422)

Post by Dr. Nick Yeado » Wed, 20 May 1998 04:00:00



I'm trying to use a RS422 serial card based on the 16750 UART (made by
Brainboxes?), I'm trying to use it at 460Kbaud. I'm getting data but
occasionally I get repeated characters (I also get lost characters). The
application in question cannot tolerate loss or repetition and I can't
use flow control. I've tryed kernels 2.0.29, 2.1.30 ( which recognised
it as a 16750) and 2.1.99 which took the card to be a 16550A, but still
got losses and repetition. The repetition was of the form a char being
repeated from 16 bytes before (originally) and from 64 bytes before with
kernel 2.1.30.

Has anybody used a card at this speed, this UART at this speed, give me
any pointers.

Will a 200MHz Pentium be able to cope with this speed (no of interrupts)
with/without 64 byte FIFO???

Any help much appreciated.

Please mail me direct (too) as I am a stranger to this group.

Cheers

Nick
--
Dr. Nick Yeadon, Room A48        | Tel: +44 1737 836605
BBC Research & Development       | Fax: +44 1737 836665

Surrey, KT20 6NP, UK             | Web: http://www.bbc.co.uk/rd

 
 
 

Silly Serial Speeds (RS422)

Post by mark » Wed, 20 May 1998 04:00:00


Welcome to the world of real time programming!
You are generating interrupts much faster than the Linux kernel can handle.
Your choices are to either find some "real" time extension to the Linux
kernel, or get a driver (and probably kernel patch) that can minimize the
IRQ overhead of each byte.

If you can, start with the baud rate slow and make sure data is recived
correctly, to rule out progamattic bugs first.

step by step, increase the baud rate until it fails. It has been my
experience that an ISA card with a fairly responsive OS maxes out around
20K IRQ per second. Your 460K baud is about double that.

At your speed, you have a total IRQ response time of about 2us. I do not
know what the kernel overhead is, but 2us is not a lot of time. Plus, 2us
is a bit optimistic as well because your programs presumably need to so
something with this data.

You should target the IRQ handler (Including kernel overhead) to take no
more than .5us.

If your card is a ISA, you would be better off with an PCI

Good luck.


> I'm trying to use a RS422 serial card based on the 16750 UART (made by
> Brainboxes?), I'm trying to use it at 460Kbaud. I'm getting data but
> occasionally I get repeated characters (I also get lost characters). The
> application in question cannot tolerate loss or repetition and I can't
> use flow control. I've tryed kernels 2.0.29, 2.1.30 ( which recognised
> it as a 16750) and 2.1.99 which took the card to be a 16550A, but still
> got losses and repetition. The repetition was of the form a char being
> repeated from 16 bytes before (originally) and from 64 bytes before with
> kernel 2.1.30.

> Has anybody used a card at this speed, this UART at this speed, give me
> any pointers.

> Will a 200MHz Pentium be able to cope with this speed (no of interrupts)
> with/without 64 byte FIFO???

> Any help much appreciated.

> Please mail me direct (too) as I am a stranger to this group.

> Cheers

> Nick
> --
> Dr. Nick Yeadon, Room A48        | Tel: +44 1737 836605
> BBC Research & Development       | Fax: +44 1737 836665

> Surrey, KT20 6NP, UK             | Web: http://www.bbc.co.uk/rd


 
 
 

Silly Serial Speeds (RS422)

Post by Paul Flinder » Wed, 20 May 1998 04:00:00



> You are generating interrupts much faster than the Linux kernel can handle.
> .....
> step by step, increase the baud rate until it fails. It has been my
> experience that an ISA card with a fairly responsive OS maxes out around
> 20K IRQ per second. Your 460K baud is about double that.

That doesn't follow - it depends what trigger level the receive FIFO
is set at.

IIRC Linux sets the FIFO on a '550 to trigger at 8 chars. 2.0.x
doesn't recognise the '750 and if it thinks it's a '650 it will turn
the FIFO off (at which point you'd be correct and you'd get 46k
interrupts/sec) so the original poster does need to check how the
kernel handles the FIFO settings (remember he said that the UART was
recognised as a 750 by at least some of the 2.1 kernels - I don't have
source handy to check how it would handle the FIFO in that case).

However assuming one interrupt per 8 chars 460k would be roughly 5.75k
interupts per second which should be doable bearing in mind that the
serial driver was originally written to support 115k on a 486 using a
'450 (i.e unbuffered - 10k interrupts/sec).

However at those sort of speeds you need short leads and to pay
careful attention to flow control.

--
Paul

 
 
 

Silly Serial Speeds (RS422)

Post by ben.. » Wed, 20 May 1998 04:00:00



Quote:> Has anybody used a card at this speed, this UART at this speed, give me
> any pointers.

I run a hayes ESP (DMA, 1K bufers etc) unde 2.0.33 without any dropped
chars. even without DMA, no dropped chars. I do have the speed set at 460k8
to feed my ZyXEL E2864I ISDN stuff. at 921k6, I have been talking serially
as well without problems.

Quote:> Will a 200MHz Pentium be able to cope with this speed (no of interrupts)
> with/without 64 byte FIFO???

I don't know. I only have a 'measly' P5-100.

--
Grobbebol's Home                 |      Don't give in to spammers.
http://www.xs4all.nl/~bengel     |     Use your real e-mail address
Linux 2.0.33  on  an i586/64 MB  |             on Usenet.

 
 
 

Silly Serial Speeds (RS422)

Post by Kenneth R. Crud » Wed, 20 May 1998 04:00:00




Quote:>IIRC Linux sets the FIFO on a '550 to trigger at 8 chars. 2.0.x
>doesn't recognise the '750 and if it thinks it's a '650 it will turn
>the FIFO off

I spoke to The Serial God, Ted T'So about this. Turns out that the Rx FIFO
is set, by default, to 1/2 the FIFO buffer size, so on a '750/'650, it will be
1/2 of 32, or 16.

Also, ignore that '650 detection code that turns off the FIFOs in "serial.c".
That's only for buggy first-generation '650s, which newer versions don't
fall victim of. '650s (as will '750s) will be recognized as '550s, but still
take advantage of the larger Rx buffer.

        -Kenny

--
Kenneth R. Crudup, Unix & OS/2 Software Consultant, Scott County Consulting

16 Plainfield St, Boston, MA 02130-3633   +1 617 983 9410      Fax
        "Linux, between Playstation and Craystation" -attribution unknown

 
 
 

Silly Serial Speeds (RS422)

Post by Rob van der Putte » Thu, 21 May 1998 04:00:00


Hi there


> Welcome to the world of real time programming!
> You are generating interrupts much faster than the Linux kernel can handle.
> Your choices are to either find some "real" time extension to the Linux
> kernel, or get a driver (and probably kernel patch) that can minimize the
> IRQ overhead of each byte.

Serial ports have too small a buffer.

I used to run Linux 1.2.8 on 4 MB 16 MHz 386 SX. On this machine I just
could use my com ports at speeds > 57k6 while the 10 Mbps ethernet card
didn't couse any problems at all.

Now I run a 2.0.x kernel on a 20 MB 66 MHz 486 DX2
this machine will lose a few ppp packets while running X and Netscape.
I never lost an ethernet packet.

Since high speed serial ports are mainly used for ppp, it might be a good
idea to use a card that can recognise the start of a ppp packet, store it
completely on the card and only issue an interrupt after receiption.

Regards,
Rob

 
 
 

Silly Serial Speeds (RS422)

Post by Rob van der Putte » Thu, 21 May 1998 04:00:00


Hi there


Quote:> I run a hayes ESP (DMA, 1K bufers etc) unde 2.0.33 without any dropped
> chars. even without DMA, no dropped chars. I do have the speed set at 460k8
> to feed my ZyXEL E2864I ISDN stuff. at 921k6, I have been talking serially
> as well without problems.

Any information on that card? An url perhaps?

Regards,
Rob

 
 
 

Silly Serial Speeds (RS422)

Post by ben.. » Thu, 21 May 1998 04:00:00



Quote:>> to feed my ZyXEL E2864I ISDN stuff. at 921k6, I have been talking serially
>> as well without problems.
> Any information on that card? An url perhaps?

email me and I'll try to find a source for the card, Rob.

--
Grobbebol's Home                 |      Don't give in to spammers.
http://www.xs4all.nl/~bengel     |     Use your real e-mail address
Linux 2.0.33  on  an i586/64 MB  |             on Usenet.