<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>ColdFire/68K Microcontrollers and ProcessorsのトピックSystem Clock Calculation Confusion</title>
    <link>https://community.nxp.com/t5/ColdFire-68K-Microcontrollers/System-Clock-Calculation-Confusion/m-p/202061#M9339</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi --&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have a MCF52259 that will have Ethernet, USB, and RS-485 ports.&amp;nbsp; I would like to use a single clock source for all three.&amp;nbsp; USB requires 48 MHz exactly, Ethernet seems to be happy with anything over 50 MHz, RS-485&amp;nbsp;should be 57600, although adjacent rates will do if necessary.&amp;nbsp; So, I need to balance MFD, RFD, and CCHR.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;My problem is that I can't find values for MFD, RFD and CCHR that yield a value between 50 and 80 MHz, and will also yield an integer remainder&amp;nbsp;after being&amp;nbsp;divided by 32 for the baud rate generator.&amp;nbsp; I have two questions for you.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;One, what is the purpose of Table 7-6 on page 136 of the Reference Manual?&amp;nbsp; It shows the ratios for every value of MFD divided by every value of RFD, but that ratio isn't used in the calculation of Fsys, or anyplace else I can find.&amp;nbsp; Is&amp;nbsp;the table&amp;nbsp;a red herring, or is the formula for Fsys wrong?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Two, the Fsys calculation appear to generate very few useful values.&amp;nbsp; In particular, Fsys for RFD = 4 to 7&amp;nbsp;is anywhere from zero to a few kiloHertz.&amp;nbsp; Fsys for RFD of 0 or 1 quickly runs over 80 MHz.&amp;nbsp; Is this correct, or is the formula for Fsys wrong, or did I mess up the calculation?&amp;nbsp; I put it in a spreadsheet, but I have no idea how to post it here.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;&lt;P&gt;Gary Olmstead&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Fri, 24 Jul 2009 01:16:11 GMT</pubDate>
    <dc:creator>GaryOlmstead</dc:creator>
    <dc:date>2009-07-24T01:16:11Z</dc:date>
    <item>
      <title>System Clock Calculation Confusion</title>
      <link>https://community.nxp.com/t5/ColdFire-68K-Microcontrollers/System-Clock-Calculation-Confusion/m-p/202061#M9339</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi --&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have a MCF52259 that will have Ethernet, USB, and RS-485 ports.&amp;nbsp; I would like to use a single clock source for all three.&amp;nbsp; USB requires 48 MHz exactly, Ethernet seems to be happy with anything over 50 MHz, RS-485&amp;nbsp;should be 57600, although adjacent rates will do if necessary.&amp;nbsp; So, I need to balance MFD, RFD, and CCHR.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;My problem is that I can't find values for MFD, RFD and CCHR that yield a value between 50 and 80 MHz, and will also yield an integer remainder&amp;nbsp;after being&amp;nbsp;divided by 32 for the baud rate generator.&amp;nbsp; I have two questions for you.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;One, what is the purpose of Table 7-6 on page 136 of the Reference Manual?&amp;nbsp; It shows the ratios for every value of MFD divided by every value of RFD, but that ratio isn't used in the calculation of Fsys, or anyplace else I can find.&amp;nbsp; Is&amp;nbsp;the table&amp;nbsp;a red herring, or is the formula for Fsys wrong?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Two, the Fsys calculation appear to generate very few useful values.&amp;nbsp; In particular, Fsys for RFD = 4 to 7&amp;nbsp;is anywhere from zero to a few kiloHertz.&amp;nbsp; Fsys for RFD of 0 or 1 quickly runs over 80 MHz.&amp;nbsp; Is this correct, or is the formula for Fsys wrong, or did I mess up the calculation?&amp;nbsp; I put it in a spreadsheet, but I have no idea how to post it here.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;&lt;P&gt;Gary Olmstead&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 24 Jul 2009 01:16:11 GMT</pubDate>
      <guid>https://community.nxp.com/t5/ColdFire-68K-Microcontrollers/System-Clock-Calculation-Confusion/m-p/202061#M9339</guid>
      <dc:creator>GaryOlmstead</dc:creator>
      <dc:date>2009-07-24T01:16:11Z</dc:date>
    </item>
    <item>
      <title>Re: System Clock Calculation Confusion</title>
      <link>https://community.nxp.com/t5/ColdFire-68K-Microcontrollers/System-Clock-Calculation-Confusion/m-p/202062#M9340</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Gary,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I didn't see problems in Table 7-6.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Using 48Mhz external oscillator, for example, if you want to get PLLed 56Mhz fsys, you can do this:&lt;/P&gt;&lt;P&gt;1) set CCHR = 5, this gives you fref = 48/(1+5) =&amp;nbsp;8Mhz ( see 7.7.1.5).&amp;nbsp; fref is PLL reference clock.&lt;/P&gt;&lt;P&gt;2) set RFD =000 (PLL divisor is 1), MFD=010(PLL multiplication factor=8),&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; fsys = fref x 2(MFD+2)/pow(2,RFD) = 8 x2(2+2)/pow(2,0)=8x2x4/1=8x8=64Mhz.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; ( from&amp;nbsp;Table7-6 you can easily get multiplier 8 )&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;For your reference:&lt;/P&gt;&lt;P&gt;In 52259EVB board, MQX OS set system clock to 80MHz. the code snippet is below ( ...\bsp\m52259evb\bsp_init.c)&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;FONT color="#33CCCC"&gt;/*&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#33CCCC"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; ** Divide 48Mhz reference crystal by 6 and multiply by 10 to achieve a&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; ** system clock of 80 Mhz.&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;*/&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; reg_ptr-&amp;gt;CLK.OCLR&amp;nbsp; = 0xf0;&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; reg_ptr-&amp;gt;CLK.CCHR&amp;nbsp; = &lt;FONT color="#ff0000"&gt;5&lt;/FONT&gt;;&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; reg_ptr-&amp;gt;CLK.SYNCR = 0 |&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; MCF5225_CLOCK_SYNCR_&lt;FONT color="#ff0000"&gt;RFD(0)&lt;/FONT&gt; |&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; MCF5225_CLOCK_SYNCR_&lt;FONT color="#ff0000"&gt;MFD(3&lt;/FONT&gt;&lt;FONT color="#ff0000"&gt;)&lt;/FONT&gt; |&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; MCF5225_CLOCK_SYNCR_PLLMODE|&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; MCF5225_CLOCK_SYNCR_PLLEN;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#003366"&gt;&amp;nbsp;&lt;/FONT&gt;&lt;/P&gt;&lt;DIV class="message-edit-history"&gt;&lt;/DIV&gt;&lt;DIV class="message-edit-history"&gt;&lt;SPAN class="edit-author"&gt;Message Edited by eGuy on&lt;/SPAN&gt; &lt;SPAN class="local-date"&gt;2009-07-23&lt;/SPAN&gt; &lt;SPAN class="local-time"&gt;04:18 PM&lt;/SPAN&gt;&lt;/DIV&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 24 Jul 2009 02:59:56 GMT</pubDate>
      <guid>https://community.nxp.com/t5/ColdFire-68K-Microcontrollers/System-Clock-Calculation-Confusion/m-p/202062#M9340</guid>
      <dc:creator>eGuy</dc:creator>
      <dc:date>2009-07-24T02:59:56Z</dc:date>
    </item>
    <item>
      <title>Re: System Clock Calculation Confusion</title>
      <link>https://community.nxp.com/t5/ColdFire-68K-Microcontrollers/System-Clock-Calculation-Confusion/m-p/202063#M9341</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi --&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Well, without reproducing my whole spread sheet here, let me summarize it.&amp;nbsp; For&amp;nbsp;a 48 MHz crystal, and&amp;nbsp;CCHR = 5, of the 64 possible values for Fsys, only five are between 50 and 80 MHz.&amp;nbsp; Not counting duplicated entries, there are only three different&amp;nbsp;values between 50 and 80 MHz.&amp;nbsp; Other values for CCHR give similar results, as does lower crystal frequencies.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Even if you give up Ethernet's&amp;nbsp;greater than&amp;nbsp;50 MHz requirement, about half the answers are for Fsys less than 1 MHz, and about a quarter are for Fsys less than one Hertz.&amp;nbsp; Not very useful.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I guess I was surprised by this because Motorola/Freescale parts in the past have scalar values that give results that are at least mostly within range.&amp;nbsp; But these just seem to be&amp;nbsp;numbers&amp;nbsp;drawn out of a hat.&amp;nbsp; They generate Fsys values that aren't even remotely plausible.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 24 Jul 2009 11:07:21 GMT</pubDate>
      <guid>https://community.nxp.com/t5/ColdFire-68K-Microcontrollers/System-Clock-Calculation-Confusion/m-p/202063#M9341</guid>
      <dc:creator>GaryOlmstead</dc:creator>
      <dc:date>2009-07-24T11:07:21Z</dc:date>
    </item>
    <item>
      <title>Re: System Clock Calculation Confusion</title>
      <link>https://community.nxp.com/t5/ColdFire-68K-Microcontrollers/System-Clock-Calculation-Confusion/m-p/202064#M9342</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;Some more playing with the numbers gives me a useful answer.&amp;nbsp; Setting CCHR to 6, MFD to 6, and RFD to 2 gives Fsys&amp;nbsp;= 72 MHz, and a baud divisor of 39.06.&amp;nbsp; Using 39, the baud rate error is 0.16% which is fine.&amp;nbsp; But that doesn't explain why there are so few usable values.&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 24 Jul 2009 11:18:01 GMT</pubDate>
      <guid>https://community.nxp.com/t5/ColdFire-68K-Microcontrollers/System-Clock-Calculation-Confusion/m-p/202064#M9342</guid>
      <dc:creator>GaryOlmstead</dc:creator>
      <dc:date>2009-07-24T11:18:01Z</dc:date>
    </item>
  </channel>
</rss>

