ratan22
Newbie level 6
- Joined
- Apr 3, 2018
- Messages
- 14
- Helped
- 0
- Reputation
- 0
- Reaction score
- 0
- Trophy points
- 1
- Location
- BHUBAMESWAR
- Activity points
- 131
Can anybody please tell me how to configure UART0 of ARM7 lpc2148. I am trying to communication with pc through max232, i transmit data to pc in 9600 baudrate. i write the program for uart0 and setting the pll value and uart seting but it does not work,i check in the hyper terminal but it blank.
MY PROGRAM:-
MY PROGRAM:-
Code:
#include<lpc214x.h>
void pll()
{
PLL0CON=0X01;
PLL0CFG=0X24;
PLL0FEED=0XAA;
PLL0FEED=0X55;
while((PLL0STAT&(1<<10))==0);
PLL0CON=0X03;
PLL0FEED=0XAA;
PLL0FEED=0X55;
VPBDIV=0x01; //pclk=60mhz
}
void ser_int()
{
PINSEL0=0X00000005;
U0LCR=0X83;
U0DLL=132;
U0DLM=1;
U0LCR=0X03;
}
void tx(unsigned char c)
{
while(!(U0LSR & 0x20));
// while((U1LSR&(1<<5))==0);
U0THR=c;
}
int main(void)
{
unsigned char b;
pll();
ser_int();
while(1)
{
b='A';
tx(b);
}
}
Last edited by a moderator: