Continue to Site

Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronics Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.

LPC1225 UART0 Receive Problem

Status
Not open for further replies.

angle9

Newbie level 3
Newbie level 3
Joined
Mar 25, 2010
Messages
4
Helped
0
Reputation
0
Reaction score
0
Trophy points
1,281
Location
Jakarta
Activity points
1,314
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
Code:
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
Code:
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?

Is there any different UART0 in ISP mode and running mode? Because program download through UART0 with Flash Magic no problem.
Thanks
 

Status
Not open for further replies.

Similar threads

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top