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
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