This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

I dont send any char to UART at LPC2378

Hi, firstly i am sorry my bad engilsh.

I have LPC2378. I write my code. I dont understand where is my problem..Help me please.

Xtal=16Mhz
Baudrate=9600

I have DOcklight program. I want to see what I am writing in this program at Docklight ASCII screen.

my UART input/output P0.2 and P0.3

and last question is;
#define TEMT (1<<6)
#define LINE_FEED 0xA
#define CARRIAGE_RET 0xD

what do these mean?

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

#include <stdio.h>
#include <LPC23xx.H>

void Initialize(void);

#define TEMT (1<<6)
#define LINE_FEED 0xA
#define CARRIAGE_RET 0xD

int main()
{ int i;
char c[]="Digital Tanima Sistemleri";

Initialize();

while(1)
{ i=0;

while(c[i])
{ U0THR=c[i];
i++;
} U0THR=LINE_FEED;
U0THR=CARRIAGE_RET;

/* Wait till U0THR and U0TSR are both empty */
while(!(U0LSR & TEMT)){} //??
} }

void Initialize()
{ PINSEL0=0x50;
U0FCR=0x7;
U0LCR=0x83;
U0DLL=0x00000067;
U0DLM=0x0;
U0LCR=0x3;
}

Parents Reply Children
  • Where do your debugger see if you have the correct baudrate on the actual cable?

    Your code is not fun to read since you posted it without proper indentation.

    But an interesting thing is - how many characters can you give the UART without checking if there are room for more? What does the user manual for the processor say? A hint - have you read the descriptions about the U0LSR register in the processor user manual?