Content originally posted in LPCWare by silex on Mon Apr 14 01:54:03 MST 2014 Hello,
I have designed a board which has LPC1110FD20 on it. I am using internal oscillator, the system runs at 12mhz. Timer32 and GPIO peripherals works as expected. An output pin is toggled on every 500ms. But problem is, UART is not working at all. As i check on oscilloscope, there is always 3.3v on UART TX pin. It does not send any data. Please find my uart init and send functions as below. I have been working on this problem for a week and still could not find a solution. I will appreciate for your help..
Thank you.
Quote: #include "LPC11xx.h" #include "timer32.h" #include "gpio.h" #include "uart.h" #include "stdio.h" #define TEST_TIMER_NUM0/* 0 or 1 for 32-bit timers only */
void sendcharCom0(char data) {
int timeout = 100000;
while(!(LPC_UART->LSR&0x20)) //Wait until TX FIFO empty flag to load a value
{
timeout--;
if(timeout == 0) break;
}
LPC_UART->THR = data;
}