Yahoo Groups archive

Lpc2000

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

Thread

UART0

UART0

2004-11-19 by k10elex

I am using Olimex LPC2106 board with 14.7456Mhz crystal.
i am facing problem with the Serial port. i initialise the register 
for 9600 baudrate but its not working. some times it sending some 
garbage data endless!!
here is the code
it should send A to I and then it should respond to the received byte.
please look in to it.
Thanks,
Ketan

  int temp;  
  char str[10] = "ABCDEFGHI";
  char ch;
	
  /* initialize the serial interface   */
PCONP &= 0x08;
PINSEL0 = 0x00000005;   /* Enable RxD1 and TxD1                     */
U0LCR = 0x83;           /* 8 bits, no Parity, 1 Stop bit            */
U0DLL = 96;             /* 9600 Baud Rate @ 14.7456MHz VPB 
Clock         */
U0LCR = 0x03;           /* DLAB = 0                                 */

for(temp=0;temp < 10;temp++)
{
    while((U0LSR & 0x40) == 0){}
    U0THR = str[temp];
}
while(1)
{
   if (!(U0LSR & 0x01))
   {
    ch = U0RBR;
    while((U0LSR & 0x40) == 0){}
    U0THR = ch;
   }
}

Re: UART0

2004-11-19 by mahlerweb

Hi,

are you working with a pll-multiplier ???

  

--- In lpc2000@yahoogroups.com, "k10elex" <k10elex@y...> wrote:
> 
> 
> I am using Olimex LPC2106 board with 14.7456Mhz crystal.
> i am facing problem with the Serial port. i initialise the register 
> for 9600 baudrate but its not working. some times it sending some 
> garbage data endless!!
> here is the code
> it should send A to I and then it should respond to the received 
byte.
> please look in to it.
> Thanks,
> Ketan
> 
>   int temp;  
>   char str[10] = "ABCDEFGHI";
>   char ch;
> 	
>   /* initialize the serial interface   */
> PCONP &= 0x08;
> PINSEL0 = 0x00000005;   /* Enable RxD1 and TxD1                     
*/
> U0LCR = 0x83;           /* 8 bits, no Parity, 1 Stop bit            
*/
> U0DLL = 96;             /* 9600 Baud Rate @ 14.7456MHz VPB 
> Clock         */
> U0LCR = 0x03;           /* DLAB = 0                                 
*/
Show quoted textHide quoted text
> 
> for(temp=0;temp < 10;temp++)
> {
>     while((U0LSR & 0x40) == 0){}
>     U0THR = str[temp];
> }
> while(1)
> {
>    if (!(U0LSR & 0x01))
>    {
>     ch = U0RBR;
>     while((U0LSR & 0x40) == 0){}
>     U0THR = ch;
>    }
> }

Re: [lpc2000] Re: UART0

2004-11-20 by Ketan Shah

no i am not using pll. 
today i get partially successes with it.. now the
problem is it sends some different value for
"ABCDEFGHI" of course its in incremental order but it
was not ASCII value for same. but after this loop it
reflect the correct value what ever we transmit.

to run this i have to insert delay before every
character to send !.. may be the board will transmit
but the hiper terminal will not receive that fast!!

Thanks,
Ketan

 
--- mahlerweb <peter.mahler@...> wrote:

> 
> Hi,
> 
> are you working with a pll-multiplier ???
> 
>   
> 
> --- In lpc2000@yahoogroups.com, "k10elex"
> <k10elex@y...> wrote:
> > 
> > 
> > I am using Olimex LPC2106 board with 14.7456Mhz
> crystal.
> > i am facing problem with the Serial port. i
> initialise the register 
> > for 9600 baudrate but its not working. some times
> it sending some 
> > garbage data endless!!
> > here is the code
> > it should send A to I and then it should respond
> to the received 
> byte.
> > please look in to it.
> > Thanks,
> > Ketan
> > 
> >   int temp;  
> >   char str[10] = "ABCDEFGHI";
> >   char ch;
> > 	
> >   /* initialize the serial interface   */
> > PCONP &= 0x08;
> > PINSEL0 = 0x00000005;   /* Enable RxD1 and TxD1   
>                  
> */
> > U0LCR = 0x83;           /* 8 bits, no Parity, 1
> Stop bit            
> */
> > U0DLL = 96;             /* 9600 Baud Rate @
> 14.7456MHz VPB 
> > Clock         */
> > U0LCR = 0x03;           /* DLAB = 0               
>                  
> */
> > 
> > for(temp=0;temp < 10;temp++)
> > {
> >     while((U0LSR & 0x40) == 0){}
> >     U0THR = str[temp];
> > }
> > while(1)
> > {
> >    if (!(U0LSR & 0x01))
> >    {
> >     ch = U0RBR;
> >     while((U0LSR & 0x40) == 0){}
> >     U0THR = ch;
> >    }
> > }
> 
> 
> 
> 



		
__________________________________ 
Do you Yahoo!? 
Meet the all-new My Yahoo! - Try it today! 
http://my.yahoo.com

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.