<?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>8-bit Microcontrollers中的主题 Re: 9S08AW32 hangs when using PE for external clock</title>
    <link>https://community.nxp.com/t5/8-bit-Microcontrollers/9S08AW32-hangs-when-using-PE-for-external-clock/m-p/185403#M13835</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;Hi Jim, below is the config I'm using.&lt;BR /&gt;&lt;BR /&gt;I cannot see any signal from the crystal pins using an oscilloscope, so I'm wondering if pins PTG6 and PTG5 are being used by the ICG. Suposing there are noise and bad ground planes, I may see something (at least noisy) from the crystal, however I cannot see anything, which makes me think those pines are disconected from the ICG. The datasheet said&amp;nbsp; that if some conditions are not met (8.2.1 and 8.2.1), those pins are not used by the ICG. But I cannot understand them at all =(&lt;BR /&gt;&lt;BR /&gt;Here something is talked about&lt;BR /&gt;&lt;BR /&gt;&lt;A href="http://forums.freescale.com/freescale/board/message?board.id=8BITCOMM&amp;amp;message.id=6619&amp;amp;query.id=123649" target="test_blank"&gt;http://forums.freescale.com/freescale/board/message?board.id=8BITCOMM&amp;amp;message.id=6619&amp;amp;query.id=123649&lt;/A&gt;&lt;BR /&gt;&lt;BR /&gt;So, I will add a question: how can I tell the CPU to use the PTG5..6 as a crystal input??&lt;BR /&gt;&lt;BR /&gt;Thanks =)&lt;BR /&gt;&lt;BR /&gt;#include &amp;lt;hidef.h&amp;gt; /* for EnableInterrupts macro */&lt;BR /&gt;#include "derivative.h" /* include peripheral declarations */&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;void main(void) {&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; SOPT_COPE=0;&lt;BR /&gt;&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; ICGC1=0b11111000;&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; ICGC2=0b01100011;&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; while(ICGS1_LOCK==0);&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; PTCDD_PTCDD6=1;&lt;BR /&gt;&lt;BR /&gt;&amp;nbsp; EnableInterrupts; /* enable interrupts */&lt;BR /&gt;&amp;nbsp; /* include your code here */&lt;BR /&gt;&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; for(;&lt;IMG alt=":smileywink:" class="emoticon emoticon-smileywink" id="smileywink" src="http://freescale.i.lithium.com/i/smilies/16x16_smiley-wink.gif" title="Smiley Wink" /&gt;{&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; /* for speed testing&amp;nbsp; */&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; PTCD_PTCD6=1;&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; PTCD_PTCD6=0;&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;BR /&gt;&lt;BR /&gt;&amp;nbsp; for(;&lt;IMG alt=":smileywink:" class="emoticon emoticon-smileywink" id="smileywink" src="http://freescale.i.lithium.com/i/smilies/16x16_smiley-wink.gif" title="Smiley Wink" /&gt; {&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; __RESET_WATCHDOG(); /* feeds the dog */&lt;BR /&gt;&amp;nbsp; } /* loop forever */&lt;BR /&gt;&amp;nbsp; /* please make sure that you never leave main */&lt;BR /&gt;}&lt;BR /&gt;&lt;BR /&gt;&lt;DIV&gt;&lt;/DIV&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Sun, 03 Feb 2008 12:35:13 GMT</pubDate>
    <dc:creator>fjrg76</dc:creator>
    <dc:date>2008-02-03T12:35:13Z</dc:date>
    <item>
      <title>9S08AW32 hangs when using PE for external clock</title>
      <link>https://community.nxp.com/t5/8-bit-Microcontrollers/9S08AW32-hangs-when-using-PE-for-external-clock/m-p/185401#M13833</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;DIV&gt; &lt;/DIV&gt;&lt;SPAN&gt;Hi!!&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Using ProcessorExpert for specifying an external clock (crystal=8MHz, bus=16 MHz) and then loading the code into the S908AW32 through the "True time simulator and real-time debugger" tool, the program hangs waiting for the PLL to stabilize, so never reaches the main function.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;It's not necesary to use the PE, however, setting up the clock module by hand is a bit confused, that's way I tried to use PE, but if there is some C code&amp;nbsp; for initializing the external clock&amp;nbsp; using (or even bypassing it) the FLL please let me know it (code, links, app-notes, etc). My board (of my own) already includes a 8 MHz crystal because I need a very exact base-time. I'm reading the app-note AN2494 and the AW32 datasheet, but some other help will be truly apreciated.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Thanks in advanced =)&lt;/SPAN&gt;&lt;BR /&gt;&lt;DIV&gt; &lt;/DIV&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 03 Feb 2008 11:01:41 GMT</pubDate>
      <guid>https://community.nxp.com/t5/8-bit-Microcontrollers/9S08AW32-hangs-when-using-PE-for-external-clock/m-p/185401#M13833</guid>
      <dc:creator>fjrg76</dc:creator>
      <dc:date>2008-02-03T11:01:41Z</dc:date>
    </item>
    <item>
      <title>Re: 9S08AW32 hangs when using PE for external clock</title>
      <link>https://community.nxp.com/t5/8-bit-Microcontrollers/9S08AW32-hangs-when-using-PE-for-external-clock/m-p/185402#M13834</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;How did you set the HGO and RANGE bits in the ICGC1 register?&lt;BR /&gt;&lt;BR /&gt;&lt;DIV&gt;&lt;/DIV&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 03 Feb 2008 11:49:18 GMT</pubDate>
      <guid>https://community.nxp.com/t5/8-bit-Microcontrollers/9S08AW32-hangs-when-using-PE-for-external-clock/m-p/185402#M13834</guid>
      <dc:creator>JimDon</dc:creator>
      <dc:date>2008-02-03T11:49:18Z</dc:date>
    </item>
    <item>
      <title>Re: 9S08AW32 hangs when using PE for external clock</title>
      <link>https://community.nxp.com/t5/8-bit-Microcontrollers/9S08AW32-hangs-when-using-PE-for-external-clock/m-p/185403#M13835</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;Hi Jim, below is the config I'm using.&lt;BR /&gt;&lt;BR /&gt;I cannot see any signal from the crystal pins using an oscilloscope, so I'm wondering if pins PTG6 and PTG5 are being used by the ICG. Suposing there are noise and bad ground planes, I may see something (at least noisy) from the crystal, however I cannot see anything, which makes me think those pines are disconected from the ICG. The datasheet said&amp;nbsp; that if some conditions are not met (8.2.1 and 8.2.1), those pins are not used by the ICG. But I cannot understand them at all =(&lt;BR /&gt;&lt;BR /&gt;Here something is talked about&lt;BR /&gt;&lt;BR /&gt;&lt;A href="http://forums.freescale.com/freescale/board/message?board.id=8BITCOMM&amp;amp;message.id=6619&amp;amp;query.id=123649" target="test_blank"&gt;http://forums.freescale.com/freescale/board/message?board.id=8BITCOMM&amp;amp;message.id=6619&amp;amp;query.id=123649&lt;/A&gt;&lt;BR /&gt;&lt;BR /&gt;So, I will add a question: how can I tell the CPU to use the PTG5..6 as a crystal input??&lt;BR /&gt;&lt;BR /&gt;Thanks =)&lt;BR /&gt;&lt;BR /&gt;#include &amp;lt;hidef.h&amp;gt; /* for EnableInterrupts macro */&lt;BR /&gt;#include "derivative.h" /* include peripheral declarations */&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;void main(void) {&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; SOPT_COPE=0;&lt;BR /&gt;&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; ICGC1=0b11111000;&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; ICGC2=0b01100011;&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; while(ICGS1_LOCK==0);&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; PTCDD_PTCDD6=1;&lt;BR /&gt;&lt;BR /&gt;&amp;nbsp; EnableInterrupts; /* enable interrupts */&lt;BR /&gt;&amp;nbsp; /* include your code here */&lt;BR /&gt;&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; for(;&lt;IMG alt=":smileywink:" class="emoticon emoticon-smileywink" id="smileywink" src="http://freescale.i.lithium.com/i/smilies/16x16_smiley-wink.gif" title="Smiley Wink" /&gt;{&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; /* for speed testing&amp;nbsp; */&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; PTCD_PTCD6=1;&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; PTCD_PTCD6=0;&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;BR /&gt;&lt;BR /&gt;&amp;nbsp; for(;&lt;IMG alt=":smileywink:" class="emoticon emoticon-smileywink" id="smileywink" src="http://freescale.i.lithium.com/i/smilies/16x16_smiley-wink.gif" title="Smiley Wink" /&gt; {&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; __RESET_WATCHDOG(); /* feeds the dog */&lt;BR /&gt;&amp;nbsp; } /* loop forever */&lt;BR /&gt;&amp;nbsp; /* please make sure that you never leave main */&lt;BR /&gt;}&lt;BR /&gt;&lt;BR /&gt;&lt;DIV&gt;&lt;/DIV&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 03 Feb 2008 12:35:13 GMT</pubDate>
      <guid>https://community.nxp.com/t5/8-bit-Microcontrollers/9S08AW32-hangs-when-using-PE-for-external-clock/m-p/185403#M13835</guid>
      <dc:creator>fjrg76</dc:creator>
      <dc:date>2008-02-03T12:35:13Z</dc:date>
    </item>
    <item>
      <title>Re: 9S08AW32 hangs when using PE for external clock</title>
      <link>https://community.nxp.com/t5/8-bit-Microcontrollers/9S08AW32-hangs-when-using-PE-for-external-clock/m-p/185404#M13836</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;DIV&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;FONT size="2"&gt;Hello,&lt;/FONT&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;FONT size="2"&gt;&lt;/FONT&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&lt;FONT size="2"&gt;The following thread may be of interest.&lt;/FONT&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;A href="http://forums.freescale.com/freescale/board/message?board.id=8BITCOMM&amp;amp;message.id=6299" target="_blank"&gt;&lt;FONT size="2"&gt;&lt;/FONT&gt;&lt;/A&gt;&lt;A href="http://forums.freescale.com/freescale/board/message?board.id=8BITCOMM&amp;amp;message.id=6299" target="test_blank"&gt;http://forums.freescale.com/freescale/board/message?board.id=8BITCOMM&amp;amp;message.id=6299&lt;/A&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;FONT size="2"&gt;&lt;/FONT&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&lt;FONT size="2"&gt;Some if the ICG control bits within the ICGC1 register&amp;nbsp;are write once only, so will all need to be written simultaneously.&amp;nbsp; Using a low capacitance probe on an oscilloscope, you might check whether you can observe&amp;nbsp;any waveform between the crystal pins and ground.&lt;/FONT&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;FONT size="2"&gt;&lt;/FONT&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&lt;FONT size="2"&gt;A slightly different issue - If your timebase must be of good short term stability (low jitter), I would suggest that the clock for the relevant TPM module be derived directly from the crystal frequency, rather than the FLL output.&amp;nbsp; Use suitably configured XCLK instead of BUSCLK as the TPM clock source.&lt;/FONT&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;FONT size="2"&gt;&lt;/FONT&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&lt;FONT size="2"&gt;Regards,&lt;/FONT&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;FONT size="2"&gt;Mac&lt;/FONT&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;FONT size="2"&gt;&lt;/FONT&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&lt;FONT size="2"&gt;I have just seen your most recent post with the code you are using.&amp;nbsp; You appear to be using an MFD value of 16, and an RFD value of 8, within&amp;nbsp;the ICGC2 register.&amp;nbsp; For an 8 MHz crystal, aside from any startup problems you have, you seem to be attempting to achieve a FLL output frequency well in excess of the 40MHz upper limit (16*8).&amp;nbsp; The maximimum MFD value should be 4, giving 32MHz FLL output.&lt;/FONT&gt;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;BR /&gt;&lt;BR /&gt;Message Edited by bigmac on &lt;SPAN class="date_text"&gt;2008-02-03&lt;/SPAN&gt; &lt;SPAN class="time_text"&gt;04:05 PM&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 03 Feb 2008 12:37:16 GMT</pubDate>
      <guid>https://community.nxp.com/t5/8-bit-Microcontrollers/9S08AW32-hangs-when-using-PE-for-external-clock/m-p/185404#M13836</guid>
      <dc:creator>bigmac</dc:creator>
      <dc:date>2008-02-03T12:37:16Z</dc:date>
    </item>
    <item>
      <title>Re: 9S08AW32 hangs when using PE for external clock</title>
      <link>https://community.nxp.com/t5/8-bit-Microcontrollers/9S08AW32-hangs-when-using-PE-for-external-clock/m-p/185405#M13837</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;DIV&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;FONT size="2"&gt;Hello again,&lt;/FONT&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;BLOCKQUOTE&gt;&lt;DIV&gt;&lt;FONT size="2"&gt;&lt;/FONT&gt;&lt;HR /&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;FONT size="2"&gt;fjrg76 wrote:&lt;/FONT&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;FONT size="2"&gt;So, I will add a question: how can I tell the CPU to use the PTG5..6 as a crystal input??&lt;/FONT&gt;&lt;/DIV&gt;&lt;FONT size="2"&gt;&lt;/FONT&gt;&lt;DIV&gt;&lt;HR /&gt;&lt;/DIV&gt;&lt;/BLOCKQUOTE&gt;&lt;DIV&gt;&lt;FONT size="2"&gt;By setting the CLKS bits within ICGC1 to 10 or 11, and the REFS bit to 1.&amp;nbsp; The pins must be reserved out of reset, so the CLKS bits must not have been previously set to other than these values.&lt;/FONT&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;FONT size="2"&gt;&lt;/FONT&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&lt;FONT size="2"&gt;Regards,&lt;/FONT&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;FONT size="2"&gt;Mac&lt;/FONT&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;FONT size="2"&gt;&lt;/FONT&gt;&amp;nbsp;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 03 Feb 2008 13:23:49 GMT</pubDate>
      <guid>https://community.nxp.com/t5/8-bit-Microcontrollers/9S08AW32-hangs-when-using-PE-for-external-clock/m-p/185405#M13837</guid>
      <dc:creator>bigmac</dc:creator>
      <dc:date>2008-02-03T13:23:49Z</dc:date>
    </item>
    <item>
      <title>Re: 9S08AW32 hangs when using PE for external clock</title>
      <link>https://community.nxp.com/t5/8-bit-Microcontrollers/9S08AW32-hangs-when-using-PE-for-external-clock/m-p/185406#M13838</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;Hi Big!!&lt;BR /&gt;&lt;BR /&gt;Those values were calculated following the example in the datasheet (8.5.3), but edited for my needs:&lt;BR /&gt;&lt;BR /&gt;Ficg=Fext*P*N/R; P=1, Fext=8M, Ficg=16M&lt;BR /&gt;&lt;BR /&gt;N/R=Ficg/(Fext * P)=16M/8M=2&lt;BR /&gt;&lt;BR /&gt;so N=MFD=16 and R=RFD=8, did I something wrong?? ... Yes something is very bad, but I have corrected to this&lt;BR /&gt;&lt;BR /&gt;ICGC2=0b00000001;&lt;BR /&gt;&lt;BR /&gt;with N=4 and R=2 &lt;IMG alt=":smileyhappy:" class="emoticon emoticon-smileyhappy" id="smileyhappy" src="http://freescale.i.lithium.com/i/smilies/16x16_smiley-happy.gif" title="Smiley Happy" /&gt; ... but &lt;IMG alt=":smileysad:" class="emoticon emoticon-smileysad" id="smileysad" src="http://freescale.i.lithium.com/i/smilies/16x16_smiley-sad.gif" title="Smiley Sad" /&gt; it is still not working. I've visited the link you told me, but doesn't say which was the final code, so I cannot follow it =( I feel that guy was talking to himself &lt;IMG alt=":smileyhappy:" class="emoticon emoticon-smileyhappy" id="smileyhappy" src="http://freescale.i.lithium.com/i/smilies/16x16_smiley-happy.gif" title="Smiley Happy" /&gt;&lt;BR /&gt;&lt;BR /&gt;I'm writing each of the two registers as a byte, so I guess there is not problem with that.&lt;BR /&gt;&lt;BR /&gt;In one pin of the crystal I have 0V and in the other 5V and the distance from the crystal to the chip is aprox 0.375 in, and both are in the same plane, and&amp;nbsp; the caps are 39 pF&lt;BR /&gt;&lt;BR /&gt;Using PE as an experiment, in the very first rutine when the debugger reaches the line 6 the it lost its track and resets, which makes me think that the crystal is not working in anyway&lt;BR /&gt;&lt;BR /&gt;1 void _EntryPoint(void)&lt;BR /&gt;2 {&lt;BR /&gt;3&amp;nbsp; ... /* some init code */&lt;BR /&gt;&lt;BR /&gt;4 &amp;nbsp; /*&amp;nbsp; System clock initialization */&lt;BR /&gt;5&amp;nbsp; /* ICGC1: HGO=0,RANGE=1,REFS=0,CLKS1=1,CLKS0=0,OSCSTEN=1,LOCD=0,??=0 */&lt;BR /&gt;6&amp;nbsp; setReg8(ICGC1, 0x54);&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;BR /&gt;7&amp;nbsp; /* ICGC2: LOLRE=0,MFD2=0,MFD1=0,MFD0=0,LOCRE=0,RFD2=0,RFD1=0,RFD0=0 */&lt;BR /&gt;8&amp;nbsp; setReg8(ICGC2, 0x00);&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;9&amp;nbsp;&amp;nbsp;&amp;nbsp; ... /* some other init code */&lt;BR /&gt;&lt;BR /&gt;10&amp;nbsp; while(!ICGS1_ERCS) {&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; /* Wait until external reference is not stable */&lt;BR /&gt;11&amp;nbsp; }&lt;BR /&gt;&lt;BR /&gt;How can I tell the CPU to conect the PTG5..6 to work as a input/output crystal??&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;DIV&gt;&lt;/DIV&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 03 Feb 2008 13:43:43 GMT</pubDate>
      <guid>https://community.nxp.com/t5/8-bit-Microcontrollers/9S08AW32-hangs-when-using-PE-for-external-clock/m-p/185406#M13838</guid>
      <dc:creator>fjrg76</dc:creator>
      <dc:date>2008-02-03T13:43:43Z</dc:date>
    </item>
    <item>
      <title>Re: 9S08AW32 hangs when using PE for external clock</title>
      <link>https://community.nxp.com/t5/8-bit-Microcontrollers/9S08AW32-hangs-when-using-PE-for-external-clock/m-p/185407#M13839</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;DIV&gt;&lt;FONT size="2"&gt;Hello,&lt;/FONT&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;FONT size="2"&gt;&lt;/FONT&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&lt;FONT size="2"&gt;Do you also have a high value resistor (1-10 Mohm) between the two oscillator pins.&amp;nbsp; This is required to bias the oscillator wthin the linear region, to provide correct&amp;nbsp;crystal start-up.&amp;nbsp; Even if the crystal were faulty, I would expect to see a voltage level at both pins of approximately one half Vdd.&lt;/FONT&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;FONT size="2"&gt;&lt;/FONT&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&lt;FONT size="2"&gt;Your new ICGC1 value is now problematic because you require REFS bit set to 1 for crystal operation.&amp;nbsp; The value used in&amp;nbsp;your&amp;nbsp;older post appeared to be OK.&lt;/FONT&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;FONT size="2"&gt;&lt;/FONT&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&lt;FONT size="2"&gt;Prior to entering the ERCS wait loop, or perhaps even&amp;nbsp;within the loop,&amp;nbsp;you should reset the COP timer to prevent timeout, just in case the crystal is slow to start.&lt;/FONT&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;FONT size="2"&gt;&lt;/FONT&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&lt;FONT size="2"&gt;Regards,&lt;/FONT&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;FONT size="2"&gt;Mac&lt;/FONT&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;FONT size="2"&gt;&lt;/FONT&gt;&amp;nbsp;&lt;/DIV&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 03 Feb 2008 14:03:25 GMT</pubDate>
      <guid>https://community.nxp.com/t5/8-bit-Microcontrollers/9S08AW32-hangs-when-using-PE-for-external-clock/m-p/185407#M13839</guid>
      <dc:creator>bigmac</dc:creator>
      <dc:date>2008-02-03T14:03:25Z</dc:date>
    </item>
    <item>
      <title>Re: 9S08AW32 hangs when using PE for external clock</title>
      <link>https://community.nxp.com/t5/8-bit-Microcontrollers/9S08AW32-hangs-when-using-PE-for-external-clock/m-p/185408#M13840</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;HI Big!!&lt;BR /&gt;&lt;BR /&gt;No, I don't have the parallel resistor &lt;SPAN&gt;&lt;IMG alt=":smileysad:" class="emoticon emoticon-smileysad" id="smileysad" src="http://freescale.i.lithium.com/i/smilies/16x16_smiley-sad.gif" title="Smiley Sad" /&gt; so I' will get it and then solder it.&lt;BR /&gt;&lt;BR /&gt;The REFS bit was set to 0 by ProcessorExpert, and I dont know why, but using a PE was an experiment to see what could be the right definition, but doesnt work.&lt;BR /&gt;&lt;BR /&gt;I'll try the watch-dog to see what happen.&lt;BR /&gt;&lt;BR /&gt;Thanks for you support, but for today is enough, I'm gonna sleep, and I hope to hear something from you soon. Thank you &lt;IMG alt=":smileyhappy:" class="emoticon emoticon-smileyhappy" id="smileyhappy" src="http://freescale.i.lithium.com/i/smilies/16x16_smiley-happy.gif" title="Smiley Happy" /&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;DIV&gt;&lt;/DIV&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 03 Feb 2008 14:31:10 GMT</pubDate>
      <guid>https://community.nxp.com/t5/8-bit-Microcontrollers/9S08AW32-hangs-when-using-PE-for-external-clock/m-p/185408#M13840</guid>
      <dc:creator>fjrg76</dc:creator>
      <dc:date>2008-02-03T14:31:10Z</dc:date>
    </item>
    <item>
      <title>Re: 9S08AW32 hangs when using PE for external clock</title>
      <link>https://community.nxp.com/t5/8-bit-Microcontrollers/9S08AW32-hangs-when-using-PE-for-external-clock/m-p/185409#M13841</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;DIV&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;/DIV&gt;Ok, I think I got it. I have a Witztronic Viper board, which has an AW60 and an 8 Mhz xtal.&lt;BR /&gt;&lt;BR /&gt;This code will set a 32 Mhz CLK, 16 Mhz bus clock.&lt;BR /&gt;It seems to lock just fine, i tested it. He used a 1 Meg bypass and 18 pf start caps.&lt;BR /&gt;I set High Gain, High Frequency, xtal modes. If you use low power it does not seem to lock.&lt;BR /&gt;Here is the schematic:&lt;BR /&gt;&lt;A href="http://witztronics.com/product_info.php?products_id=39" rel="nofollow noopener noreferrer noopener noreferrer" target="_blank"&gt;http://witztronics.com/product_info.php?products_id=39&lt;/A&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;DIV&gt;&lt;DIV class="msg_source_code"&gt;&lt;DIV class="text_smallest"&gt;Code:&lt;/DIV&gt;&lt;PRE&gt;void _EntryPoint(void){  /* ### MC9S08AW60_64 "Cpu" init code ... */  /*  PE initialization code after reset */  /* Common initialization of the write once registers */  /* SOPT: COPE=0,COPT=1,STOPE=0,—–=1,˜™=0,??=0,??=1,??=1 */  setReg8(SOPT, 0x53);                    /* SPMSC1: LVDF=0,LVDACK=0,LVDIE=0,LVDRE=1,LVDSE=1,LVDE=1,??=0,BGBE=0 */  setReg8(SPMSC1, 0x1C);                  /* SPMSC2: LVWF=0,LVWACK=0,LVDV=0,LVWV=0,PPDF=0,PPDACK=0,??=0,PPDC=0 */  setReg8(SPMSC2, 0x00);                  /* SMCLK: MPE=0,MCSEL=0 */  clrReg8Bits(SMCLK, 0x17);               /*  System clock initialization */  /* ICGC1: HGO=1,RANGE=1,REFS=1,CLKS1=1,CLKS0=1,OSCSTEN=1,LOCD=0,??=0 */  setReg8(ICGC1, 0xFC);                   /* ICGC2: LOLRE=0,MFD2=0,MFD1=0,MFD0=0,LOCRE=0,RFD2=0,RFD1=0,RFD0=0 */  setReg8(ICGC2, 0x00);                   ICGTRM = *(unsigned char*)0xFFBE;    /* Initialize ICGTRM register from a non volatile memory */  while(!ICGS1_LOCK) {                 /* Wait */  }  /*** End of PE initialization code after reset ***/  __asm   jmp _Startup ;               /* Jump to C startup code */}&lt;/PRE&gt;&lt;/DIV&gt;&lt;BR /&gt;&amp;nbsp;&lt;BR /&gt;&lt;/DIV&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;DIV&gt;&lt;/DIV&gt;&lt;BR /&gt;&lt;BR /&gt;Message Edited by JimDon on &lt;SPAN class="date_text"&gt;2008-02-03&lt;/SPAN&gt; &lt;SPAN class="time_text"&gt;01:49 AM&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;Message Edited by JimDon on &lt;SPAN class="date_text"&gt;2008-02-03&lt;/SPAN&gt; &lt;SPAN class="time_text"&gt;01:51 AM&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 29 Oct 2020 09:36:12 GMT</pubDate>
      <guid>https://community.nxp.com/t5/8-bit-Microcontrollers/9S08AW32-hangs-when-using-PE-for-external-clock/m-p/185409#M13841</guid>
      <dc:creator>JimDon</dc:creator>
      <dc:date>2020-10-29T09:36:12Z</dc:date>
    </item>
    <item>
      <title>Re: 9S08AW32 hangs when using PE for external clock</title>
      <link>https://community.nxp.com/t5/8-bit-Microcontrollers/9S08AW32-hangs-when-using-PE-for-external-clock/m-p/185410#M13842</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;DIV&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;FONT size="2"&gt;Hello,&lt;/FONT&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;DIV&gt;&lt;BR /&gt;&lt;/DIV&gt;&lt;BLOCKQUOTE&gt;&lt;DIV&gt;&lt;HR /&gt;&lt;FONT size="2"&gt;fjrg76 wrote:&lt;BR /&gt;No, I don't have the parallel resistor&lt;/FONT&gt; &lt;SPAN&gt;&lt;FONT size="2"&gt;&lt;IMG alt=":smileysad:" class="emoticon emoticon-smileysad" id="smileysad" src="http://freescale.i.lithium.com/i/smilies/16x16_smiley-sad.gif" title="Smiley Sad" /&gt; so I' will get it and then solder it.&lt;BR /&gt;&lt;BR /&gt;The REFS bit was set to 0 by ProcessorExpert, and I dont know why, but using a PE was an experiment to see what could be the right definition, but doesnt work.&lt;BR /&gt;&lt;/FONT&gt;&lt;/SPAN&gt;&lt;DIV&gt;&lt;/DIV&gt;&lt;BR /&gt;&lt;HR /&gt;&lt;/DIV&gt;&lt;/BLOCKQUOTE&gt;&lt;DIV&gt;&lt;FONT size="2"&gt;It is possible that PE may have cleared REFS bit if you had selected external &lt;U&gt;oscillator&lt;/U&gt; option, rather than external &lt;U&gt;crystal&lt;/U&gt;.&amp;nbsp; The first option requires a single pin, and the second option two pins for the external connection.&lt;/FONT&gt;&lt;/DIV&gt;&lt;FONT size="2"&gt;&lt;/FONT&gt;&lt;/DIV&gt;&lt;FONT size="2"&gt;&lt;/FONT&gt;&lt;DIV&gt;&lt;BR /&gt;&lt;FONT size="2"&gt;Regards,&lt;/FONT&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;FONT size="2"&gt;Mac&lt;/FONT&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;FONT size="2"&gt;&lt;/FONT&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&lt;BR /&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;/DIV&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 03 Feb 2008 15:19:18 GMT</pubDate>
      <guid>https://community.nxp.com/t5/8-bit-Microcontrollers/9S08AW32-hangs-when-using-PE-for-external-clock/m-p/185410#M13842</guid>
      <dc:creator>bigmac</dc:creator>
      <dc:date>2008-02-03T15:19:18Z</dc:date>
    </item>
    <item>
      <title>Re: 9S08AW32 hangs when using PE for external clock</title>
      <link>https://community.nxp.com/t5/8-bit-Microcontrollers/9S08AW32-hangs-when-using-PE-for-external-clock/m-p/185411#M13843</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;DIV&gt;&lt;/DIV&gt;Well, the I meg bypass is a requirement.&lt;BR /&gt;&lt;BR /&gt;As are the caps. If you set it up like that, I know that the code I have shown will work.&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;DIV&gt;&lt;DIV class="msg_source_code"&gt;&lt;DIV class="text_smallest"&gt;Code:&lt;/DIV&gt;&lt;PRE&gt;
 XTAL               EXTAL
  o                  0
  |                  |
  |                  |                 |     |-------|    |  o-----| XTAL  |----o  |     |-------|    |
  |         |        |
  |        ___       |
  |         _        |
  |                  |  o-----/\/\/\/\-----o
  |       1M         |
 ---                --- ---                ---  2 x 18-20pf  |                  |  |                  | ___                ___  _                  _&lt;/PRE&gt;&lt;/DIV&gt;&lt;BR /&gt;&amp;nbsp;&lt;BR /&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;/DIV&gt;&lt;BR /&gt;&lt;BR /&gt;Message Edited by JimDon on &lt;SPAN class="date_text"&gt;2008-02-03&lt;/SPAN&gt; &lt;SPAN class="time_text"&gt;09:39 AM&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 29 Oct 2020 09:36:14 GMT</pubDate>
      <guid>https://community.nxp.com/t5/8-bit-Microcontrollers/9S08AW32-hangs-when-using-PE-for-external-clock/m-p/185411#M13843</guid>
      <dc:creator>JimDon</dc:creator>
      <dc:date>2020-10-29T09:36:14Z</dc:date>
    </item>
    <item>
      <title>---SOLVED--- 9S08AW32 hangs when using PE for external clock</title>
      <link>https://community.nxp.com/t5/8-bit-Microcontrollers/9S08AW32-hangs-when-using-PE-for-external-clock/m-p/185412#M13844</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;DIV&gt;&lt;/DIV&gt;&lt;DIV&gt;Hi to everyone that helped me, specially Big and Jim, for your time and patience.&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;In fact, the 1M parallel resistor is needed &lt;IMG alt=":smileyhappy:" class="emoticon emoticon-smileyhappy" id="smileyhappy" src="http://freescale.i.lithium.com/i/smilies/16x16_smiley-happy.gif" title="Smiley Happy" /&gt; I added and it worked. I was playing with some options (including those that I said before and the ones you told me) for ICGC1 and ICGC2 to see the differences in the CPU speed, and it worked for all of them.&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;By the way, the caps I'm using are both 33 pF, perhaps I should change them to the values you&amp;nbsp;suggest me.&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;Thanks again and we'll see you around &lt;IMG alt=":smileyhappy:" class="emoticon emoticon-smileyhappy" id="smileyhappy" src="http://freescale.i.lithium.com/i/smilies/16x16_smiley-happy.gif" title="Smiley Happy" /&gt;&lt;/DIV&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 04 Feb 2008 01:52:07 GMT</pubDate>
      <guid>https://community.nxp.com/t5/8-bit-Microcontrollers/9S08AW32-hangs-when-using-PE-for-external-clock/m-p/185412#M13844</guid>
      <dc:creator>fjrg76</dc:creator>
      <dc:date>2008-02-04T01:52:07Z</dc:date>
    </item>
    <item>
      <title>Re: ---SOLVED--- 9S08AW32 hangs when using PE for external clock</title>
      <link>https://community.nxp.com/t5/8-bit-Microcontrollers/9S08AW32-hangs-when-using-PE-for-external-clock/m-p/185413#M13845</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;Well, thanks for getting back to us.&lt;BR /&gt;&lt;BR /&gt;The caps depend somewhat on the rock.&lt;BR /&gt;All the examples I looked had 18-20pf - If 33 works so be it.&lt;BR /&gt;&lt;BR /&gt;&lt;DIV&gt;&lt;/DIV&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 04 Feb 2008 02:16:55 GMT</pubDate>
      <guid>https://community.nxp.com/t5/8-bit-Microcontrollers/9S08AW32-hangs-when-using-PE-for-external-clock/m-p/185413#M13845</guid>
      <dc:creator>JimDon</dc:creator>
      <dc:date>2008-02-04T02:16:55Z</dc:date>
    </item>
  </channel>
</rss>

