LPC11E68 USART3 baud rate

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

LPC11E68 USART3 baud rate

885 Views
Nocker
Contributor II

Hi,

I am using the LPC11E68 and am trying to configure USART3 to have a particular baud rate (115200).  I believe I have the USART working as required except for the baud rate.  I've read and re-read and the re-read (repeating many times) the user manual and cannot figure out what I'm doing wrong.

The user manual has the following formulas: 

U_PCLK = FRGCLKDIV/(1+(MULT/DIV))

baud rate = U_PCLK/(16 x BRGVAL)

and substituting you get:
baud rate = (FRGCLKDIV/(1+(MULT/DIV)))/(16 x BRGVAL)

I have set the system clock to be 36MHz, and the DIV value must be set to 0xFF.  I believe I have found good values for MULT and BRGVAL so I have come up with the following:

baud rate = ((36000000/5)/(1+(244/256)))/(16 x 2) = 115200

So I am configuring the registers as follows:

LPC_SYSCON->FRGCLKDIV = 5
LPC_SYSCON->UARTFRGDIV = 0xFF
LPC_SYSCON->UARTFRGMULT = 244

LPC_USART3->BRG = 1

Using a scope to measure the output of the USART pins, the baud rate I actually get is 225000.

Interestingly this value of 225000 is the equivalent of setting the MULT value to be 0.  I have tried randomly changing the MULT value from the min and max values and it has no effect on the baud rate of the USART.  Changing the BRGVAL does effect the baud rate of the output.

I am currently thinking that the micro has a bug in it where it always assumes a MULT value of 0.

Is there anyone who can offer some advice/suggestions on what I'm missing to be able to set the baud rate as required?

Thanks,

Chris

Labels (1)
Tags (3)
0 Kudos
Reply
1 Reply

717 Views
jeremyzhou
NXP Employee
NXP Employee

Hi Christopher Nocker,

To provide the fastest possible support, I've highly recommend you to refer to the periph_uart_rb demo for details.
pastedImage_2.png

Ping

 

-----------------------------------------------------------------------------------------------------------------------
Note: If this post answers your question, please click the Correct Answer button. Thank you!

0 Kudos
Reply