This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

LPC1225 UART0 Receive Problem

Dear all...

I am developing GPS system using LPC1225.

Cause, this is new for me, before I used LPC2103, so I test this with simple UART send and receive.

Here is the serial init function

void SER_init (void) {

  LPC_IOCON->PIO0_1  =  (2UL <<  0);
  LPC_IOCON->PIO0_2  =  (2UL <<  0);
  /* configure PINs GPIO0.1, GPIO0.1 for UART0
  LPC_SYSCON->SYSAHBCLKCTRL |= ((1UL << 31) |
                                (1UL << 16) );

 /* configure UART0 115200 bps from 12MHz Internal Osc*/
  LPC_SYSCON->SYSAHBCLKCTRL |=  (1UL << 12);
  LPC_SYSCON->UART0CLKDIV    =  (2UL <<  0);

  LPC_UART0->LCR = 0x83;
  LPC_UART0->DLL = 4;
  LPC_UART0->FDR = 0x85;
  LPC_UART0->DLM = 0;
  LPC_UART0->LCR = 0x03;
}

Getkey function

int getkey (void) {

  while (!(LPC_UART0->LSR & 0x01));
  return (LPC_UART0->RBR);
}


The main function just printf and call getkey function for receive the data.
When program to flash and execute, I can send the data from MCU, but the MCU can not receive the data send from PC.

Anyone can help me about this issue? Is there something wrong with serial init function?

Thanks

Usman

0