Friendly amendment, you can run at 7.3728 MHz and as fast as 460.8 kbit/sec without any errors, this would also include the 115200 with zero error. If you do not plan to use the PLL at all, you can use this or even go down further. The secret is to select a crystal that is an integer n*16*115200 for zero error. Lowest possible frequency would be 1.843 MHz. So it is not the speed primarily, the divider which is an integer from your clock rate to the desired baudrate is the key. Closest to your desired frequency and still able to use the PLL, which requires a min of 10 MHz, would be 11.059 MHz If you use the LPC2148 or the newest LPC2103 these devices have a so called fractional baudrate generator which enables other than integer dividers and would provide accurate 115200 also with 10 MHz. Bob --- In lpc2000@yahoogroups.com, Xtian Xultz <xultz@...> wrote: > > Yes and no. > The problem is not the speed, but the divisor error. > For example, if you drive your LPC with 60MHz (10MHz*6 on PLL) you get an > enourmous error at 115200. But at 50MHz the error is lesser. > If you drive with just 14.7456 the error is zero. For any UART speed, at any > PLL configuration. > Got it? > > Em Qui 02 Mar 2006 15:10, icapapindi escreveu: > > Very good example !! > > > > I think that I did calculations correct, the problem is that I use 10 > > Mhz as core clock with pll=1 and maybe this clock is not big enought > > to get 115200 baudrate, isn't it? > > > > Thanks !! > > > > --- In lpc2000@yahoogroups.com, Xtian Xultz <xultz@> wrote: > > > Em Qui 02 Mar 2006 12:04, Iván Cayón escreveu: > > > > 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) > > > > > > > > if this is correct then I can't get this baudrate with 10 Mhz xtal > > > > > > > > Regards, > > > > > > > > Ivan > > > > > > Are you using PLL? > > > I am using right now an LPC2106 with 10MHz crystal. > > > To calculate the baudrate, you must first pick you pclk. For > > > > example, I am > > > > > using 50MHz (pll * 5) and pclk = 1 (the pclk is the same as the core > > > > clock). > > > > > So, if I have a 50MHz, first divide it by 16. I get: 3,125,000 and > > > > at that > > > > > frequency thats the clock that UART uses. > > > So, to calculate the dividers, divide that clock by the desired > > > > baudrate, > > > > > which at 115,200 gives me: 27,1267 > > > Note that I have 0,1267 as decimal error on my divider, because the > > > > divider > > > > > accpets only integer numbers. If I made the other side calculation, > > > > dividing > > > > > 3,125,000 by 27, I get 115741 bps which is the speed my LPC will talk. > > > If, for example, I make the pll running at 60MHz, my divider is 32,5521 > > > Note how big is my decimal error, is practicaly the worst case, > > > > where the > > > > > error resides in the middle betweem 0 and 1. If I use the divider as > > > > 33, my > > > > > UART speed is 113636 bps. Very bad, huh? > > > > > > So, to use 10MHz crystal, check this before. The lesser the decimal > > > > error, the > > > > > best your serial communication will be. For example, with the pclk > > > > at 10MHz, > > > > > the UART speed will be 125000bps. Try to calculate it. > > > > Yahoo! Groups Links > > > > > > >
Message
Re: UART baudrate
2006-03-03 by lpc2100_fan
Attachments
- No local attachments were found for this message.