lpcware

Correct UART Init PLEASE HELP

Discussion created by lpcware Employee on Jun 15, 2016
Latest reply on Jun 15, 2016 by lpcware
Content originally posted in LPCWare by drvrh on Thu Jul 23 03:47:21 MST 2015
Hello,

I initialization and send data over UART, but on my computer (FTDi convert) nothing come.

This is my initialization:
void SerialInit(uint32_t baudrate){
uint32_t DL;

LPC_IOCON -> PIO1_7= (1 << 1);
LPC_SYSCON -> SYSAHBCLKCTRL|= (1 << 12);
LPC_SYSCON -> UARTCLKDIV= 0x01;//
DL = (SystemCoreClock * LPC_SYSCON -> SYSAHBCLKDIV)/(16 * baudrate * LPC_SYSCON -> UARTCLKDIV);
LPC_UART->LCR = 0b10000011;  //  8-bit character length, DLAB enable ( DLAB = 1)
LPC_UART->DLM = DL / 256;    //  Determines the baud rate of the UART (MSB Register)     (Access DLAB = 1)
LPC_UART->DLL = DL % 256;    //  Determines the baud rate of the UART (LSB Register)     (Access DLAB = 1)
LPC_UART->LCR = 0b00000011;  //  8-bit character length , DLAB disable ( DLAB = 0)
LPC_UART->FCR = 0b00000111;
}



Here is my function for send UART
void SendSerial(unsigned char send){
while(!(LPC_UART -> LSR & (1 << 5)));
LPC_UART -> THR = send;
}


I don't know what I set uncorrect.
In main program call function SerialInit(57600). 

Please Help.
Thank you for answer.

Outcomes