[Lazarus] SdpoSerial Tx and Rx buffers?

Bo Berglund bo.berglund at gmail.com
Thu Feb 17 17:46:08 CET 2011


On Wed, 16 Feb 2011 12:07:28 +0100, José Mejuto <joshyfun at gmail.com>
wrote:

>Hello Lazarus-List,
>
>Wednesday, February 16, 2011, 10:59:02 AM, you wrote:
>
>MS> On 02/15/2011 10:45 AM, Bo Berglund wrote:
>>> Does that mean that until all of the bytes have left the serial port
>>> the Write does not return to my program? This is exactly why I asked
>>> about the buffers...
>MS> Regarding sending, there still is a FiFo (usually some 4..64  Bytes ) in
>MS> the serial hardware (hundreds or thousands of bytes) and a software Fifo
>MS> in the OS driver. So the software can't tell when something has left the
>MS> serial port. For such deeply embedded issues  the specifics of the
>MS> driver and hardware needs to be considered
>
>AFAIK the FIFO is in the receive, in sent the FIFOs are filled but
>function does not return until the hardware sends the last byte.
>
At least in the embedded world UART:s have *both* a transmit and
receive FIFO. You usually are able to set the interrupt trigger such
that it fires when there are a certain number of bytes in the Rx FIFO
and when it reduces below a certain number of bytes in the transmit
FIFO. This way one can fill the FIFO with outgoing data and then go
away doing something else until the iterrupt fires at which time the
interrupt routine will move available data from the buffer to the
FIFO.

-- 

Bo Berglund
Developer in Sweden





More information about the Lazarus mailing list