Yahoo Groups archive

Lpc2000

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

Message

Re: TX FIFO

2004-07-28 by roger_lynx

Hello all,

I am puzzled by perhaps similar thing re: missing THRE int., FIFO empty?
Can anyone plese help me to see what I do incorrectly?

Polled UART0 works, INT on THRE doesn't.
Timer0 ISR works, though.

The code (snippets below)never makes it to UART_THRE ISR.
I am re-writing INT driven buffered Tx already implemented on another
MCUs.
BTW, I am a newbie on LPC2106, no flames please.

--roger

---ivt.s----
LDR PC, [PC, #-0xFF0] 		@ load irq vector from vic
LDR PC, FIQ_Addr

-----main.c---

VICIntSelect = 0x0; 	/* ALL sources selected as IRQ */
VICIntEnable = 0x50; 	/* TIMER0 and UART0_THRE interrupts enabled */
/* Address of the ISR */
VICVectAddr0 = (unsigned long)IRQ_Timer0_Handler; 
VICVectCntl0 = 0x24;	/* IRQ for channel 4: TIMER0 : 10 0100 */ 
VICVectAddr1 = (unsigned long)IRQ_UART0_Tx_Handler;
VICVectCntl1 = 0x26;	/* IRQ for channel 6: UART_THRE: 10 0110 */
.
.
.

PINSEL0 = 0x05;      	// enable UART0 TxD/RxD
UART0_FCR = 0x07;   	// enable and reset Tx and Rx FIFO
UART0_LCR = 0x83;	// 8N1; enable divisor latches access
UART0_DLL = 0x20;  	// LSB divider for cclk/115200*16=0x20
UART0_DLM = 0x00;  	// MSB = 0
UART0_IER = 0x02;	// enable THRE interrupt
UART0_LCR = 0x03;   	// disable divisor latches

void __attribute__((interrupt)) IRQ_UART0_Tx_Handler(void)
{
IOCLR =0x00000080; <----- LED, active low never turns ON
...
etc.
}

--- In lpc2000@yahoogroups.com, Robert Adsett <subscriptions@a...> wrote:
> At 10:28 AM 7/6/04 +0000, you wrote:
> 
> > > I also stumbled across this description. Obviously, this is a
> >copy-and-paste
> > > from the description of the '550-UART IP-Core.
> >
> >I thought it might be something like that. So given that the FIFO is
> >preconfigured, how do I know when the FIFO is full?
> 
> In this respect, it behaves as all '550s.  When the THRE interrupt
fires 
> the FIFO is empty and you can put up to 16 bytes into it.  Something
like
> 
>   case RECEIVE:
>      for( i = 0; i <16; i++) {
>           U0THR = buf[i];
>       }
>       break;
> 
> Oversimplified but it illustrates the point.
> 
> AFAIR this is documented in all of a sentence or maybe two.
> 
> BTW, I would be very interested if anyone else has run into the missing 
> THRE interrupt symptoms I've seen.
> 
> 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

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.