Re: What is Trigger Level in UART?



On Thu, 17 May 2007, Richard wrote:
Does anyone know how to program the uart to send or
receive a different number of bytes before generating
an interrupt? I've tried using setserial but it doesn't
seem to do anything.

Richard

From the version of setserial (ver. 2.17, 27-Jan-2000) come
from FC6, the 'rx_trigger' and 'tx_trigger' options work for ESP (some Hayes UART chips) only. So, I assume that setserial cannot set the RX/TX trigger level on a plain 16550A. However, from data*** of 16550A (just as from "http:/pdf1.alldata***.com/data***-pdf/view/9301/NSC/PC16550D.html") the RX trigger level of an 16550A is software programmable, by writing to the FCR bit 6 and bit 7, combinations of 1, 4, 8, 14 bytes are allowed. On the other hand, the TX FIFO buffer on a 16550A can only be enabled or disabled.

Moreover, there is timeout mechanism in the RX buffer, ie. even when the UART is programmed to generate an interrupt when 4 bytes are received, the UART WILL send an interrupt signal when something is received and a period of time is expired. So, the RX buffer is only utilized when back-to-back characters are received.

My 2 cents.

Stephen Wong @ Hong Kong.

.