Yahoo Groups archive

Lpc2000

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

Thread

UART 0 problem in LPC2106

UART 0 problem in LPC2106

2005-02-08 by Srinivasa Reddy Mannem

Hi,
 
I am working LPC2106 target board.
 
I am trying to write some data to hyper terminal using serial port ( UART 0 ).
 
But i couldn't get that.
 
The crystal frequency of the board what i am using is 10MHz. And i set the baud rate as 9600.
 
To trace that i have included some printf statements in between my program.
 
I am getting those printf messages without any fail.
 
Then why i am not getting any charecter in hyper terminal window. 
 
Please go through the attached hello.c program and let me know where i am doing mistake.
 
Looking forward to hear from you.
 
Regards,
-Srinivas.
 
 


		
---------------------------------
Do you Yahoo!?
 Yahoo! Mail - Easier than ever with enhanced search. Learn more.

[Non-text portions of this message have been removed]

Re: UART 0 problem in LPC2106

2005-02-08 by mannem_sri

--- In lpc2000@yahoogroups.com, Srinivasa Reddy Mannem 
<mannem_sri@y...> wrote:
> Hi,
>  
> I am working LPC2106 target board.
>  
> I am trying to write some data to hyper terminal using serial port 
( UART 0 ).
>  
> But i couldn't get that.
>  
> The crystal frequency of the board what i am using is 10MHz. And i 
set the baud rate as 9600.
>  
> To trace that i have included some printf statements in between my 
program.
>  
> I am getting those printf messages without any fail.
>  
> Then why i am not getting any charecter in hyper terminal window. 
>  
> Please go through the attached hello.c program and let me know 
where i am doing mistake.
>  
> Looking forward to hear from you.
>  
> Regards,
> -Srinivas.
>  


The source code :

*********************************************

#include <stdio.h>
#include "C:\DefectValidation\lpc210x.h"
typedef unsigned char uint8_t;
typedef unsigned int uint16_t;
#define FOSC		10000000    //10MHz.
#define PLL_M		4	
#define VPBDIV_VAL	1
#define UART_BAUD(baud) (uint16_t)(((FOSC*PLL_M/VPBDIV_VAL) / 
((baud) * 16.0)) + 0.5)
void delay(unsigned long int);
uint16_t i;
int main()
{
	uint8_t temp;
	uint16_t baud = 9600, baud_rate;
	
	PLLCFG = 0x23;
	PLLFEED = 0xAA;
	PLLFEED	= 0x55;
	PLLCON	= 0x01;
	PLLFEED	= 0xAA;
	PLLFEED	= 0x55;
	while(!(PLLSTAT & 0x0400)) {}
	PLLCON = 0x03;
	PLLFEED = 0xAA;
	PLLFEED = 0x55;
	VPBDIV = 0x01;
	PCONP = 0x08;
	
	PINSEL0		= 0x00000005;
	UART0_LCR 	= 0x83;
	baud_rate	= UART_BAUD(baud);
	printf("%d\n",baud_rate);	// it's giving 210 after 
that above calculation.
	UART0_DLL 	= (uint8_t)(baud_rate);                // 
set for baud low byte
  	UART0_DLM 	= (uint8_t)((baud_rate) >> 8);         // 
set for baud high byte
	printf("%x\n",UART0_DLL);
	printf("%x\n",UART0_DLM);	
	UART0_LCR 	= 0x03;		
	
	UART0_IER 	= 0x00;                         // disable 
all interrupts
  	
  	UART0_THR 	= 0x0;                              // clear 
line status register
	UART0_FCR 	= 0x01;
	UART0_THR 	= 'A';
	while(1)
	{	
		printf("Hello World..\n");
		printf("Welcome to LPC 2106 target board...\n");
		UART0_THR = 'B';
		delay(10000);
		
		while((UART0_LSR & 0x60) == 0);
		
	}
	return 0;
}
void delay(unsigned long int count)
{
	for(i=0;i<=count;i++)
	{
	}
}


**************************************

Regards,
-Srinivas.

Re: UART 0 problem in LPC2106

2005-02-08 by Gus

Srinivas,

Like I told you on chat! you have many things that can go wrong.

1) freq. multiplier/divider
2) power enable fro UART
3) pin configuration
4) your printf may not be using the UART at all
5) the baud rate registers
6) UART0 or UART1

You can post your code and someone will take a look at it if you 
want. or you can start with someone's code.

What board are you using?

Gus

--- In lpc2000@yahoogroups.com, Srinivasa Reddy Mannem 
<mannem_sri@y...> wrote:
> Hi,
>  
> I am working LPC2106 target board.
>  
> I am trying to write some data to hyper terminal using serial port 
( UART 0 ).
>  
> But i couldn't get that.
>  
> The crystal frequency of the board what i am using is 10MHz. And i 
set the baud rate as 9600.
>  
> To trace that i have included some printf statements in between my 
program.
>  
> I am getting those printf messages without any fail.
>  
> Then why i am not getting any charecter in hyper terminal window. 
>  
> Please go through the attached hello.c program and let me know 
where i am doing mistake.
Show quoted textHide quoted text
>  
> Looking forward to hear from you.
>  
> Regards,
> -Srinivas.
>  
>  
> 
> 
> 		
> ---------------------------------
> Do you Yahoo!?
>  Yahoo! Mail - Easier than ever with enhanced search. Learn more.
> 
> [Non-text portions of this message have been removed]

RE: [lpc2000] Re: UART 0 problem in LPC2106

2005-02-08 by Srinivas

Gus,

The board is from MPE.

You can get the board details what I am using this link..

http://www.mpeltd.demon.co.uk/usbstamp.htm

I have already posted my code..

I didn't get any example code to follow that..

If you have please send it to me.

I think I have done all settings properly.

Regards,
-Srinivas.

Thanks and best regards,
Srinivas,
ARM-ODC, 
Tata Elxsi,
Office : +91 80 22979581
Mobile : +91 98802 72705
Show quoted textHide quoted text
-----Original Message-----
From: Gus [mailto:gus_is_working@...]
Sent: Tuesday, February 08, 2005 7:49 PM
To: lpc2000@yahoogroups.com
Subject: [lpc2000] Re: UART 0 problem in LPC2106




Srinivas,

Like I told you on chat! you have many things that can go wrong.

1) freq. multiplier/divider
2) power enable fro UART
3) pin configuration
4) your printf may not be using the UART at all
5) the baud rate registers
6) UART0 or UART1

You can post your code and someone will take a look at it if you 
want. or you can start with someone's code.

What board are you using?

Gus

--- In lpc2000@yahoogroups.com, Srinivasa Reddy Mannem 
<mannem_sri@y...> wrote:
> Hi,
>  
> I am working LPC2106 target board.
>  
> I am trying to write some data to hyper terminal using serial port 
( UART 0 ).
>  
> But i couldn't get that.
>  
> The crystal frequency of the board what i am using is 10MHz. And i 
set the baud rate as 9600.
>  
> To trace that i have included some printf statements in between my 
program.
>  
> I am getting those printf messages without any fail.
>  
> Then why i am not getting any charecter in hyper terminal window. 
>  
> Please go through the attached hello.c program and let me know 
where i am doing mistake.
>  
> Looking forward to hear from you.
>  
> Regards,
> -Srinivas.
>  
>  
> 
> 
> 		
> ---------------------------------
> Do you Yahoo!?
>  Yahoo! Mail - Easier than ever with enhanced search. Learn more.
> 
> [Non-text portions of this message have been removed]





 
Yahoo! Groups Links

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.