Re: Linux serial port dropping bytes
- From: CBFalconer <cbfalconer@xxxxxxxxx>
- Date: Tue, 01 Apr 2008 15:35:09 -0500
Grant Edwards wrote:
CBFalconer <cbfalconer@xxxxxxxxx> wrote:
Derek Young wrote:
I'm using an Arcom Viper PXA255 single board computer running
Linux, and I'm trying to receive bytes over the built-in RS-422
serial port at 921.6 kbps. The received packets are 1500 bytes
long. The UART is a 16C2850 (dual port version of the 16C850
with 128 byte FIFO).
Everything works fine at low speeds, but if the packet rate
increases, I start to lose bytes.
Your numbers indicate that you would need an interrupt roughly
every 1 microsec. Not a chance.
Huh?
If he sets the FIFO threshold to 64, then the interrupt
frequency is 921600.0/10/64 == 1440Hz.
If he sets it FIFO threshold to 96, then the interrupt
frequency is 921600.0/10/96 == 960Hz. 960Hz should be no
problem at all unless some of the other ISRs are running too
long.
I know of UARTs that can hold 64, or even 128, results. I gather
that that one has a 128 byte storage. Okay, now consider how long
it takes to empty that buffer, when full. That has to be done at
least every 921600/128 (I don't know where you got /10/96), or
roughly 10 khz, for about 100 uS between interrupts. Now you don't
know how many items are stored, so that implies a one by one
discharge loop. Nobody has mentioned the CPU speed, but I still
have grave doubts. Don't forget that during the discharge the FIFO
is still filling up, at roughly 1 item per microsec.
I would guess you are assuming the speed mentioned is a bit speed,
not a per byte port speed, and the '10' is the length of the
character, in bits. Nobody computes serial port speeds that way.
--
[mail]: Chuck F (cbfalconer at maineline dot net)
[page]: <http://cbfalconer.home.att.net>
Try the download section.
--
Posted via a free Usenet account from http://www.teranews.com
.
- Follow-Ups:
- Re: Linux serial port dropping bytes
- From: Grant Edwards
- Re: Linux serial port dropping bytes
- From: Robert Adsett
- Re: Linux serial port dropping bytes
- References:
- Linux serial port dropping bytes
- From: Derek Young
- Re: Linux serial port dropping bytes
- From: CBFalconer
- Re: Linux serial port dropping bytes
- From: Grant Edwards
- Linux serial port dropping bytes
- Prev by Date: Re: Polling a Port Pin for a specific amount of time
- Next by Date: Re: Linux serial port dropping bytes
- Previous by thread: Re: Linux serial port dropping bytes
- Next by thread: Re: Linux serial port dropping bytes
- Index(es):
Relevant Pages
|