Yahoo Groups archive

Lpc2000

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

Thread

UART0 and UART1 baud rate calculations

UART0 and UART1 baud rate calculations

2006-02-23 by dodge1955

Has anyone ever done some type of spreadsheet on the different UxDLL
and UxDLM values along with MULVAL and DIVVAL for the most popular
crystals to make the baud rate come out perfect (like 9600, 19200,
etc).  The manual has the examples for 20Mhz, but it would be nice to
have some appendix that has a table of values that come out even for a
variety of commonly used crystals.  11.059Mhz is obviously an easy
one, but others like 12Mhz, 15Mhz, etc. are not as easy and I know
some crystals may not have a perfect value and thus have an error factor.

Sutton - dodge55

RE: [lpc2000] UART0 and UART1 baud rate calculations

2006-02-23 by Joel Winarske

Hi Sutton,

> Has anyone ever done some type of spreadsheet on the different UxDLL
> and UxDLM values along with MULVAL and DIVVAL for the most popular
> crystals to make the baud rate come out perfect (like 9600, 19200,
> etc).  The manual has the examples for 20Mhz, but it would be nice to
> have some appendix that has a table of values that come out even for a
> variety of commonly used crystals.  11.059Mhz is obviously an easy
> one, but others like 12Mhz, 15Mhz, etc. are not as easy and I know
> some crystals may not have a perfect value and thus have an error factor.

I wrote this utility for the fractional divide enabled UART parts.  It
prints out % error from lowest to highest.  It's not useful for non-fdr
enabled parts.  I'll update in the next week or so for fractional divider
challenged parts.  Perhaps I'll make it a Win32 app as well.

http://groups.yahoo.com/group/lpc2000/files/Tools/lpc2fdcalc.exe


Joel

Re: [lpc2000] UART0 and UART1 baud rate calculations

2006-02-24 by Bill Knight

Crystals that are integer multiples of 1.8432MHz can be used to create
BAUD rates with 0% error.  High/low values for the part & PLL obviously
must be observed.

Regards
-Bill Knight
R O SoftWare
Show quoted textHide quoted text
On Thu, 23 Feb 2006 22:04:59 +0000, dodge1955 wrote:

>Has anyone ever done some type of spreadsheet on the different UxDLL
>and UxDLM values along with MULVAL and DIVVAL for the most popular
>crystals to make the baud rate come out perfect (like 9600, 19200,
>etc).  The manual has the examples for 20Mhz, but it would be nice to
>have some appendix that has a table of values that come out even for a
>variety of commonly used crystals.  11.059Mhz is obviously an easy
>one, but others like 12Mhz, 15Mhz, etc. are not as easy and I know
>some crystals may not have a perfect value and thus have an error factor.

>Sutton - dodge55 





> 
>Yahoo! Groups Links



>

Re: [lpc2000] UART0 and UART1 baud rate calculations

2006-02-25 by Tom Walsh

dodge1955 wrote:

>Has anyone ever done some type of spreadsheet on the different UxDLL
>and UxDLM values along with MULVAL and DIVVAL for the most popular
>crystals to make the baud rate come out perfect (like 9600, 19200,
>etc).  The manual has the examples for 20Mhz, but it would be nice to
>have some appendix that has a table of values that come out even for a
>variety of commonly used crystals.  11.059Mhz is obviously an easy
>one, but others like 12Mhz, 15Mhz, etc. are not as easy and I know
>some crystals may not have a perfect value and thus have an error factor.
>
>Sutton - dodge55 
>
>  
>
I did a perl script just to calculate errors of the LPC2106 & LPC2138 
processors based on crystal frequency:

=============== begin baudrates.pl ==================
#!/usr/bin/perl
#
# this determines the degree of error between desired and actual
# baudrates on the LPC21xx processors.
#
my $FREQ = 14745000;
my $PLL_MUL = 4;
my $PBSD = 2;
my $CCLK = ($FREQ * $PLL_MUL);
my $PCLK = ($CCLK / $PBSD);
#my $PCLK = 20000000;
my @commonRates = 
(300,600,1200,2400,4800,9600,19200,38400,57600,115200,230400);

#define UART_BAUD(baud) (uint16_t)((PCLK / ((baud) * 16.0)) + 0.5)

