Yahoo Groups archive

Lpc2000

Index last updated: 2026-04-28 23:31 UTC

Message

Re: [lpc2000] transmit interrupt kicker

2005-01-20 by Peter Jakacki

Yeah, you'd think that the transmit routine would be simple hey? As Rob 
brought out, you have to kick it. Usually I do this by a separate 
polling routine called from a timer interrupt. It checks the queue and 
the UART and decides whether it needs to load up the UART. Mind you, I 
*still* check to see if I need to kick it from my queue filler such as 
when the first character is transmitted etc. But there are conditions 
where the micro won't detect that the transmitter is ready (I'm trying 
to think why now, but funny things happen). Anyway, the polling routine 
also checks for receive lockups/timeouts etc, so it's a good idea and 
also good practice.

BTW, especially at higher baud rates it's advantageous to have the 
transmit interrupt handler loop and check the queue again before 
exiting. This way it keeps the transmit fifo filled and makes for more 
efficient operation. If the interrupt handler routine has a high 
overhead it might even pay to "tread water" in the handler, timing out 
if  the UART is not ready yet. This is can be very beneficial when 
operating at higher baud rates as the handler can empty the queue in one 
tight burst.

*Peter*


chazeltopman wrote:

>Is anyone aware of another way to start the transmit interrupt running on the UART on an 
>LPC2106 other than writing to the THR?  I'd rather the interrupt routine take care of 
>writing to the UART instead of another asynchronous thread of code doing that.  
>
<snip>


-- 
No virus found in this outgoing message.
Checked by AVG Anti-Virus.
Version: 7.0.300 / Virus Database: 265.7.1 - Release Date: 1/19/05

Attachments

Move to quarantaine

This moves the raw source file on disk only. The archive index is not changed automatically, so you still need to run a manual refresh afterward.