Sign in

username:

password:



Not a member?

Search lpc2000



Search tips

Subscribe to lpc2000



lpc2000 by Keywords

2106 | ADC | ARM7 | Atmel | Bootloader | CAN | CrossStudio | CrossWorks | DDS | ECos | Ethernet | ETM | FIFO | FLASH | FPGA | GCC | GDB | GNU | GNUARM | GPIO | I2C | IAP | IAR | JTAG | Kickstart | LCD | Linux | LPC | LPC-E2294 | LPC2000 | LPC2100 | LPC2104 | Lpc2106 | Lpc210x | LPC2114 | LPC2119 | LPC2124 | LPC2129 | Lpc2138 | LPC213x | LPC21xx | LPC2210 | LPC2212 | LPC2214 | LPC2292 | LPC2294 | LPC2xxx | LPC3128 | MCB2100 | Olimex | Philips | PWM | Rowley | RTC | RTOS | SPI | SSP | UART | UART0 | UART1 | ULINK | USB | Watchdog | Wiggler

Ads

Discussion Groups

Discussion Groups | LPC2000 | high performance UART FIFO usage

Discussion group dedicated to the Philips LPC2000 family of ARM MCUs

high performance UART FIFO usage - naderus2000 - Mar 8 5:26:13 2007

I want to uart0 for tx long string with FIFO mode enable.
what is the best performance wat to do that?I want the min time I
must wait in this function.
here is a simple function for that:

void UART0_String(char * str)
{
char i = 0;

while(!(U0LSR &0x20));// see in FIFO is full free from last
access

while(*str != '\0')
{
U0THR = *str++;
i++;
if(i == 16) // FIFO is full
{
while(!(U0LSR &0x20)); // wait until the FIFO free
i =0;
}
}
}

if my string is 18 char when 16 char is fill in the FIFO
I must wait the 16 char is sent (about 16*70us @ 115200)
but if i can detect when two char is send i only want
2*70us that's more effient.
Is there any way for better usage of FIFO with interrupt?



(You need to be a member of lpc2000 -- send a blank email to lpc2000-subscribe@yahoogroups.com )


Re: high performance UART FIFO usage - Danish Ali - Mar 8 8:46:52 2007

I don't think the UART can tell you if there is space in the FIFO
(except to say it is completely empty).
This is a limitation of the 16550 UART that the lpc family emulates.

I can think of two approaches:

1) Provide your own software FIFO - as big as you want
subject to available memory.

2) Use a spare hardware timer to predict how the UART FIFO will empty.

I strongly recommend approach 1.
If the software FIFO is big enough your call will not block.
And while you're at it, add a software FIFO for characters coming in.

Regards,
Danish

--- In l...@yahoogroups.com, "naderus2000" wrote:
>
> I want to uart0 for tx long string with FIFO mode enable.
> what is the best performance wat to do that?I want the min time I
> must wait in this function.
> here is a simple function for that:
>
> void UART0_String(char * str)
> {
> char i = 0;
>
> while(!(U0LSR &0x20));// see in FIFO is full free from last
> access
>
> while(*str != '\0')
> {
> U0THR = *str++;
> i++;
> if(i == 16) // FIFO is full
> {
> while(!(U0LSR &0x20)); // wait until the FIFO free
> i =0;
> }
> }
> }
>
> if my string is 18 char when 16 char is fill in the FIFO
> I must wait the 16 char is sent (about 16*70us @ 115200)
> but if i can detect when two char is send i only want
> 2*70us that's more effient.
> Is there any way for better usage of FIFO with interrupt?
>


(You need to be a member of lpc2000 -- send a blank email to lpc2000-subscribe@yahoogroups.com )