#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);
}


