Reply by Srinivas February 8, 20052005-02-08
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

-----Original Message-----
From: Gus [mailto:]
Sent: Tuesday, February 08, 2005 7:49 PM
To:
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 , 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. > ---------------------------------
>
Yahoo! Groups Links


An Engineer's Guide to the LPC2100 Series

Reply by Gus February 8, 20052005-02-08

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 , 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. > ---------------------------------
>



Reply by mannem_sri February 8, 20052005-02-08

--- In , 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.



Reply by Srinivasa Reddy Mannem February 8, 20052005-02-08
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. ---------------------------------



Re: UART 0 problem in LPC2106