<?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>S12 / MagniV MicrocontrollersのトピックPLL Question</title>
    <link>https://community.nxp.com/t5/S12-MagniV-Microcontrollers/PLL-Question/m-p/132052#M1647</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;I am using the MC9S12DP256B microcontroller and I have written a routine to utilize the phase loop lock feature. Every time I run the debugger in codewarrior my program goes into the clock monitor fail reset.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;The code that I have written is as follows:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;void SetClkSpeed20(void)&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;{&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;//multiply 4MHz by 2 by 5/1 to get 40MHz for the PLL&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;//or a bus clk of 20 MHz&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;SYNR=4;//+1&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;REFDV=0;//+1&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;while (!(CRGFLG_LOCK)) ;//wait for PLL lock&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;CLKSEL_PLLSEL=1; //engage PLL&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;}&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I am also using SPI in this program, is there an issue with using both SPI and PLL that would cause the clock monitor fail reset or could I be missing something in my PLL routine that is causing the clock monitor fail reset. Any advice or insight into this interrupt or problem would be appreciated.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Thanks,&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Lssuer&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 11 Apr 2006 11:36:45 GMT</pubDate>
    <dc:creator>lssuer</dc:creator>
    <dc:date>2006-04-11T11:36:45Z</dc:date>
    <item>
      <title>PLL Question</title>
      <link>https://community.nxp.com/t5/S12-MagniV-Microcontrollers/PLL-Question/m-p/132052#M1647</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;I am using the MC9S12DP256B microcontroller and I have written a routine to utilize the phase loop lock feature. Every time I run the debugger in codewarrior my program goes into the clock monitor fail reset.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;The code that I have written is as follows:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;void SetClkSpeed20(void)&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;{&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;//multiply 4MHz by 2 by 5/1 to get 40MHz for the PLL&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;//or a bus clk of 20 MHz&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;SYNR=4;//+1&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;REFDV=0;//+1&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;while (!(CRGFLG_LOCK)) ;//wait for PLL lock&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;CLKSEL_PLLSEL=1; //engage PLL&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;}&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I am also using SPI in this program, is there an issue with using both SPI and PLL that would cause the clock monitor fail reset or could I be missing something in my PLL routine that is causing the clock monitor fail reset. Any advice or insight into this interrupt or problem would be appreciated.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Thanks,&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Lssuer&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 11 Apr 2006 11:36:45 GMT</pubDate>
      <guid>https://community.nxp.com/t5/S12-MagniV-Microcontrollers/PLL-Question/m-p/132052#M1647</guid>
      <dc:creator>lssuer</dc:creator>
      <dc:date>2006-04-11T11:36:45Z</dc:date>
    </item>
    <item>
      <title>Re: PLL Question</title>
      <link>https://community.nxp.com/t5/S12-MagniV-Microcontrollers/PLL-Question/m-p/132053#M1648</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;DIV&gt;hello,&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;I have the same problembut with SCI port.&lt;/DIV&gt;&lt;DIV&gt;After some research I have found the EB614/D&lt;/DIV&gt;&lt;DIV&gt;it's detail that some componant have a problem.&lt;/DIV&gt;&lt;DIV&gt;look at this bulletin, perhaps it can help you.&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;it's in attachement part.&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;excuse me for spelling mistake I'm French.&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;good luck!&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&lt;A href="http://www.freescale.com/files/community_files/16BITCOMM/769_ErrataSCIinterrupt.pdf" rel="nofollow" target="_self"&gt;ErrataSCIinterrupt.pdf&lt;/A&gt;&lt;BR /&gt;&lt;/DIV&gt;&lt;DIV class="message-edit-history"&gt;&lt;SPAN class="edit-author"&gt;Message Edited by t.dowe on&lt;/SPAN&gt; &lt;SPAN class="local-date"&gt;2009-10-21&lt;/SPAN&gt; &lt;SPAN class="local-time"&gt;12:20 AM&lt;/SPAN&gt;&lt;/DIV&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 11 Apr 2006 14:35:16 GMT</pubDate>
      <guid>https://community.nxp.com/t5/S12-MagniV-Microcontrollers/PLL-Question/m-p/132053#M1648</guid>
      <dc:creator>gautier</dc:creator>
      <dc:date>2006-04-11T14:35:16Z</dc:date>
    </item>
    <item>
      <title>Re: PLL Question</title>
      <link>https://community.nxp.com/t5/S12-MagniV-Microcontrollers/PLL-Question/m-p/132054#M1649</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;DIV&gt;&lt;/DIV&gt;&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;I'm also using a MC9S12DP256B on Dragon12 and MiniDragon. The two have a bus speed of 8MHz with a cristal at 16 MHz. And I've had to create a little function to run my boards at 24MHz when not using D-Bug12.&lt;/P&gt;&lt;P&gt;I'm not using codewarrior but the ICC12 compiler, and here is my function&amp;nbsp;and it&amp;nbsp;works fine :&lt;/P&gt;&lt;FONT size="2"&gt;&lt;/FONT&gt;&lt;P&gt;&lt;FONT size="2"&gt;void set_pll(void)&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT size="2"&gt;{&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT size="2"&gt;&lt;STRONG&gt;ClearBit(CLKSEL,0x80);&lt;/STRONG&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT size="2"&gt;&lt;STRONG&gt;SetBit(PLLCTL,0x40);&lt;/STRONG&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT size="2"&gt;SYNR = 0x05;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT size="2"&gt;REFDV = 0x03;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT size="2"&gt;do&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT size="2"&gt;{&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT size="2"&gt;;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT size="2"&gt;} while (TestBit(CRGFLG,0x08) == 0);&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT size="2"&gt;SetBit(CLKSEL,0x80);&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT size="2"&gt;}&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT size="2"&gt;I think the 2 first and bold lines are missing in your code.&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT size="2"&gt;&amp;nbsp;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT size="2"&gt;hope this helps&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT size="2"&gt;Jean Claude&lt;/FONT&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 14 Apr 2006 04:03:53 GMT</pubDate>
      <guid>https://community.nxp.com/t5/S12-MagniV-Microcontrollers/PLL-Question/m-p/132054#M1649</guid>
      <dc:creator>domi2c</dc:creator>
      <dc:date>2006-04-14T04:03:53Z</dc:date>
    </item>
    <item>
      <title>Re: PLL Question</title>
      <link>https://community.nxp.com/t5/S12-MagniV-Microcontrollers/PLL-Question/m-p/132055#M1650</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;Hi Issuer,&lt;BR /&gt;I'm not sure if this happens if your SYNR or REFDV values are wrong but I had a similar problem when the oscillator was down. If the osc. is not running, the MCU uses 'self-clocking' and thus you can't activate the PLL.&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 15 Apr 2006 04:42:39 GMT</pubDate>
      <guid>https://community.nxp.com/t5/S12-MagniV-Microcontrollers/PLL-Question/m-p/132055#M1650</guid>
      <dc:creator>pittbull</dc:creator>
      <dc:date>2006-04-15T04:42:39Z</dc:date>
    </item>
    <item>
      <title>Re: PLL Question</title>
      <link>https://community.nxp.com/t5/S12-MagniV-Microcontrollers/PLL-Question/m-p/132056#M1651</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I had a similar problem with the Dragon 12 Plus board.&lt;/P&gt;&lt;P&gt;When you switch from LOAD mode to RUN mode, the clock frequency changes from 24MHz to 4MHz. This was messing up a lot of my Calculations. I used the PLL and it works fine now.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;PLLCLK = 8*2*6/2 = 48MHz&lt;BR /&gt;The bus speed = PLLCLK / 2 = 24 MHz&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Here is code. Its very similar to the ones above:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;void Set_Clock(void)&lt;BR /&gt;{&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; CLKSEL &amp;amp;= 0x7F;&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; PLLCTL |= 0x40;&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; SYNR&amp;nbsp; = 0x05;&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; REFDV = 0x01;&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; while(!(0x08 &amp;amp; CRGFLG));&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; CLKSEL |= 0x80;&lt;BR /&gt;}&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;You can also find a description of what all the above registers do at the link beow under the Clock and Reset Generator section.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;A href="http://cache.freescale.com/files/microcontrollers/doc/data_sheet/MC9S12DP256.pdf?fsrch=1&amp;amp;WT_TYPE=Data%20Sheets&amp;amp;WT_VENDOR=FREESCALE&amp;amp;WT_FILE_FORMAT=pdf&amp;amp;WT_ASSET=Documentation&amp;amp;sr=1" rel="nofollow" target="_blank"&gt;http://cache.freescale.com/files/microcontrollers/doc/data_sheet/MC9S12DP256.pdf?fsrch=1&amp;amp;WT_TYPE=Data%20Sheets&amp;amp;WT_VENDOR=FREESCALE&amp;amp;WT_FILE_FORMAT=pdf&amp;amp;WT_ASSET=Documentation&amp;amp;sr=1&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Hope this helps someone.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 13 Jan 2011 04:41:09 GMT</pubDate>
      <guid>https://community.nxp.com/t5/S12-MagniV-Microcontrollers/PLL-Question/m-p/132056#M1651</guid>
      <dc:creator>MO_84</dc:creator>
      <dc:date>2011-01-13T04:41:09Z</dc:date>
    </item>
  </channel>
</rss>

