Yahoo Groups archive

Lpc2000

Index last updated: 2026-04-28 23:31 UTC

Message

Re: UART baudrate

2006-03-02 by icapapindi

Can I do it with PLL_MULT=1? I use the Xtal frecuency without PLL, I'm
using these values:

PCLK = 10 Mhz
Divisor = 4
MULVAL = 14
DIVAddVal = 5

With these values It is suppose to get 115.131 bps, but when I test
with the oscilloscope the frecuency is about 128 Kbps. The code I used is:
---------------------------------------------------
unsigned int divisor=5;
UART1_LCR = 0x83; /* 8 bit, 1 stop bit, no parity, enable DLAB */
UART1_FDR=(UART1_FDR & 0xFFFFFF00) | 0xE5;
UART1_DLL = divisor & 0xFF;
UART1_DLM = (divisor >> 8) & 0xFF;
UART1_LCR &= ~0x80; /* Disable DLAB */
PCB_PINSEL0 = PCB_PINSEL0 & ~0x0F0000 | 0x050000;
UART1_FCR = 1;
----------------------------------------------------

Thanks

--- In lpc2000@yahoogroups.com, Tom Walsh <tom@...> wrote:
>
> Iván Cayón wrote:
> 
> >Hi !!
> >I'm trying to send data with the UART at 115200 bps with a Xtal of
10 Mhz and 
> >the PC doesn't receive the data correctly. Is the baud rate limited
with this 
> >equation?
> >
> >ratemax = PCLK / (16 x (2 + databits + paritybits + stopbits)
> >
> >  
> >
> Crystal: 10000000
> PLL MULT: 4
> Periph Bus Div: 2
> divisor: 4167  desired: 300  actual: 299.976  error: -0.008%
> divisor: 2083  desired: 600  actual: 600.096  error: 0.016%
> divisor: 1042  desired: 1200  actual: 1199.616  error: -0.032%
> divisor: 521  desired: 2400  actual: 2399.232  error: -0.032%
> divisor: 260  desired: 4800  actual: 4807.692  error: 0.1602%
> divisor: 130  desired: 9600  actual: 9615.384  error: 0.1602%
> divisor: 65  desired: 19200  actual: 19230.769  error: 0.1602%
> divisor: 33  desired: 38400  actual: 37878.787  error: -1.3573%
> divisor: 22  desired: 57600  actual: 56818.181  error: -1.3573%
> divisor: 11  desired: 115200  actual: 113636.363  error: -1.3573%
> divisor: 5  desired: 230400  actual: 250000  error: 8.5069%
> 
> 
> >if this is correct then I can't get this baudrate with 10 Mhz xtal
> >
> >Regards, 
> >
> >Ivan
> >
> >
> > 
> >Yahoo! Groups Links
> >
> >
> >
> > 
> >
> >
> >
> >
> >
> >  
> >
> 
> 
> -- 
> Tom Walsh - WN3L - Embedded Systems Consultant
> http://openhardware.net, http://cyberiansoftware.com
> "Windows? No thanks, I have work to do..."
> ----------------------------------------------------
>

Attachments

Move to quarantaine

This moves the raw source file on disk only. The archive index is not changed automatically, so you still need to run a manual refresh afterward.