lpcware

Help, I can't find out why my TxD1 does not transmit.

Discussion created by lpcware Employee on Jun 15, 2016
Latest reply on Jun 15, 2016 by lpcware
Content originally posted in LPCWare by Ronald on Thu Feb 23 08:38:22 MST 2012
:confused:
I have a problem with the UART1 port (on P0.15 and P0.16). It sends no data.
My initialisation:
void Serial_init (void)
{
// TxD: Port 0.15
// RxD: Port 0.16
LPC_PINCON->PINSEL0 |= 0x40000000;
LPC_PINCON->PINSEL1 |= 0x00000001;
LPC_PINCON->PINMODE0 |= 0x80000000;
LPC_PINCON->PINMODE1 |= 0x00000002;
// Initialisation routines
LPC_SC->PCONP |= 0x00000010; // Set PCUART bit
LPC_SC->PCLKSEL0 |= 0x00000100; // Set PCLK_UART1 to 0x01 = CCLK/1
LPC_UART1->LCR |= 0x83; // 8 bits, 1 stopbit, no parity, DLAB = 1

// Baudrate: 19.200 Baud
LPC_UART1->DLM = 0;
LPC_UART1->DLL = 52;
LPC_UART1->LCR |= 0x03; // 8 bits, 1 stopbit, no parity, DLAB = 0
LPC_UART1->FDR = 0x01; // DIVADDVAL = 0 -- MULVAL = 1
LPC_UART1->FCR |= 0x07; // FIFO Enable
LPC_UART1->TER |= 0x80;
LPC_UART1->IER |= 0x02;
}

For sending a character, I use the following code:

unsigned char UART1_PutChar (unsigned char ch)
{
while (!(LPC_UART1->LSR & 0x20));
return (LPC_UART1->THR = ch);
}

Nothing happens on TxD1.
Please, can anyone tell me why.

Outcomes