Continue to Site

Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronics Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.

Problem with LPC2138 UART code

Status
Not open for further replies.

bandaru_sivakrishna

Newbie level 2
Joined
Sep 29, 2007
Messages
2
Helped
0
Reputation
0
Reaction score
0
Trophy points
1,281
Activity points
1,294
#include <LPC213X.H>

void delay(int);

int main()
{
unsigned long temp;
unsigned char a;

PINSEL0 = 0x5;

U0LCR = 0x83;
U0DLL = 0x61;
U0DLM = 0x00;
U0LCR = 0x03;

while(1)
{
while (!(U0LSR & 0x01)); //receive condition
a = U0RBR;
delay(10);
while (!(U0LSR & 0x20)); //transmit condition
U0THR = a;
}
}

void delay(int x)
{
unsigned int i,j;
for(i=0;i<x;i++)
for(j=0;j<113;j++);
}


this code works
 

Status
Not open for further replies.

Similar threads

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top