<?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: Using crystal on DEMO board in CodeWarrior for MCU</title>
    <link>https://community.nxp.com/t5/CodeWarrior-for-MCU/Using-crystal-on-DEMO-board/m-p/182686#M6246</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello Iain,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I had a closer look at the ICS section in the reference manual, and the fixed frequency clock source is derived differently compared with some of the other HCS08 devices.&amp;nbsp; For the QE device, the fixed frequency clock, as an alternate clock source for the TPM modules, is derived from the current reference source, whether internal or divided external source.&amp;nbsp; For&amp;nbsp;other devices,&amp;nbsp;the external source is used.&amp;nbsp; This means that it would&amp;nbsp;seem possible to use either FEI mode or FEE mode to generate the bus frequency, and also provide the alternate TPM clock.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I also see that there is an additional frequency division by 2, before the clock is applied to the TPM prescaler, that I had previously overlooked. This means that the clock frequency will be nominally 16 kHz.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Accepting that you still require to use an external&amp;nbsp;reference, I believe that the ICSC1 value should be 0x00 in order to source the bus clock from the FLL.&amp;nbsp; A setting of 0x80 would be causing FBE mode,&amp;nbsp;giving a 16 kHz bus frequency &amp;nbsp;- not what you require.&amp;nbsp;&amp;nbsp; A nominal bus frequency of 4 MHz should be achieved with ICSC2 = 0x44; and ICSSC = 0x00;&lt;/P&gt;&lt;P&gt;i.e. Bus frequency = 32768 * 512 / 2 / 2&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;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Fri, 12 Mar 2010 21:31:20 GMT</pubDate>
    <dc:creator>bigmac</dc:creator>
    <dc:date>2010-03-12T21:31:20Z</dc:date>
    <item>
      <title>Using crystal on DEMO board</title>
      <link>https://community.nxp.com/t5/CodeWarrior-for-MCU/Using-crystal-on-DEMO-board/m-p/182685#M6245</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;CW 5.9, HCS08QE32, DEMOQE&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I wish to have a 1000Hz clock for TPM timing, and it was suggested by a forum member that that I should set my TPM to use 32kHz crystal XCLK, and prescaler of 32 to give me my 1000Hz clock, and that, I understand.&amp;nbsp;&lt;/P&gt;&lt;P&gt;Below is code I have to set the ICS (HCS08QE has no ICG).&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;ICSC1 = 0b10000000;&amp;nbsp; // CLKS = 10 external referenceICSC2 = 0b00000110;&amp;nbsp; // EREFS = 1 oscillator driving crystal,&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;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; // ERCLKEN = 1 ICSERCLK enabledwhile(!ICSSC_OSCINIT){} // wait for external crystal to be initiallised&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I am getting confused by internal/external references, there seems to be more options than I thought there would be, also the EREFS bit I am unsure of, as the book I am using and data sheet seem to contradict each other when mentioning oscillators/crystals/resonators.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Basically I just want to set the micro to make use of the 32kHz crystal on my demo board (attatched to EXTAL and XTAL pins),&amp;nbsp; but am not sure if I am setting the registers correctly, can anyone help?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Iain&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 29 Oct 2020 09:33:36 GMT</pubDate>
      <guid>https://community.nxp.com/t5/CodeWarrior-for-MCU/Using-crystal-on-DEMO-board/m-p/182685#M6245</guid>
      <dc:creator>Iain</dc:creator>
      <dc:date>2020-10-29T09:33:36Z</dc:date>
    </item>
    <item>
      <title>Re: Using crystal on DEMO board</title>
      <link>https://community.nxp.com/t5/CodeWarrior-for-MCU/Using-crystal-on-DEMO-board/m-p/182686#M6246</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello Iain,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I had a closer look at the ICS section in the reference manual, and the fixed frequency clock source is derived differently compared with some of the other HCS08 devices.&amp;nbsp; For the QE device, the fixed frequency clock, as an alternate clock source for the TPM modules, is derived from the current reference source, whether internal or divided external source.&amp;nbsp; For&amp;nbsp;other devices,&amp;nbsp;the external source is used.&amp;nbsp; This means that it would&amp;nbsp;seem possible to use either FEI mode or FEE mode to generate the bus frequency, and also provide the alternate TPM clock.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I also see that there is an additional frequency division by 2, before the clock is applied to the TPM prescaler, that I had previously overlooked. This means that the clock frequency will be nominally 16 kHz.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Accepting that you still require to use an external&amp;nbsp;reference, I believe that the ICSC1 value should be 0x00 in order to source the bus clock from the FLL.&amp;nbsp; A setting of 0x80 would be causing FBE mode,&amp;nbsp;giving a 16 kHz bus frequency &amp;nbsp;- not what you require.&amp;nbsp;&amp;nbsp; A nominal bus frequency of 4 MHz should be achieved with ICSC2 = 0x44; and ICSSC = 0x00;&lt;/P&gt;&lt;P&gt;i.e. Bus frequency = 32768 * 512 / 2 / 2&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;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 12 Mar 2010 21:31:20 GMT</pubDate>
      <guid>https://community.nxp.com/t5/CodeWarrior-for-MCU/Using-crystal-on-DEMO-board/m-p/182686#M6246</guid>
      <dc:creator>bigmac</dc:creator>
      <dc:date>2010-03-12T21:31:20Z</dc:date>
    </item>
  </channel>
</rss>

