<?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: How to generate 2MHz output clock on S08 mcu? in 8-bit Microcontrollers</title>
    <link>https://community.nxp.com/t5/8-bit-Microcontrollers/How-to-generate-2MHz-output-clock-on-S08-mcu/m-p/1588093#M23632</link>
    <description>&lt;P&gt;What is your bus clock frequency ?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If you set the bus clock to 4 MHz&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;something like this&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;/* ### MC9S08DZ128_100 "Cpu" init code ... */&lt;BR /&gt;/* PE initialization code after reset */&lt;BR /&gt;/* Common initialization of the write once registers */&lt;BR /&gt;/* SOPT1: COPT=0,STOPE=0,SCI2PS=0,IIC1PS=0,??=0,??=0,??=0 */&lt;BR /&gt;setReg8(SOPT1, 0x00U); &lt;BR /&gt;/* SOPT2: COPCLKS=0,COPW=0,??=0,ADHTS=0,??=0,MCSEL=0 */&lt;BR /&gt;setReg8(SOPT2, 0x00U); &lt;BR /&gt;/* SPMSC1: LVWF=0,LVWACK=0,LVWIE=0,LVDRE=1,LVDSE=1,LVDE=1,??=0,BGBE=0 */&lt;BR /&gt;setReg8(SPMSC1, 0x1CU); &lt;BR /&gt;/* SPMSC2: ??=0,??=0,LVDV=0,LVWV=0,PPDF=0,PPDACK=0,??=0,PPDC=0 */&lt;BR /&gt;setReg8(SPMSC2, 0x00U); &lt;BR /&gt;/* System clock initialization */&lt;BR /&gt;/*lint -save -e923 Disable MISRA rule (11.3) checking. */&lt;BR /&gt;if (*(uint8_t*)0xFFAFU != 0xFFU) { /* Test if the device trim value is stored on the specified address */&lt;BR /&gt;MCGTRM = *(uint8_t*)0xFFAFU; /* Initialize MCGTRM register from a non volatile memory */&lt;BR /&gt;MCGSC = *(uint8_t*)0xFFAEU; /* Initialize MCGSC register from a non volatile memory */&lt;BR /&gt;}&lt;BR /&gt;/*lint -restore Enable MISRA rule (11.3) checking. */&lt;BR /&gt;/* MCGC2: BDIV=1,RANGE=1,HGO=0,LP=0,EREFS=0,ERCLKEN=1,EREFSTEN=0 */&lt;BR /&gt;setReg8(MCGC2, 0x62U); /* Set MCGC2 register */ &lt;BR /&gt;/* MCGC3: DIV32=1 */&lt;BR /&gt;setReg8Bits(MCGC3, 0x10U); &lt;BR /&gt;/* MCGC1: CLKS=0,RDIV=3,IREFS=0,IRCLKEN=1,IREFSTEN=0 */&lt;BR /&gt;setReg8(MCGC1, 0x1AU); /* Set MCGC1 register */ &lt;BR /&gt;/* MCGC3: LOLIE=0,PLLS=0,CME=0,DIV32=1,VDIV=1 */&lt;BR /&gt;setReg8(MCGC3, 0x11U); /* Set MCGC3 register */ &lt;BR /&gt;/* MCGT: ??=0,??=0,DMX32=0,??=0,??=0,??=0,??=0,DRST_DRS=0 */&lt;BR /&gt;setReg8(MCGT, 0x00U); /* Set MCGT register */ &lt;BR /&gt;while(MCGSC_IREFST != 0U) { /* Wait until external reference is selected */&lt;BR /&gt;}&lt;BR /&gt;while((MCGSC &amp;amp; 0x0CU) != 0x00U) { /* Wait until FLL clock is selected as a bus clock reference */&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;and after you need to set&amp;nbsp;&lt;/P&gt;
&lt;P&gt;the&amp;nbsp;MCSEL to 01&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I hope this will help you.&lt;/P&gt;</description>
    <pubDate>Thu, 26 Jan 2023 00:41:45 GMT</pubDate>
    <dc:creator>vicentegomez</dc:creator>
    <dc:date>2023-01-26T00:41:45Z</dc:date>
    <item>
      <title>How to generate 2MHz output clock on S08 mcu?</title>
      <link>https://community.nxp.com/t5/8-bit-Microcontrollers/How-to-generate-2MHz-output-clock-on-S08-mcu/m-p/1587518#M23631</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;I am using mc9s08dz96 microcontroller with 8 MHz external clock osc.&lt;/P&gt;&lt;P&gt;I want to generate 2MHz output clock on the port PTA0 of microcontroller for another IC? I want to ask how is it done?&lt;/P&gt;&lt;P&gt;Thank you.&lt;/P&gt;</description>
      <pubDate>Wed, 25 Jan 2023 08:41:38 GMT</pubDate>
      <guid>https://community.nxp.com/t5/8-bit-Microcontrollers/How-to-generate-2MHz-output-clock-on-S08-mcu/m-p/1587518#M23631</guid>
      <dc:creator>mehdializadeh</dc:creator>
      <dc:date>2023-01-25T08:41:38Z</dc:date>
    </item>
    <item>
      <title>Re: How to generate 2MHz output clock on S08 mcu?</title>
      <link>https://community.nxp.com/t5/8-bit-Microcontrollers/How-to-generate-2MHz-output-clock-on-S08-mcu/m-p/1588093#M23632</link>
      <description>&lt;P&gt;What is your bus clock frequency ?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If you set the bus clock to 4 MHz&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;something like this&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;/* ### MC9S08DZ128_100 "Cpu" init code ... */&lt;BR /&gt;/* PE initialization code after reset */&lt;BR /&gt;/* Common initialization of the write once registers */&lt;BR /&gt;/* SOPT1: COPT=0,STOPE=0,SCI2PS=0,IIC1PS=0,??=0,??=0,??=0 */&lt;BR /&gt;setReg8(SOPT1, 0x00U); &lt;BR /&gt;/* SOPT2: COPCLKS=0,COPW=0,??=0,ADHTS=0,??=0,MCSEL=0 */&lt;BR /&gt;setReg8(SOPT2, 0x00U); &lt;BR /&gt;/* SPMSC1: LVWF=0,LVWACK=0,LVWIE=0,LVDRE=1,LVDSE=1,LVDE=1,??=0,BGBE=0 */&lt;BR /&gt;setReg8(SPMSC1, 0x1CU); &lt;BR /&gt;/* SPMSC2: ??=0,??=0,LVDV=0,LVWV=0,PPDF=0,PPDACK=0,??=0,PPDC=0 */&lt;BR /&gt;setReg8(SPMSC2, 0x00U); &lt;BR /&gt;/* System clock initialization */&lt;BR /&gt;/*lint -save -e923 Disable MISRA rule (11.3) checking. */&lt;BR /&gt;if (*(uint8_t*)0xFFAFU != 0xFFU) { /* Test if the device trim value is stored on the specified address */&lt;BR /&gt;MCGTRM = *(uint8_t*)0xFFAFU; /* Initialize MCGTRM register from a non volatile memory */&lt;BR /&gt;MCGSC = *(uint8_t*)0xFFAEU; /* Initialize MCGSC register from a non volatile memory */&lt;BR /&gt;}&lt;BR /&gt;/*lint -restore Enable MISRA rule (11.3) checking. */&lt;BR /&gt;/* MCGC2: BDIV=1,RANGE=1,HGO=0,LP=0,EREFS=0,ERCLKEN=1,EREFSTEN=0 */&lt;BR /&gt;setReg8(MCGC2, 0x62U); /* Set MCGC2 register */ &lt;BR /&gt;/* MCGC3: DIV32=1 */&lt;BR /&gt;setReg8Bits(MCGC3, 0x10U); &lt;BR /&gt;/* MCGC1: CLKS=0,RDIV=3,IREFS=0,IRCLKEN=1,IREFSTEN=0 */&lt;BR /&gt;setReg8(MCGC1, 0x1AU); /* Set MCGC1 register */ &lt;BR /&gt;/* MCGC3: LOLIE=0,PLLS=0,CME=0,DIV32=1,VDIV=1 */&lt;BR /&gt;setReg8(MCGC3, 0x11U); /* Set MCGC3 register */ &lt;BR /&gt;/* MCGT: ??=0,??=0,DMX32=0,??=0,??=0,??=0,??=0,DRST_DRS=0 */&lt;BR /&gt;setReg8(MCGT, 0x00U); /* Set MCGT register */ &lt;BR /&gt;while(MCGSC_IREFST != 0U) { /* Wait until external reference is selected */&lt;BR /&gt;}&lt;BR /&gt;while((MCGSC &amp;amp; 0x0CU) != 0x00U) { /* Wait until FLL clock is selected as a bus clock reference */&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;and after you need to set&amp;nbsp;&lt;/P&gt;
&lt;P&gt;the&amp;nbsp;MCSEL to 01&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I hope this will help you.&lt;/P&gt;</description>
      <pubDate>Thu, 26 Jan 2023 00:41:45 GMT</pubDate>
      <guid>https://community.nxp.com/t5/8-bit-Microcontrollers/How-to-generate-2MHz-output-clock-on-S08-mcu/m-p/1588093#M23632</guid>
      <dc:creator>vicentegomez</dc:creator>
      <dc:date>2023-01-26T00:41:45Z</dc:date>
    </item>
    <item>
      <title>Re: How to generate 2MHz output clock on S08 mcu?</title>
      <link>https://community.nxp.com/t5/8-bit-Microcontrollers/How-to-generate-2MHz-output-clock-on-S08-mcu/m-p/1589751#M23635</link>
      <description>&lt;P&gt;Thank you so much, the problem solved with setting MCSEL to 01.&lt;/P&gt;</description>
      <pubDate>Mon, 30 Jan 2023 10:55:22 GMT</pubDate>
      <guid>https://community.nxp.com/t5/8-bit-Microcontrollers/How-to-generate-2MHz-output-clock-on-S08-mcu/m-p/1589751#M23635</guid>
      <dc:creator>mehdializadeh</dc:creator>
      <dc:date>2023-01-30T10:55:22Z</dc:date>
    </item>
  </channel>
</rss>

