Re: fast communication problem

From: linux-os (Dick Johnson)
Date: Wed Nov 16 2005 - 11:10:38 EST

On Wed, 16 Nov 2005, Ivan Korzakow wrote:

> Hi List,
> I'm running a 2.6.14 linux on 96 MHz MIPS processor. I need to cope
> with a device that sends a byte of data every 50 microsecond through
> an UART with no FIFO. What would be the best (well, the least
> horrible) way to handle that ? The good point is that I know when the
> communication starts.
> Any idea, any help, any "good luck" will be much appreciated !
> Thanks in advance,
> Ivan

Linux can handle interrupts at 100 microsecond intervals with
an ix86 of 400 MHz or above. The MIPS is supposed to be superb for
this kind of operation so you may not have a problem at 50 us and
90 MHz.

The hardware engineers here do know something so they would
never design something that needed the CPU at 50 microsecond
intervals --yet, although there are some new kids coming out
of school that haven't a clue and might create a requirement
like yours in the future!

The interrupt code must be well thought out, with the minimum
overhead of getting a byte from your buffer and writing it to
the device.

Use fixed buffers, probably ping/pong, so you don't have to
allocate anything in the ISR. If it doesn't work, then
call the hardware engineers the idiots they are after
instrumenting the reason why it won't work (takes 80
microseconds just to get to the ISR, leaving negative
time to do the work). They do everything in FPGAs nowadays.
If they buffered just one byte, you get interrupted every
100 us, 4 bytes 200 us, etc. Every bit helps.

Dick Johnson
Penguin : Linux version on an i686 machine (5589.51 BogoMips).
Warning : 98.36% of all statistics are fiction.

The information transmitted in this message is confidential and may be privileged. Any review, retransmission, dissemination, or other use of this information by persons or entities other than the intended recipient is prohibited. If you are not the intended recipient, please notify Analogic Corporation immediately - by replying to this message or by sending an email to DeliveryErrors@xxxxxxxxxxxx - and destroy all copies of this information, including any attachments, without reading or disclosing them.

Thank you.
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at
Please read the FAQ at