Dear all, I am new to LPC2378..Currently i am developing code for sending a character in serial port....Below i mentioned the code what i have written..but this is not working...i am using keil uvision3...Can anybody help me in this code????In my hardware DB 9 connectors rxd and txd are connected together(loopback test)
This is my code...
#include <LPC23xx.H> #include <stdio.h> void delay(int); int main (void) { PCONP |= (1<<3) /* power for uart 0 */ PINSEL0 |= 0x00000050; /* Enable TxD0 *//* Enable RxD0 */ U1LCR = 0x83; /* 8 bits, no Parity, 1 Stop bit */ U1DLM = 0x00; U1DLL = 0x78; /* 9600 Baud Rate @ 12MHz Clock */ U1FDR = 0xA3; U1LCR = 0x03; /* DLAB = 0 */ U0FCR = 0x81; while(1) { U1THR = 'A'; while (!(U1LSR && 0x40)); }
.
Sorry there is a change in the code
while (!(U1LSR & 0x20));
#include <LPC23xx.H> #include <stdio.h> void delay(int); int main (void) { PCONP |= (1<<3) /* power for uart 0 */ PINSEL0 |= 0x00000050; /* Enable TxD0 *//* Enable RxD0 */ U0LCR = 0x83; /* 8 bits, no Parity, 1 Stop bit */ U0DLM = 0x00; U0DLL = 0x78; /* 9600 Baud Rate @ 12MHz Clock */ U0FDR = 0xA3; U0LCR = 0x03; /* DLAB = 0 */ U0FCR = 0x81; while(1) { U0THR = 'A'; while (!(U0LSR && 0x40)); }
Any reason why you aren't interested in reading any data?
Sorry Ammu I am not working on serial communication.
But Mr.Per Westermark this forum is meant for clearing the doubts. If you have any suggestions kindly respond with a favorable reply... The queries are not posted to your personal account. If you are not interested others can help her. You are not the admin of this forum.
Mr per westermark
I am very new to microprocessor development and am still figuring out the way things work on the LPC2378. i had already gone to the datasheet and written this code.AS it was not working i asked the reason.How you can be so sure that i haven't read anything.
Thanks k.p coder
View all questions in Keil forum