#define CR     0x0D

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

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

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

  
  return (UART0_THR = ch);
}


