[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: Serial i386 - high priority IRQ & disable FIFO



On Thu, Aug 16, 2001 at 09:31:43AM -0300, Pedro Zorzenon Neto wrote:
> Hi all,
> 
>   I need to use a special device conected to the other end in a hardware installed this way:
>   PC - modem - telephoneline - modem - device.
> 
>   So.. what is the problem?
>   The device sends "messages" to the PC of 1 to 4 bytes. and the PC answer these messages as a slave.
> 
>   This messages must be answered by the PC aplication as soon as possible, so I used irqtune to give the highest priority to the serial port.
>   Sometimes (about once each 50 messages) that fails (takes about 8 seconds to aplication receive the message) and I think that it could be the PC UART FIFO.
>   Do you have any hint about disabling the FIFO? Is there any FIFO size parameter that specifies how many bytes should FIFO have before IRQ is set?
> 
>   I already monitored the serial wires at the pc port and the delay is inside the PC. The PC UART is 16550A. This PC has woody distribution installed.
> 
>     Thanks in advance,
>     Pedro

I discovered how to do it.

The best I could do to improve serial port performance was:

set it's irq priority to highest with irqtune (package hwtools).
# irqtune -s 4        #example with /dev/ttyS0 io=0x3f8 irq=4

use program set_serial with low_latency mode. Add low_latency in your serial port line in /etc/serial.conf:
/dev/ttyS0 uart 16550A port 0x03f8 irq 4 baud_base 115200 spd_normal skip_test low_latency

use a C program to set trigger parameter in UART to 1 byte. that means that the irq will be set with just one bit in the uart fifo.
in this case you must use root permitions, ioperm and outb.
you should send 0x01 to io BASE_ADDRESS+2

Hope that helps someone else,
   Pedro



Reply to: