<?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>topic Re: Trying to set baud rate on HCS micro in 8-bit Microcontrollers</title>
    <link>https://community.nxp.com/t5/8-bit-Microcontrollers/Trying-to-set-baud-rate-on-HCS-micro/m-p/203730#M16891</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;A 7 percent baud rate error will likely give unsatisfactory results.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;By choosing a crystal frequency above 5 MHz you have ruled out using the FLL. However, it would appear still feasible to use the PLL (PEE mode).&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;RDIV = 8 will give a PLL reference frequency of 1.2288 MHz. Using VDIV = 12, and BDIV = 1 should give a bus frequency of 7.3728 MHz. This should provide an exact baud rate of 115200 with a baud divisor setting of 4.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;How accurate does the 1 ms tick need to be? For an exact period based on an integral number of bus cycles, the bus frequency (in Hz) would need to be evenly divisible by 1000. With a 9.8304 MHz crystal, this will never be exactly met whatever method is used to generate the bus clock.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Mac&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;DIV class="message-edit-history"&gt;&lt;SPAN class="edit-author"&gt;Message Edited by bigmac on&lt;/SPAN&gt; &lt;SPAN class="local-date"&gt;2009-07-31&lt;/SPAN&gt; &lt;SPAN class="local-time"&gt;04:47 AM&lt;/SPAN&gt;&lt;/DIV&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Fri, 31 Jul 2009 01:45:48 GMT</pubDate>
    <dc:creator>bigmac</dc:creator>
    <dc:date>2009-07-31T01:45:48Z</dc:date>
    <item>
      <title>Trying to set baud rate on HCS micro</title>
      <link>https://community.nxp.com/t5/8-bit-Microcontrollers/Trying-to-set-baud-rate-on-HCS-micro/m-p/203725#M16886</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'm trying to communicate with a serial LCD hooked up to a microcontroller (HCS08), the display uses a 115k baud rate. I'm using a 9.8MHzexternal xtal, and with the baud rate divisor set at 5 this gives em a 7% mismatch in baud rate. Can I get this closer?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks in advance for your help,&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 30 Jul 2009 21:12:29 GMT</pubDate>
      <guid>https://community.nxp.com/t5/8-bit-Microcontrollers/Trying-to-set-baud-rate-on-HCS-micro/m-p/203725#M16886</guid>
      <dc:creator>dweight</dc:creator>
      <dc:date>2009-07-30T21:12:29Z</dc:date>
    </item>
    <item>
      <title>Re: Trying to set baud rate on HCS micro</title>
      <link>https://community.nxp.com/t5/8-bit-Microcontrollers/Trying-to-set-baud-rate-on-HCS-micro/m-p/203726#M16887</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;It'd be nice to know which MCU you're dealing with.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I think xtal is irrelevant.&amp;nbsp; You (and we) need to know the bus clock (BUSCLK), which is a function of several things, like use of FLL, BDIV, etc.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Once you know the bus clock, divide that by 16 and the baud rate you want, and use that value.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;For example, for bus of 28MHz (a nice 4MHz-xtal based bus clock for QE128), to get the baud rate 115200, you'd use: 28E6/(16*115200)=15.19~15 (actual baud 116666.66, only 1.27% off) if I got all the math right.&lt;/P&gt;&lt;DIV class="message-edit-history"&gt;&lt;SPAN class="edit-author"&gt;Message Edited by tonyp on&lt;/SPAN&gt; &lt;SPAN class="local-date"&gt;2009-07-30&lt;/SPAN&gt; &lt;SPAN class="local-time"&gt;05:45 PM&lt;/SPAN&gt;&lt;/DIV&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 30 Jul 2009 21:37:28 GMT</pubDate>
      <guid>https://community.nxp.com/t5/8-bit-Microcontrollers/Trying-to-set-baud-rate-on-HCS-micro/m-p/203726#M16887</guid>
      <dc:creator>tonyp</dc:creator>
      <dc:date>2009-07-30T21:37:28Z</dc:date>
    </item>
    <item>
      <title>Re: Trying to set baud rate on HCS micro</title>
      <link>https://community.nxp.com/t5/8-bit-Microcontrollers/Trying-to-set-baud-rate-on-HCS-micro/m-p/203727#M16888</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;An alternative way of expressing your requirement is to say that the bus clock frequency requires to be an integer multiple of 1.8432 MHz.&amp;nbsp; For some devices, it is possible that a 9.8304 MHz crystal may not be able to achieve this bus frequency with sufficient accuracy.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Mac&amp;nbsp;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 30 Jul 2009 22:14:26 GMT</pubDate>
      <guid>https://community.nxp.com/t5/8-bit-Microcontrollers/Trying-to-set-baud-rate-on-HCS-micro/m-p/203727#M16888</guid>
      <dc:creator>bigmac</dc:creator>
      <dc:date>2009-07-30T22:14:26Z</dc:date>
    </item>
    <item>
      <title>Re: Trying to set baud rate on HCS micro</title>
      <link>https://community.nxp.com/t5/8-bit-Microcontrollers/Trying-to-set-baud-rate-on-HCS-micro/m-p/203728#M16889</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks for your help, the mcu is a MC9S08DZ60. Unfortunately the bus division is set due to the need to generate an interrupt every millisecond, so it looks like I'm stuck with a 7% error unless the xtal can be changed to a faster one,&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 30 Jul 2009 22:32:38 GMT</pubDate>
      <guid>https://community.nxp.com/t5/8-bit-Microcontrollers/Trying-to-set-baud-rate-on-HCS-micro/m-p/203728#M16889</guid>
      <dc:creator>dweight</dc:creator>
      <dc:date>2009-07-30T22:32:38Z</dc:date>
    </item>
    <item>
      <title>Re: Trying to set baud rate on HCS micro</title>
      <link>https://community.nxp.com/t5/8-bit-Microcontrollers/Trying-to-set-baud-rate-on-HCS-micro/m-p/203729#M16890</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;Just as a note: Although I haven't used that specific MCU variant to know all the clock options and divisors it has, a one-millisecond interrupt is usually possible in more than one ways, so you normally shouldn't have to be stuck to just one bus clock.&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 30 Jul 2009 22:36:34 GMT</pubDate>
      <guid>https://community.nxp.com/t5/8-bit-Microcontrollers/Trying-to-set-baud-rate-on-HCS-micro/m-p/203729#M16890</guid>
      <dc:creator>tonyp</dc:creator>
      <dc:date>2009-07-30T22:36:34Z</dc:date>
    </item>
    <item>
      <title>Re: Trying to set baud rate on HCS micro</title>
      <link>https://community.nxp.com/t5/8-bit-Microcontrollers/Trying-to-set-baud-rate-on-HCS-micro/m-p/203730#M16891</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;A 7 percent baud rate error will likely give unsatisfactory results.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;By choosing a crystal frequency above 5 MHz you have ruled out using the FLL. However, it would appear still feasible to use the PLL (PEE mode).&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;RDIV = 8 will give a PLL reference frequency of 1.2288 MHz. Using VDIV = 12, and BDIV = 1 should give a bus frequency of 7.3728 MHz. This should provide an exact baud rate of 115200 with a baud divisor setting of 4.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;How accurate does the 1 ms tick need to be? For an exact period based on an integral number of bus cycles, the bus frequency (in Hz) would need to be evenly divisible by 1000. With a 9.8304 MHz crystal, this will never be exactly met whatever method is used to generate the bus clock.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Mac&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;DIV class="message-edit-history"&gt;&lt;SPAN class="edit-author"&gt;Message Edited by bigmac on&lt;/SPAN&gt; &lt;SPAN class="local-date"&gt;2009-07-31&lt;/SPAN&gt; &lt;SPAN class="local-time"&gt;04:47 AM&lt;/SPAN&gt;&lt;/DIV&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 31 Jul 2009 01:45:48 GMT</pubDate>
      <guid>https://community.nxp.com/t5/8-bit-Microcontrollers/Trying-to-set-baud-rate-on-HCS-micro/m-p/203730#M16891</guid>
      <dc:creator>bigmac</dc:creator>
      <dc:date>2009-07-31T01:45:48Z</dc:date>
    </item>
    <item>
      <title>Re: Trying to set baud rate on HCS micro</title>
      <link>https://community.nxp.com/t5/8-bit-Microcontrollers/Trying-to-set-baud-rate-on-HCS-micro/m-p/203731#M16892</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi All,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks for the information . i need to have some more information about 115200 baud rate setting,&lt;/P&gt;&lt;P&gt;For my application i have using 4MHZ external crystal, what is the bus clock is needed to use the 115200 BR for my UART Communication.?&lt;/P&gt;&lt;P&gt;Please can any one help me to configure bus clock correctly?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;My program MCU configuration RDIV = 2, CLKS = 0, BDIV = 1, PLLS =1, VDIV= 0111 (Multiply by 28.) to for getting 28MHz bus clock. how i can check my bus clock?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 11 May 2016 08:28:49 GMT</pubDate>
      <guid>https://community.nxp.com/t5/8-bit-Microcontrollers/Trying-to-set-baud-rate-on-HCS-micro/m-p/203731#M16892</guid>
      <dc:creator>sakthivelkuland</dc:creator>
      <dc:date>2016-05-11T08:28:49Z</dc:date>
    </item>
  </channel>
</rss>

