Yahoo Groups archive

Lpc2000

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

Message

RE: [lpc2000] More UART woes

2005-07-22 by Tim Wade

Hi

I really wouldn't blame the LPC -- it is very likely that the PC is
loosing the characters...

We had a FAST PC logging data coming from a GPS receiver at 56K, so not
very fast really, but come hell nor high water we could NOT get the PC
to collect all the characters. Eventually we got a HIGH QUALITY
USB<=>RS232 interface and that worked fine... Windows is NOT very real
time at all... In fact it is almost completely useless for any sort of
time constrained operation at all. Just because it is popular does not
mean that it works very well...

 

-----Original Message-----
From: lpc2000@yahoogroups.com [mailto:lpc2000@yahoogroups.com] On Behalf
Of Mohan K
Sent: Friday, 22 July 2005 11:45 AM
To: lpc2000@yahoogroups.com
Cc: ph@...
Subject: Re: [lpc2000] More UART woes

Hi all/PH,
I am also facing the same problem. 
When I try to send the 8+Kbytes of data, on the other end am loosing
some bytes. The speed of transmission is 115200kbps. The driver uses a
circular buffer for transmission. Following is the code used to transfer
8Kbytes of data:

int uart1Putch(int ch)
{
	//#ifdef UART0_TX_INT_MODE
  	uint16_t temp;
	//  unsigned cpsr;
	temp = (uart1_tx_insert_idx + 1) % UART1_TX_BUFFER_SIZE;
	if(temp == uart1_tx_extract_idx)
    	return -1;                          // no room
	  //cpsr = disableIRQ();                  // disable global
interrupts
  	U1IER &= ~UIER_ETBEI;                 // disable TX interrupts
  	//restoreIRQ(cpsr);                     // restore global
interrupts
	// check if in process of sending data
  	if(uart1_tx_running)
    {
    	// add to queue
     	uart1_tx_buffer[uart1_tx_insert_idx] = (uint8_t)ch;
     	uart1_tx_insert_idx = temp;
    }
  	else
    {
    	// set running flag and write to output register
     	uart1_tx_running = 1;
	 	U1THR = (uint8_t)ch;
    }
	//cpsr = disableIRQ();                  // disable global
interrupts
  	U1IER |= UIER_ETBEI;              // enable TX interrupts
  	//restoreIRQ(cpsr);                     // restore global
interrupts
	return (uint8_t)ch;
}

Am i missing anything? Please advice me.

Thanks & Regards,
Mohan




On 7/21/05, vajper0 <ph@...> wrote:
> Still working on my UART driver for the LPC2138. Now I'm having 
> problems with lost Tx data from the LPC to a PC. I don't have a clue 
> about what I'm doing wrong and I haven't found anything on the web 
> indicating this is a common problem.
> 
> The problem is that sometimes one or a few bytes that I write to the 
> THR don't show up at the PC. If there is data to be transmitted I 
> write one byte to the THR (first checking the LSR5 to be really shure 
> there is  room for a byte). Then I write 16 bytes to the THR every 
> time I get a THR IRQ (also here checking LSR5 to be 100% sure the FIFO

> is empty).
> 
> Doing the above results in lost data at the other end. This happens 
> approximately every 20-50kbytes. I've tried this at different speeds, 
> even as low as 57600bps. The FIFOs are enabled.
> 
> Am I missing something?
> 
> /PH
> 
> 
> 
> ________________________________
> YAHOO! GROUPS LINKS
> 
>  Visit your group "lpc2000" on the web.
>   
>  To unsubscribe from this group, send an email to:
>  lpc2000-unsubscribe@yahoogroups.com
>   
>  Your use of Yahoo! Groups is subject to the Yahoo! Terms of Service. 
>  To unsubscribe from this group, send an email to:
>  lpc2000-unsubscribe@yahoogroups.com
>   
>  Your use of Yahoo! Groups is subject to the Yahoo! Terms of Service. 
>  Your use of Yahoo! Groups is subject to the Yahoo! Terms of Service. 
> ________________________________
>


 
Yahoo! Groups Links



 


--
This email is confidential and intended solely for the use of the individual to whom it is addressed.  
Any views or opinions presented are solely those of the author and do not necessarily represent those of NAUTRONIX LTD.

If you are not the intended recipient, you have received this email in error and use, dissemination, forwarding, printing, or copying of this email is strictly prohibited.  If you have received this email in error please contact the sender.   

Although our computer systems use active virus protection software, and we take various measures to reduce the risk of viruses being transmitted in e-mail messages and attachments sent from this company, we cannot guarantee that such e-mail messages and attachments are free from viruses on receipt.  It is a condition of our using e-mail to correspond with you, that any and all liability on our part arising directly or indirectly out of any virus is excluded.  Please ensure that you run virus checking software on all e-mail messages and attachments before reading them.

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.