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.

LPC2388 UART setup for even parity doesen't work

Status
Not open for further replies.

rituparnasaikia

Member level 3
Joined
Feb 1, 2006
Messages
57
Helped
3
Reputation
6
Reaction score
0
Trophy points
1,286
Location
Bangalore, India
Activity points
1,696
I want to set LPC2388's UART0 for the bellow
Baud Rate : 57600
Parity : E
Data Bit : 8
Stop Bit : 2
Flow Control : None

I have done it in this way

PINSEL0 |= 0x00000050; // Enable TxD0 and RxD0

U0LCR = 0x9F;
Fdiv = ( Fpclk / 16 ) / Baudrate; // Baud Rate
U0DLL = Fdiv % 256;
U0DLM = Fdiv / 256;
U0FDR = 0x00;
U0LCR = 0x03; // DLAB = 0
U0FCR = 0x07; // Enable and reset TX and RX FIFO.

above Baudrate = 57600
If I set the same for without Even parity it works fine but with the setting for even parity it does not work.

Added after 2 hours 37 minutes:

The working code is as given bellow

PINSEL0 |= 0x00000050; // Enable TxD0 and RxD0

U0LCR = 0x9F;
Fdiv = ( Fpclk / 16 ) / Baudrate; // Baud Rate
U0DLL = Fdiv % 256;
U0DLM = Fdiv / 256;
U0FDR = 0x00;
U0LCR &= 0x7F; // DLAB = 0
U0FCR = 0x07; // Enable and reset TX and RX FIFO.

above Baudrate = 57600
 

Status
Not open for further replies.

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top