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

UART Simulator don't work

Hello all,
i try to execute the following program under µVision-V4.00-Simulator but the Serial Window shows nothing. By debugging the programm comes to rest upon sth putchar('A');

Please help me.

Thanks

the code is:
=======================================================
#include <LPC21xx.H>
#include <stdio.h>

int main(void)
{ UART0 (); //Initilise the UART

putchar('A');
while(1)
{ printf("\n\n\nHello World, well its traditional \n"); //Call the prinff function

}

}
/****************************************************/
void UART0 (void)
{ PINSEL0 = 0x05; // Select TxD and RxD on pin connect block
U0LCR = 0x80; //Enable programming of divisor latches

U0DLL = 0xC2; //Program the divisor latch for 19200 baud
U0DLM = 0x00;

U0LCR = 0x33; //Program the line control 8\N\1
U0FCR = 0x4F; //enable the FIFO's

} /****************************************************/
#define CR 0x0D

#include <LPC21xx.H>
int putchar (int ch);

int putchar (int ch)
{ /* Write character to Serial Port */

if (ch == '\n') { while (!(U0LSR & 0x20)); U0THR = CR; /* output CR */ } while (!(U0LSR & 0x20));

return (U0THR = ch);
}

0