LPC17xx Fractional Baud Rate Calculator

Discussion created by lpcware Employee on Jun 15, 2016
Latest reply on Jun 15, 2016 by lpcware
Content originally posted in LPCWare by toby on Tue Sep 04 07:30:59 MST 2012
Hey there. :)  First time poster but I've been lurking for a while.  I've gotten some helpful insight and tips here just from reading answers to other people's questions, so I figured it was as good a time as ever to give something back.

I've been toying with picking the best fractional rates with my EA LPC1769 board for my given clock rates and desired baud rates.  Unless you're running a clock that divides cleanly, you're stuck with fractional rates to get as close as possible.  After trying to figure out the numbers by hand, I said screw it and made a Google Docs spreadsheet to do the heavy lifting for me.

Here's what you do:

- specify your core clock
- specify your desired baud rate
- it calculates the potential peripheral clocks you could achieve (based on available dividers)
- for each peripheral clock, it generates the appropriate estimated FRs within the range of 1.1 to 1.9 (replicates the flowchart process, essentially)
- for all the given FRs, it creates a row for each where it shows the resulting baud rate and error %

All the possible FR combinations are already pumped in so once you've given it a core clock and baud rate, it will auto-update its tables and show you all the possible combinations and their error %.  The error % is highlighted anywhere from red all the way to green to indicate how close of a match to your target baud rate it is.

It will give you the DivAddVal, MulVal and DL so you can pump the values right into your code and be up and running in no time.

Here it is: https://docs.google.com/spreadsheet/ccc?key=0Atbyhsv78i49dHlocklLLWtFbThrVmUxTzZ5SnJPbHc

You can see where I've been trying to find this best core clock to yield super low error rates for 115200, 10400 and 9600 baud rates.  If you're logged into a Google account, you can go to File -> Make a Copy to copy it to your Google Docs and configure your own rates, etc.

Let me know if you have any questions... I hope somebody besides me finds this useful. :)