LPC2214 BAUD RATE CHANGE

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

LPC2214 BAUD RATE CHANGE

639 Views
patduggan
Contributor I

I'm using the LPC2214 as a controller on one of our controller boards. We normally communicate with this @ 115200 baud, which is quite sufficient for our application. We are now trying to change this baud to 460800 on the fly, such that we can download data to it faster. We do this by firstly sending a command to the controller, which it interprets and changes the baud rate. We can then send the data at the higher speed, before we resend the command to reset the baud rate back to 115200. The code is working quite well, for a limited number of changes of baud. However on the 8th attempt of baud rate change, the processor hangs... or I actually loose communications with it. Looking at the interrupts, THRE has been set. Can you please point me in a direction that can help me?

Original Attachment has been moved to: uart_code.txt.zip

Labels (1)
0 Kudos
1 Reply

409 Views
jamesbone
NXP TechSupport
NXP TechSupport

Hello Pat,

I see from your code,  in the Baud Rate Init,

 U1LCR = 0x83;               /* 8 bits, no Parity, 1 Stop bit    */
    Fdiv = ( Fpclk / 16 ) / baudrate ;              /*baud rate */
    U1DLM = Fdiv / 256;
    U1DLL = Fdiv % 256;    
    U1LCR = 0x03;               /* DLAB = 0                         */
    U1FCR = 0x07;    

That you are not quite following the Algorithm recommeded by the LPC2124. PLease check Figure 28.  Page 154.  I think the way you add DLM and DLL values without using the Table from the manual it is causing the freeze.


Have a great day,
Jaime

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

0 Kudos