sub calcBaud {
my $desired = $_[0];
my $divisor = int(($PCLK / ($desired*16.0))+ 0.5);
my $actual = int(($PCLK / (16*$divisor)) * 1000) / 1000;
my $error = int((($actual - $desired) / $desired) * 1000000) / 10000;
   print "divisor: ${divisor}  desired: ${desired}  ".
      "actual: ${actual}  error: ${error}%\n";
}

   while (@commonRates) {
      calcBaud (shift(@commonRates));

================== snip =======================



-- 
Tom Walsh - WN3L - Embedded Systems Consultant
http://openhardware.net, http://cyberiansoftware.com
"Windows? No thanks, I have work to do..."
----------------------------------------------------

Re: [lpc2000] UART0 and UART1 baud rate calculations

2006-02-25 by Tom Walsh

Joel Winarske wrote:

>Hi Sutton,
>
>  
>
>>Has anyone ever done some type of spreadsheet on the different UxDLL
>>and UxDLM values along with MULVAL and DIVVAL for the most popular
>>crystals to make the baud rate come out perfect (like 9600, 19200,
>>etc).  The manual has the examples for 20Mhz, but it would be nice to
>>have some appendix that has a table of values that come out even for a
>>variety of commonly used crystals.  11.059Mhz is obviously an easy
>>one, but others like 12Mhz, 15Mhz, etc. are not as easy and I know
>>some crystals may not have a perfect value and thus have an error factor.
>>    
>>
>
>I wrote this utility for the fractional divide enabled UART parts.  It
>prints out % error from lowest to highest.  It's not useful for non-fdr
>enabled parts.  I'll update in the next week or so for fractional divider
>challenged parts.  Perhaps I'll make it a Win32 app as well.
>
>  
>
Why?  Why not make it a perl app and then everyone can use it?

Regards,

TomW

-- 
Tom Walsh - WN3L - Embedded Systems Consultant
http://openhardware.net, http://cyberiansoftware.com
"Windows? No thanks, I have work to do..."
----------------------------------------------------

RE: [lpc2000] UART0 and UART1 baud rate calculations

2006-02-25 by Joel Winarske

Hi Tom,

> >I wrote this utility for the fractional divide enabled UART parts.  It
> >prints out % error from lowest to highest.  It's not useful for non-fdr
> >enabled parts.  I'll update in the next week or so for fractional divider
> >challenged parts.  Perhaps I'll make it a Win32 app as well.
> >
> Why?  Why not make it a perl app and then everyone can use it?

How about as a java swing applet hosted in a web page instead?  Sort of a
spreadsheet style that you can copy data from.  Then anyone with a web
browser can use it.  I am referring to fractional divide calculations. 

Joel

Re: [lpc2000] UART0 and UART1 baud rate calculations

2006-02-25 by Tom Walsh

Joel Winarske wrote:

>Hi Tom,
>
>  
>
>>>I wrote this utility for the fractional divide enabled UART parts.  It
>>>prints out % error from lowest to highest.  It's not useful for non-fdr
>>>enabled parts.  I'll update in the next week or so for fractional divider
>>>challenged parts.  Perhaps I'll make it a Win32 app as well.
>>>
>>>      
>>>
>>Why?  Why not make it a perl app and then everyone can use it?
>>    
>>
>
>How about as a java swing applet hosted in a web page instead?  Sort of a
>spreadsheet style that you can copy data from.  Then anyone with a web
>browser can use it.  I am referring to fractional divide calculations. 
>
>  
>
Webpage would probably make it more useful than a EXE file.  I do have 
Windows NT running inside VMWare so I can run a couple of apps, but that 
is it.

I was just pointing out that not everyone has Windows on a machine and 
that some of that do don't the latest & greatest (TM - Microsoft).


TomW


>Joel
>
>
>
>
> 
>Yahoo! Groups Links
>
>
>
> 
>
>
>  
>


-- 
Tom Walsh - WN3L - Embedded Systems Consultant
http://openhardware.net, http://cyberiansoftware.com
"Windows? No thanks, I have work to do..."
----------------------------------------------------

Re: UART0 and UART1 baud rate calculations

2006-02-26 by roger_lynx

Hi Sutton,

You might want to look at this LPC214x FractCalc I put together with a
PLL calculator, PDF and ASCII viewers.
It is a Win GUI applet; subject to continuous improvements, but usable.
Check the bottom of this page:
http://www.rogerlynx.com/html/support.html
<http://www.rogerlynx.com/html/support.html>

Hope this helps.

Roger

--- In lpc2000@yahoogroups.com, "dodge1955" <sutton@...> wrote:
>
> Has anyone ever done some type of spreadsheet on the different UxDLL
> and UxDLM values along with MULVAL and DIVVAL for the most popular
> crystals to make the baud rate come out perfect (like 9600, 19200,
> etc).  The manual has the examples for 20Mhz, but it would be nice to
> have some appendix that has a table of values that come out even for a
> variety of commonly used crystals.  11.059Mhz is obviously an easy
> one, but others like 12Mhz, 15Mhz, etc. are not as easy and I know
> some crystals may not have a perfect value and thus have an error
factor.
>
> Sutton - dodge55
>



[Non-text portions of this message have been removed]

Re: UART0 and UART1 baud rate calculations

2006-02-26 by kathy_wright_ca

I like simple solutions, and I have an Excel solution that also makes 
it easy to see what's going on, and it includes accuracy 
calculations.  

I can email to you if you like 

Kathy Wright


> 
> --- In lpc2000@yahoogroups.com, "dodge1955" <sutton@> wrote:
> >
> > Has anyone ever done some type of spreadsheet on the different 
UxDLL
> > and UxDLM values along with MULVAL and DIVVAL for the most popular
> > crystals to make the baud rate come out perfect (like 9600, 19200,
> > etc).  The manual has the examples for 20Mhz, but it would be 
nice to
> > have some appendix that has a table of values that come out even 
for a
Show quoted textHide quoted text
> > variety of commonly used crystals.  11.059Mhz is obviously an easy
> > one, but others like 12Mhz, 15Mhz, etc. are not as easy and I know
> > some crystals may not have a perfect value and thus have an error
> factor.
> >
> > Sutton - dodge55
> >
> 
> 
> 
> [Non-text portions of this message have been removed]
>

Re: [lpc2000] Re: UART0 and UART1 baud rate calculations

2006-02-26 by Branko Karaklajic

Hello everyone,

I successfully booted uClinux on LPC2292 with external 4MB flash and
4MB RAM!

But I started kernel only when I load image and romfs with JTAG to RAM
and then start it from that address.

Now I must wrote bootloader. I have functions for initialization of
external memory interfaces, loading images from flash to ram, and that
is OK, but when I want to JUMP to start address of kernel... board
reboots... This is part for jumping to kernel...

---CODE---
void kernel_jump()
{
     void (*kernelstart)(void);

     //KERNEL_START=0x81008000;

     kernelstart = (void (*)(void))KERNEL_START;
     (*kernelstart)();
     
}
-END CODE-

Anyone have idea what is wrong, or some code sample to jump to start
of kernel..., can be in assembler...

thank you in advance
Branko Karaklajic

--
Best regards

Problem on starting uClinux on LPC2292...

2006-02-26 by Branko Karaklajic

Hello everyone,

this is REPOST because of wrong subject on earlier message. I didn't
want to hijack tread... sorry

---

I successfully booted uClinux on LPC2292 with external 4MB flash and
4MB RAM!

But I started kernel only when I load image and romfs with JTAG to RAM
and then start it from that address.

Now I must wrote bootloader. I have functions for initialization of
external memory interfaces, loading images from flash to ram, and that
is OK, but when I want to JUMP to start address of kernel... board
reboots... This is part for jumping to kernel...

---CODE---
void kernel_jump()
{
     void (*kernelstart)(void);

     //KERNEL_START=0x81008000;

     kernelstart = (void (*)(void))KERNEL_START;
     (*kernelstart)();
     
}
-END CODE-

Anyone have idea what is wrong, or some code sample to jump to start
of kernel...

thank you in advance
Branko Karaklajic
-- 
Best regards,
 orpid.co.yu

Re: [lpc2000] Problem on starting uClinux on LPC2292...

2006-02-26 by Bertrik Sikken

Branko Karaklajic wrote:
> Hello everyone,
> 
> this is REPOST because of wrong subject on earlier message. I didn't
> want to hijack tread... sorry
> 
> ---
> 
> I successfully booted uClinux on LPC2292 with external 4MB flash and
> 4MB RAM!
> 
> But I started kernel only when I load image and romfs with JTAG to RAM
> and then start it from that address.
> 
> Now I must wrote bootloader. I have functions for initialization of
> external memory interfaces, loading images from flash to ram, and that
> is OK, but when I want to JUMP to start address of kernel... board
> reboots... This is part for jumping to kernel...
> 
> ---CODE---
> void kernel_jump()
> {
>      void (*kernelstart)(void);
> 
>      //KERNEL_START=0x81008000;
> 
>      kernelstart = (void (*)(void))KERNEL_START;
>      (*kernelstart)();
>     
> }
> -END CODE-
> 
> Anyone have idea what is wrong, or some code sample to jump to start
> of kernel...

I think it's not needed to dereference kernelstart.
Try invoking kernelstart simply as follows:
kernelstart();

Can you follow where it is going when doing this call with the
JTAG debugger?

Regards,
Bertrik

Re[2]: [lpc2000] Problem on starting uClinux on LPC2292...

2006-02-27 by Branko Karaklajic

Hello Bertrik,


BS> Branko Karaklajic wrote:
>> Hello everyone,
>> 
>> this is REPOST because of wrong subject on earlier message. I didn't
>> want to hijack tread... sorry
>> 
>> ---
>> 
>> I successfully booted uClinux on LPC2292 with external 4MB flash and
>> 4MB RAM!
>> 
>> But I started kernel only when I load image and romfs with JTAG to RAM
>> and then start it from that address.
>> 
>> Now I must wrote bootloader. I have functions for initialization of
>> external memory interfaces, loading images from flash to ram, and that
>> is OK, but when I want to JUMP to start address of kernel... board
>> reboots... This is part for jumping to kernel...
>> 
>> ---CODE---
>> void kernel_jump()
>> {
>>      void (*kernelstart)(void);
>> 
>>      //KERNEL_START=0x81008000;
>> 
>>      kernelstart = (void (*)(void))KERNEL_START;
>>      (*kernelstart)();
>>     
>> }
>> -END CODE-
>> 
>> Anyone have idea what is wrong, or some code sample to jump to start
>> of kernel...

BS> I think it's not needed to dereference kernelstart.
BS> Try invoking kernelstart simply as follows:
BS> kernelstart();

BS> Can you follow where it is going when doing this call with the
BS> JTAG debugger?

BS> Regards,
BS> Bertrik

Hm... I try that after I wrote letter to group... Very strange
behavior... if I do single step through that function and first few
assembly instruction of kernel... everything is fine..., but if I run
it on the full speed, I get garbage on console and reboot. Maybe
problem with oscillator configuration... I'm going to check that..

Any other suggestion!?

-- 
Best regards,
 Branko Karaklajic

Re[3]: [lpc2000][SOLVED] Problem on starting uClinux on LPC2292...

2006-02-27 by Branko Karaklajic

Hello Branko,

Problem is solved. If PLL is ON in bootloader, everything hang when
jump to kernel... Without PLL uClinux is runing with 7.21 BogoMIPS!

Thanx

BS>> Branko Karaklajic wrote:
>>> Hello everyone,
>>> 
>>> this is REPOST because of wrong subject on earlier message. I didn't
>>> want to hijack tread... sorry
>>> 
>>> ---
>>> 
>>> I successfully booted uClinux on LPC2292 with external 4MB flash and
>>> 4MB RAM!
>>> 
>>> But I started kernel only when I load image and romfs with JTAG to RAM
>>> and then start it from that address.
>>> 
>>> Now I must wrote bootloader. I have functions for initialization of
>>> external memory interfaces, loading images from flash to ram, and that
>>> is OK, but when I want to JUMP to start address of kernel... board
>>> reboots... This is part for jumping to kernel...
>>> 
>>> ---CODE---
>>> void kernel_jump()
>>> {
>>>      void (*kernelstart)(void);
>>> 
>>>      //KERNEL_START=0x81008000;
>>> 
>>>      kernelstart = (void (*)(void))KERNEL_START;
>>>      (*kernelstart)();
>>>     
>>> }
>>> -END CODE-
>>> 
>>> Anyone have idea what is wrong, or some code sample to jump to start
>>> of kernel...

BS>> I think it's not needed to dereference kernelstart.
BS>> Try invoking kernelstart simply as follows:
BS>> kernelstart();

BS>> Can you follow where it is going when doing this call with the
BS>> JTAG debugger?

BS>> Regards,
BS>> Bertrik

BK> Hm... I try that after I wrote letter to group... Very strange
BK> behavior... if I do single step through that function and first few
BK> assembly instruction of kernel... everything is fine..., but if I run
BK> it on the full speed, I get garbage on console and reboot. Maybe
BK> problem with oscillator configuration... I'm going to check that..

BK> Any other suggestion!?


-- 
Best regards,
 Branko Karaklajic

Re: UART0 and UART1 baud rate calculations

2006-02-27 by mhoneywill

Hi Roger,

Great program, thanks. One feature that would be great as well as
supporting non FBR LPC's is the ability to manually edit the required
baudrate field. i.e. if I wanted to run at 250000 baud (DMX) or 31250
baud (MIDI) or some other non standard rate. 

Thanks again for the tool, just some ideas for improvements.

Cheers

Martin

--- In lpc2000@yahoogroups.com, "roger_lynx" <roger_lynx@...> wrote:
Show quoted textHide quoted text
> You might want to look at this LPC214x FractCalc I put together with a
> PLL calculator, PDF and ASCII viewers.
> It is a Win GUI applet; subject to continuous improvements, but usable.
> Check the bottom of this page:
> http://www.rogerlynx.com/html/support.html
> <http://www.rogerlynx.com/html/support.html>
> 
> Hope this helps.
> 
> Roger
>

Re: [lpc2000] Re: UART0 and UART1 baud rate calculations

2006-03-02 by Tong Le

Hi Mrs. Wright
  Could you email me that also?
  Thank you.
  

kathy_wright_ca <kathy_wright_ca@...> wrote:
  I like simple solutions, and I have an Excel solution that also makes 
it easy to see what's going on, and it includes accuracy 
calculations.  

I can email to you if you like 

Kathy Wright


> 
> --- In lpc2000@yahoogroups.com, "dodge1955" <sutton@> wrote:
> >
> > Has anyone ever done some type of spreadsheet on the different 
UxDLL
> > and UxDLM values along with MULVAL and DIVVAL for the most popular
> > crystals to make the baud rate come out perfect (like 9600, 19200,
> > etc).  The manual has the examples for 20Mhz, but it would be 
nice to
> > have some appendix that has a table of values that come out even 
for a
> > variety of commonly used crystals.  11.059Mhz is obviously an easy
> > one, but others like 12Mhz, 15Mhz, etc. are not as easy and I know
> > some crystals may not have a perfect value and thus have an error
> factor.
> >
> > Sutton - dodge55
> >
> 
> 
> 
> [Non-text portions of this message have been removed]
>







  SPONSORED LINKS 
        Microcontrollers   Microprocessor   Intel microprocessors     Pic microcontrollers 
    
---------------------------------
  YAHOO! GROUPS LINKS 

    
    Visit your group "lpc2000" on the web.
    
    To unsubscribe from this group, send an email to:
 lpc2000-unsubscribe@yahoogroups.com
    
    Your use of Yahoo! Groups is subject to the Yahoo! Terms of Service. 

    
---------------------------------
  



			
---------------------------------
 Yahoo! Mail
 Use Photomail to share photos without annoying attachments.

[Non-text portions of this message have been removed]

Re: UART0 and UART1 baud rate calculations

2006-03-02 by mhaines4102

I would like a copy as well if you don't mind. 




--- In lpc2000@yahoogroups.com, Tong Le <gaquaycalifornia@...> wrote:
>
> Hi Mrs. Wright
>   Could you email me that also?
>   Thank you.
>   
> 
> kathy_wright_ca <kathy_wright_ca@...> wrote:
>   I like simple solutions, and I have an Excel solution that also makes 
> it easy to see what's going on, and it includes accuracy 
> calculations.  
> 
> I can email to you if you like 
> 
> Kathy Wright
> 
> 
> > 
> > --- In lpc2000@yahoogroups.com, "dodge1955" <sutton@> wrote:
> > >
> > > Has anyone ever done some type of spreadsheet on the different 
> UxDLL
> > > and UxDLM values along with MULVAL and DIVVAL for the most popular
> > > crystals to make the baud rate come out perfect (like 9600, 19200,
> > > etc).  The manual has the examples for 20Mhz, but it would be 
> nice to
> > > have some appendix that has a table of values that come out even 
> for a
> > > variety of commonly used crystals.  11.059Mhz is obviously an easy
> > > one, but others like 12Mhz, 15Mhz, etc. are not as easy and I know
> > > some crystals may not have a perfect value and thus have an error
> > factor.
> > >
> > > Sutton - dodge55
> > >
> > 
> > 
> > 
> > [Non-text portions of this message have been removed]
> >
> 
> 
> 
> 
> 
> 
> 
>   SPONSORED LINKS 
>         Microcontrollers   Microprocessor   Intel microprocessors  
  Pic microcontrollers 
>     
> ---------------------------------
>   YAHOO! GROUPS LINKS 
> 
>     
>     Visit your group "lpc2000" on the web.
>     
>     To unsubscribe from this group, send an email to:
>  lpc2000-unsubscribe@yahoogroups.com
>     
>     Your use of Yahoo! Groups is subject to the Yahoo! Terms of
Service. 
Show quoted textHide quoted text
> 
>     
> ---------------------------------
>   
> 
> 
> 
> 			
> ---------------------------------
>  Yahoo! Mail
>  Use Photomail to share photos without annoying attachments.
> 
> [Non-text portions of this message have been removed]
>

Re: [lpc2000] Re: UART0 and UART1 baud rate calculations

2006-03-03 by philipp1024@web.de

Hi,
may I have it too. Or could you  upload it to the LPC200 file section?

Thanks
Philipp

lpc2000@yahoogroups.com schrieb am 02.03.06 07:33:23:
> 
> Hi Mrs. Wright
>   Could you email me that also?
>   Thank you.
>   
> 
> kathy_wright_ca <kathy_wright_ca@...> wrote:
>   I like simple solutions, and I have an Excel solution that also makes 
> it easy to see what's going on, and it includes accuracy 
> calculations.  
> 
> I can email to you if you like 
> 
> Kathy Wright
> 
> 
> > 
> > --- In lpc2000@yahoogroups.com, "dodge1955" <sutton@> wrote:
> > >
> > > Has anyone ever done some type of spreadsheet on the different 
> UxDLL
> > > and UxDLM values along with MULVAL and DIVVAL for the most popular
> > > crystals to make the baud rate come out perfect (like 9600, 19200,
> > > etc).  The manual has the examples for 20Mhz, but it would be 
> nice to
> > > have some appendix that has a table of values that come out even 
> for a
> > > variety of commonly used crystals.  11.059Mhz is obviously an easy
> > > one, but others like 12Mhz, 15Mhz, etc. are not as easy and I know
> > > some crystals may not have a perfect value and thus have an error
> > factor.
> > >
> > > Sutton - dodge55
> > >
> > 
> > 
> > 
> > [Non-text portions of this message have been removed]
> >
> 
> 
> 
> 
> 
> 
> 
>   SPONSORED LINKS 
>         Microcontrollers   Microprocessor   Intel microprocessors     Pic microcontrollers 
>     
> ---------------------------------
>   YAHOO! GROUPS LINKS 
> 
>     
>     Visit your group "lpc2000" on the web.
>     
>     To unsubscribe from this group, send an email to:
>  lpc2000-unsubscribe@yahoogroups.com
>     
>     Your use of Yahoo! Groups is subject to the Yahoo! Terms of Service. 
> 
>     
> ---------------------------------
>   
> 
> 
> 
> 			
> ---------------------------------
>  Yahoo! Mail
>  Use Photomail to share photos without annoying attachments.
> 
> [Non-text portions of this message have been removed]
> 
> 
> 
>  
> Yahoo! Groups Links
> 
> 
> 
>  
> 
> 


______________________________________________________________
Verschicken Sie romantische, coole und witzige Bilder per SMS!
Jetzt bei WEB.DE FreeMail: http://f.web.de/?mc=021193

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.