Hi, Teng,
Regarding your question, I suppose that the incorrect baudrate leads to the issue.
From the code, it seems that the oscillator clock frequency is 12MHz, the cpu core clock frequency FCCLK is 12*8=96MHz, the uart0 driving clock frequency FPCLK is 96MHz/4=24MHz.
Pls confirm whether the peripheral clock is 24MHz, you can output FCCLK signal to CLKOUT pin and use scope to measure the frequency.
usFdiv = (FPCLK / 16) / baudrate;
LPC_UART0->DLM = usFdiv / 256; //LPC_UART0->DLM = usFdiv>>8;
LPC_UART0->DLL = usFdiv&0xFF;
BTW, I suppose you have to write the
PCLKSEL0&=~(0x03<<6); //select FCLK/4
Hope it can help you
BR
XiangJun Rong