<?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>Kinetis MicrocontrollersのトピックRe: Generate baudrate for TWR-K60N512</title>
    <link>https://community.nxp.com/t5/Kinetis-Microcontrollers/Generate-baudrate-for-TWR-K60N512/m-p/377793#M20006</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Ricardo,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The divide value is relative to the MCGOUTCLK. It is essentially the OUTDIV2 value that is shown in the block diagram (and the CG block downstream of that is just an enable that is automatically controlled).&amp;nbsp; &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;However, I did want to point out that the divide value is only 8 if you are using low power boot (LPBOOT).&amp;nbsp; By default the device will not be using LPBOOT unless you have programmed the flash that way.&amp;nbsp; So I think it should be a divide by 1. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Hope this information helps,&lt;/P&gt;&lt;P&gt;Chris&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 11 Mar 2015 18:35:06 GMT</pubDate>
    <dc:creator>chris_brown</dc:creator>
    <dc:date>2015-03-11T18:35:06Z</dc:date>
    <item>
      <title>Generate baudrate for TWR-K60N512</title>
      <link>https://community.nxp.com/t5/Kinetis-Microcontrollers/Generate-baudrate-for-TWR-K60N512/m-p/377792#M20005</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I'm seeking from help on trying to set the baudrate dor &lt;EM&gt;UART5&lt;/EM&gt; on &lt;EM&gt;MK60DN512ZVMD10 &lt;/EM&gt;on my &lt;EM&gt;TWR-K60N512&lt;/EM&gt;. I'm trying to follow this formula, according to the datasheet of the micro-controller:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;&lt;EM&gt;UART baud rate = UART module clock / (16 × (SBR[12:0] + BRFD))&lt;/EM&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I've checked in the same datasheet that the "&lt;EM&gt;UART module clock" &lt;/EM&gt; is sourced by &lt;EM&gt;bus clock&lt;/EM&gt; on micro-controller, and I was thinking of using the default values for &lt;EM&gt;bus clock&lt;/EM&gt; on micro-controller for my board, checking section &lt;EM&gt;5.5.1 Clock divider values after reset&lt;/EM&gt; of the datasheet:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="Capture.PNG.png"&gt;&lt;img src="https://community.nxp.com/t5/image/serverpage/image-id/51291i21E78797C313E743/image-size/large?v=v2&amp;amp;px=999" role="button" title="Capture.PNG.png" alt="Capture.PNG.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;From my understanding, the micro-controller defaults to a &lt;EM&gt;bus clock&lt;/EM&gt; of "divide by 8", my question is, relative to which clock value?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Is it needed to configure all the registers and components of the &lt;STRONG&gt;MCG &lt;/STRONG&gt;and &lt;STRONG&gt;SIM&lt;/STRONG&gt; modules to generate a &lt;EM&gt;bus clock&lt;/EM&gt; before attempting to set the UART &lt;EM&gt;baudrate&lt;/EM&gt;, like the following diagram suggests?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="Capture.PNG.png"&gt;&lt;img src="https://community.nxp.com/t5/image/serverpage/image-id/51293iF06AE4706D564EEE/image-size/large?v=v2&amp;amp;px=999" role="button" title="Capture.PNG.png" alt="Capture.PNG.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I really appreciate your help and share of knowledge and ask for some patience cause i'm really still a beginner trying to get into the world of ARM micro-controllers.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Many thanks in advance. :smileywink:&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 11 Mar 2015 16:13:02 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Microcontrollers/Generate-baudrate-for-TWR-K60N512/m-p/377792#M20005</guid>
      <dc:creator>rflmota</dc:creator>
      <dc:date>2015-03-11T16:13:02Z</dc:date>
    </item>
    <item>
      <title>Re: Generate baudrate for TWR-K60N512</title>
      <link>https://community.nxp.com/t5/Kinetis-Microcontrollers/Generate-baudrate-for-TWR-K60N512/m-p/377793#M20006</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Ricardo,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The divide value is relative to the MCGOUTCLK. It is essentially the OUTDIV2 value that is shown in the block diagram (and the CG block downstream of that is just an enable that is automatically controlled).&amp;nbsp; &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;However, I did want to point out that the divide value is only 8 if you are using low power boot (LPBOOT).&amp;nbsp; By default the device will not be using LPBOOT unless you have programmed the flash that way.&amp;nbsp; So I think it should be a divide by 1. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Hope this information helps,&lt;/P&gt;&lt;P&gt;Chris&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 11 Mar 2015 18:35:06 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Microcontrollers/Generate-baudrate-for-TWR-K60N512/m-p/377793#M20006</guid>
      <dc:creator>chris_brown</dc:creator>
      <dc:date>2015-03-11T18:35:06Z</dc:date>
    </item>
    <item>
      <title>Re: Generate baudrate for TWR-K60N512</title>
      <link>https://community.nxp.com/t5/Kinetis-Microcontrollers/Generate-baudrate-for-TWR-K60N512/m-p/377794#M20007</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Ricardo&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If you do not configuration the MCG, MCGOUTCLK defauts to about 22.5MHz (32kHz IRC [35156 Hz middle value] * FLL multiplacation of 640).&lt;/P&gt;&lt;P&gt;This means that you will have a system clock of 22.5MHz (typical) and bus clock of the same if you have the LPBOOT configuration set to 1. If you have the LBOOT set to 0 it will be about 2.8MHz for each.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Even if you don't configure the MCG in anyway you can still modifiy the system and bus clocks as you want by simply writing to SIM_CLKDIV1 (doesn't need to wait for anything to lock but make sure that the bus speed is never set higher than the system speed and that the flash clock is not set higher than 25MHz).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;UARTs 0 and 1 are clocked from the core clock and the others are clocked from the bus clock.&lt;/P&gt;&lt;P&gt;For UART 5 (bus clock) you can set a baud with the values given in your other thread: &lt;A href="https://community.nxp.com/message/483709"&gt;Re: I need help with UART5 on TWR-K60N512&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&lt;EM&gt;Note that with the default clock setting it is neither possible to work with USB nor Ethernet.&lt;/EM&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Below is a screen shot of the TWR-K60N512 running in the uTasker Kinetis simulator with default LPBOOT = 1 clock setting, showing the speeds involved as well as a Baud of 115200 on UART5 (the 32kHz IRC is assumed to have its typical vaue, which however has some tolerance):&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Ricardo&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If you do not configuration the MCG, MCGOUTCLK defauts to about 22.5MHz (32kHz IRC [35156 Hz middle value] * FLL multiplacation of 640).&lt;/P&gt;&lt;P&gt;This means that you will have a system clock of 22.5MHz (typical) and bus clock of the same if you have the LPBOOT configuration set to 1. If you have the LBOOT set to 0 it will be about 2.8MHz for each.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Even if you don't configure the MCG in anyway you can still modifiy the system and bus clocks as you want by simply writing to SIM_CLKDIV1 (doesn't need to wait for anything to lock but make sure that the bus speed is never set higher than the system speed and that the flash clock is not set higher than 25MHz).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;UARTs 0 and 1 are clocked from the core clock and the others are clocked from the bus clock.&lt;/P&gt;&lt;P&gt;For UART 5 (bus clock) you can set a baud with the values given in your other thread: &lt;A href="https://community.nxp.com/message/483709"&gt;Re: I need help with UART5 on TWR-K60N512&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&lt;EM&gt;Note that with the default clock setting it is neither possible to work with USB nor Ethernet.&lt;/EM&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Below is a screen shot of the TWR-K60N512 running in the uTasker Kinetis simulator with default LPBOOT = 1 clock setting, showing the speeds involved as well as a Baud of 115200 on UART5 (the 32kHz IRC is assumed to have its typical vaue, which however has some tolerance):&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="pastedImage_0.png"&gt;&lt;img src="https://community.nxp.com/t5/image/serverpage/image-id/51299i7E80FC95EC5BA97F/image-size/large?v=v2&amp;amp;px=999" role="button" title="pastedImage_0.png" alt="pastedImage_0.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The UART5 registers (showing Baud settings in UART_BDH, UART_BDL and UART_C4 are as shown in the simulator's peripheral register display:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="pastedImage_3.png"&gt;&lt;img src="https://community.nxp.com/t5/image/serverpage/image-id/51298i7E0DD0FA9CC07843/image-size/large?v=v2&amp;amp;px=999" role="button" title="pastedImage_3.png" alt="pastedImage_3.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Mark&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Kinetis: &lt;A class="jive-link-external-small" data-content-finding="Community" href="http://www.utasker.com/kinetis.html" target="_blank"&gt;µTasker Kinetis support&lt;/A&gt;&lt;/P&gt;&lt;P&gt;K60: &lt;A class="jive-link-external-small" data-content-finding="Community" href="http://www.utasker.com/kinetis/TWR-K60N512.html" target="_blank"&gt;µTasker Kinetis TWR-K60N512 support&lt;/A&gt; / &lt;A class="jive-link-external-small" data-content-finding="Community" href="http://www.utasker.com/kinetis/TWR-K60D100M.html" target="_blank"&gt;µTasker Kinetis TWR-K60D100M support&lt;/A&gt; / &lt;A class="jive-link-external-small" data-content-finding="Community" href="http://www.utasker.com/kinetis/TWR-K60F120M.html" target="_blank"&gt;µTasker Kinetis TWR-K60F120M support&lt;/A&gt;&lt;/P&gt;&lt;P&gt;UARTs/PUARTs: &lt;A class="jive-link-external-small" data-content-finding="Community" href="http://www.utasker.com/docs/uTasker/uTaskerUART.PDF" target="_blank"&gt;http://www.utasker.com/docs/uTasker/uTaskerUART.PDF&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;For the complete "out-of-the-box" Kinetis experience and faster time to market&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;&lt;BR /&gt;&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;IMG alt="" class="jiveImage" style="max-width: 1200px; max-height: 900px;" /&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 11 Mar 2015 19:17:40 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Microcontrollers/Generate-baudrate-for-TWR-K60N512/m-p/377794#M20007</guid>
      <dc:creator>mjbcswitzerland</dc:creator>
      <dc:date>2015-03-11T19:17:40Z</dc:date>
    </item>
    <item>
      <title>Re: Generate baudrate for TWR-K60N512</title>
      <link>https://community.nxp.com/t5/Kinetis-Microcontrollers/Generate-baudrate-for-TWR-K60N512/m-p/377795#M20008</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thank you &lt;A class="jx-jive-macro-user" href="https://community.nxp.com/people/chrisbrown"&gt;chrisbrown&lt;/A&gt; and &lt;A class="jx-jive-macro-user" href="https://community.nxp.com/people/mjbcswitzerland"&gt;mjbcswitzerland&lt;/A&gt;, your two replies were very useful and I think I'll manage to configure the baud-rate more properly from your explanations, and it also allowed me to get a better understanding of the overall clocking system of K60 micro-controllers... BTW &lt;A class="jx-jive-macro-user" href="https://community.nxp.com/people/mjbcswitzerland"&gt;mjbcswitzerland&lt;/A&gt;, the other thread that you mention, wasn't from me, but from another Ricardo, but it was useful too, thank you for pointing that out, i think I've not searched well enough the forum..&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thank you very much, really appreciate your help! &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;P.S.: Just for an unrelated question to the topic, can you tell which IDE you're using from the screenshot you took of the register values &lt;A class="jx-jive-macro-user" href="https://community.nxp.com/people/mjbcswitzerland"&gt;mjbcswitzerland&lt;/A&gt;? My guess would be &lt;EM&gt;Kinetis Studio&lt;/EM&gt;, I'm using CodeWarrior for now which not seems to have a "simulator"... Would Kinetis Studio be more suited to those kinds of boards? Sorry about the off-topic, maybe I should open another thread...&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 12 Mar 2015 09:37:16 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Microcontrollers/Generate-baudrate-for-TWR-K60N512/m-p/377795#M20008</guid>
      <dc:creator>rflmota</dc:creator>
      <dc:date>2015-03-12T09:37:16Z</dc:date>
    </item>
    <item>
      <title>Re: Generate baudrate for TWR-K60N512</title>
      <link>https://community.nxp.com/t5/Kinetis-Microcontrollers/Generate-baudrate-for-TWR-K60N512/m-p/377796#M20009</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Ricardo&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Sorry for confusing you with the other poster - the questions were so similar I just wanted to avoid typing in the same answer again.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The screen shots are from VisualStudio; I use VS for editing, simulation, debugging and testing because I find it very efficient. It uses GCC for cross compiling (as does KDS and CW and various other methods) but I do also build with CW, KDS, etc. in case I need to do any specific target debugging (whichever one has the most practial debugging support for the particula device in question) [I ensure that the project is always compatible with all IDEs]&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;There is a list of IDEs that are used here: &lt;A href="http://www.utasker.com/kinetis.html" title="http://www.utasker.com/kinetis.html"&gt;µTasker Kinetis support&lt;/A&gt;&lt;/P&gt;&lt;P&gt;All can be used/work so it is more a question of which one you prefer.&lt;/P&gt;&lt;P&gt;As noted above my preference is always VS since it is very powerful and allows development times to be greatly reduced when used in combination with simulation techniques.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Mark&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Kinetis: &lt;A class="jive-link-external-small" data-content-finding="Community" href="http://www.utasker.com/kinetis.html" target="_blank"&gt;µTasker Kinetis support&lt;/A&gt;&lt;/P&gt;&lt;P&gt;K60: &lt;A class="jive-link-external-small" data-content-finding="Community" href="http://www.utasker.com/kinetis/TWR-K60N512.html" target="_blank"&gt;µTasker Kinetis TWR-K60N512 support&lt;/A&gt; / &lt;A class="jive-link-external-small" data-content-finding="Community" href="http://www.utasker.com/kinetis/TWR-K60D100M.html" target="_blank"&gt;µTasker Kinetis TWR-K60D100M support&lt;/A&gt; / &lt;A class="jive-link-external-small" data-content-finding="Community" href="http://www.utasker.com/kinetis/TWR-K60F120M.html" target="_blank"&gt;µTasker Kinetis TWR-K60F120M support&lt;/A&gt;&lt;/P&gt;&lt;P&gt;UARTs/PUARTs: &lt;A class="jive-link-external-small" data-content-finding="Community" href="http://www.utasker.com/docs/uTasker/uTaskerUART.PDF" target="_blank"&gt;http://www.utasker.com/docs/uTasker/uTaskerUART.PDF&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;For the complete "out-of-the-box" Kinetis experience and faster time to market&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;&lt;BR /&gt;&lt;/EM&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 12 Mar 2015 14:09:59 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Microcontrollers/Generate-baudrate-for-TWR-K60N512/m-p/377796#M20009</guid>
      <dc:creator>mjbcswitzerland</dc:creator>
      <dc:date>2015-03-12T14:09:59Z</dc:date>
    </item>
  </channel>
</rss>

