LPC2138 TX FIFO full

Started by Lowry, Jeff April 29, 2005
If I enable the TX FIFO do I have to keep track of how many characters
I've sent to THR so not to exceed 16? The transmit holding register
empty bit only says it's not empty. Any way of knowing it's full so I
can stop sending chars?


An Engineer's Guide to the LPC2100 Series

At 11:24 AM 4/29/05 -0700, Lowry, Jeff wrote:
>If I enable the TX FIFO do I have to keep track of how many characters
>I've sent to THR so not to exceed 16? The transmit holding register
>empty bit only says it's not empty. Any way of knowing it's full so I
>can stop sending chars?

The way that is usually serviced is to on receiving the interrupt (or
polling to find the flag set), send up to 16 bytes/characters to the FIFO
or as many as are ready. Then poll or wait for another interrupt for the
next burst. So yes, essentially you count how many you put in, it's
probably not worth the extra logic to spread that among multiple calls
though, If you are interrupt driven spreading the count would probably be
a lot of overhead for very little return.

Robert

" 'Freedom' has no meaning of itself. There are always restrictions, be
they legal, genetic, or physical. If you don't believe me, try to chew a
radio signal. " -- Kelvin Throop, III
http://www.aeolusdevelopment.com/