<?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>S32Kのトピックs32k disabling the PLL</title>
    <link>https://community.nxp.com/t5/S32K/s32k-disabling-the-PLL/m-p/1189285#M9009</link>
    <description>&lt;P&gt;Target is S32K144.&lt;/P&gt;&lt;P&gt;I'm trying to disable the SPLL,SOSC and FIRC clocks before entering VLPS mode&lt;/P&gt;&lt;P&gt;using the code snipt below will disable the last two but it fails to disable the SPLL.&lt;/P&gt;&lt;P&gt;Sorry it is a bit of mess.&lt;/P&gt;&lt;P&gt;2 different mask was used in the while loop:SPLLVLD&amp;nbsp;bit&amp;nbsp;which is commented out right now since I get stuck in it, The other one is LK bit that goes true but SPLLEN still remains 1.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;SCG_RCCR = (uint32)((3 &amp;lt;&amp;lt; 24)|(0 &amp;lt;&amp;lt; 16)|(0 &amp;lt;&amp;lt; 12)|(1 &amp;lt;&amp;lt; 4)|(3 &amp;lt;&amp;lt; 0));&lt;BR /&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;SCG_SPLLCSR = (uint32)0x00;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; //&amp;amp;=~(1uL&amp;lt;&amp;lt;0);//(uint32)0x00;&amp;nbsp;&amp;nbsp; /* disable PLL */&lt;BR /&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;while (SCG_SPLLCSR &amp;amp; 0x00800000UL&amp;nbsp; /* 0x1000000*/){};&amp;nbsp;&amp;nbsp;/* wait until PLL Lock is released */&lt;BR /&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;SCG_SOSCCSR = (uint32)0x00;&amp;nbsp;&amp;nbsp; /* disable system OSC */&lt;BR /&gt;&amp;nbsp;&lt;BR /&gt;&amp;nbsp; //SCG_RCCR = (uint32)((3 &amp;lt;&amp;lt; 24)|(0 &amp;lt;&amp;lt; 16)|(0 &amp;lt;&amp;lt; 12)|(1 &amp;lt;&amp;lt; 4)|(3 &amp;lt;&amp;lt; 0));&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;SCG_FIRCCSR &amp;amp;= ~(1uL&amp;lt;&amp;lt;0); //disable FIRC&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I NEED HELP RESOLVING THIS ISSUE.&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;Koorosh Hajiani&lt;/P&gt;</description>
    <pubDate>Wed, 25 Nov 2020 22:00:07 GMT</pubDate>
    <dc:creator>hajianik</dc:creator>
    <dc:date>2020-11-25T22:00:07Z</dc:date>
    <item>
      <title>s32k disabling the PLL</title>
      <link>https://community.nxp.com/t5/S32K/s32k-disabling-the-PLL/m-p/1189285#M9009</link>
      <description>&lt;P&gt;Target is S32K144.&lt;/P&gt;&lt;P&gt;I'm trying to disable the SPLL,SOSC and FIRC clocks before entering VLPS mode&lt;/P&gt;&lt;P&gt;using the code snipt below will disable the last two but it fails to disable the SPLL.&lt;/P&gt;&lt;P&gt;Sorry it is a bit of mess.&lt;/P&gt;&lt;P&gt;2 different mask was used in the while loop:SPLLVLD&amp;nbsp;bit&amp;nbsp;which is commented out right now since I get stuck in it, The other one is LK bit that goes true but SPLLEN still remains 1.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;SCG_RCCR = (uint32)((3 &amp;lt;&amp;lt; 24)|(0 &amp;lt;&amp;lt; 16)|(0 &amp;lt;&amp;lt; 12)|(1 &amp;lt;&amp;lt; 4)|(3 &amp;lt;&amp;lt; 0));&lt;BR /&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;SCG_SPLLCSR = (uint32)0x00;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; //&amp;amp;=~(1uL&amp;lt;&amp;lt;0);//(uint32)0x00;&amp;nbsp;&amp;nbsp; /* disable PLL */&lt;BR /&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;while (SCG_SPLLCSR &amp;amp; 0x00800000UL&amp;nbsp; /* 0x1000000*/){};&amp;nbsp;&amp;nbsp;/* wait until PLL Lock is released */&lt;BR /&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;SCG_SOSCCSR = (uint32)0x00;&amp;nbsp;&amp;nbsp; /* disable system OSC */&lt;BR /&gt;&amp;nbsp;&lt;BR /&gt;&amp;nbsp; //SCG_RCCR = (uint32)((3 &amp;lt;&amp;lt; 24)|(0 &amp;lt;&amp;lt; 16)|(0 &amp;lt;&amp;lt; 12)|(1 &amp;lt;&amp;lt; 4)|(3 &amp;lt;&amp;lt; 0));&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;SCG_FIRCCSR &amp;amp;= ~(1uL&amp;lt;&amp;lt;0); //disable FIRC&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I NEED HELP RESOLVING THIS ISSUE.&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;Koorosh Hajiani&lt;/P&gt;</description>
      <pubDate>Wed, 25 Nov 2020 22:00:07 GMT</pubDate>
      <guid>https://community.nxp.com/t5/S32K/s32k-disabling-the-PLL/m-p/1189285#M9009</guid>
      <dc:creator>hajianik</dc:creator>
      <dc:date>2020-11-25T22:00:07Z</dc:date>
    </item>
    <item>
      <title>Re: s32k disabling the PLL</title>
      <link>https://community.nxp.com/t5/S32K/s32k-disabling-the-PLL/m-p/1189784#M9013</link>
      <description>&lt;P&gt;Hello,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;At first, "When entering VLPR/VLPS mode, the system clock should be SIRC"&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;void init_SIRC(void)&lt;BR /&gt;{&lt;BR /&gt;SCG-&amp;gt;SIRCCSR &amp;amp;= ~ (1 &amp;lt;&amp;lt; 24);&lt;BR /&gt;// [24] LK = 0 Unlock Control Status Register&lt;/P&gt;
&lt;P&gt;SCG-&amp;gt;SIRCCSR |= 0x01;&lt;BR /&gt;// [2] SIRCLPEN = 0 Slow IRC is disabled in VLP modes&lt;BR /&gt;// [1] SIRCSTEN = 0 Slow IRC is disabled in Stop modes&lt;BR /&gt;// [0] SIRCEN = 1 Slow IRC is enabled&lt;/P&gt;
&lt;P&gt;SCG-&amp;gt;SIRCDIV |= 0x0404;&lt;BR /&gt;// [10-8] SIRCDIV2 0b100 Divide by 8 (1MHz)&lt;BR /&gt;// [2-0] SIRCDIV1 0b100 Divide by 8 (1MHz)&lt;/P&gt;
&lt;P&gt;while((SCG-&amp;gt;SIRCCSR &amp;amp; (1 &amp;lt;&amp;lt; 24)) == 0); // wait until clock is valid&lt;BR /&gt;// [24] SIRCVLD = 1 Slow IRC is enabled and output clock is valid&lt;/P&gt;
&lt;P&gt;SCG-&amp;gt;SIRCCSR |= (1 &amp;lt;&amp;lt; 24);&lt;BR /&gt;// [24] LK = 1 lock Control Status Register&lt;/P&gt;
&lt;P&gt;}&lt;/P&gt;
&lt;P&gt;void switch_to_SIRC_in_RUN(void)&lt;BR /&gt;{&lt;BR /&gt;uint32_t srie = RCM-&amp;gt;SRIE;&lt;BR /&gt;RCM-&amp;gt;SRIE = 0x0000; // configure all reset sources to be ‘Reset' (not as Interrupt)&lt;BR /&gt;RCM-&amp;gt;SRIE = 0xFFFF; // Program each reset source as Interrupt via RCM_SRIE&lt;BR /&gt;// for a minimum delay time of 10 LPO.&lt;/P&gt;
&lt;P&gt;SCG-&amp;gt;RCCR = 0x02010013;&lt;BR /&gt;// [27-24] SCS = 2 Slow IRC (SIRC_CLK 8MHZ)&lt;BR /&gt;// [19-16] DIVCORE = 1 Divide by 2 (4 MHz)&lt;BR /&gt;// [7-4] DIVBUS = 1 Divide core by 2 (2 MHz)&lt;BR /&gt;// [3-1] DIVSLOW = 3 Divide core by 4 (1 MHz)&lt;/P&gt;
&lt;P&gt;while(!((SCG-&amp;gt;CSR &amp;amp; (0x0F000000)) &amp;amp; 0x02000000));&lt;BR /&gt;// [27-24] SCS = 0b0010 Slow IRC (SIRC_CLK)&lt;BR /&gt;// or&lt;BR /&gt;while((SCG-&amp;gt;SIRCCSR &amp;amp; (1 &amp;lt;&amp;lt; 25)) == 0);&lt;BR /&gt;// [25] SIRCCSR = 1 Until SIRC is the system clock source&lt;/P&gt;
&lt;P&gt;RCM-&amp;gt;SRIE = srie;&lt;BR /&gt;}&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;Then disable FIRC, SOSC, and SPLL&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;void disable_FIRC_SIRC_SOSC_in_RUN(void)&lt;BR /&gt;{&lt;BR /&gt;// When entering VLPR/VLPS mode, the system clock should be SIRC. The FIRC, SOSC,&lt;BR /&gt;// and SPLL must be disabled by software in RUN mode before making any mode&lt;BR /&gt;// transition.&lt;/P&gt;
&lt;P&gt;if(!(SCG-&amp;gt;SPLLCSR &amp;amp; (1 &amp;lt;&amp;lt; 25)))&lt;BR /&gt;{&lt;BR /&gt;SCG-&amp;gt;SPLLCSR &amp;amp;= ~(1 &amp;lt;&amp;lt; 0);&lt;BR /&gt;while(SCG-&amp;gt;SPLLCSR &amp;amp; (1 &amp;lt;&amp;lt; 24));&lt;BR /&gt;}&lt;/P&gt;
&lt;P&gt;if(!(SCG-&amp;gt;FIRCCSR &amp;amp; (1 &amp;lt;&amp;lt; 25)))&lt;BR /&gt;{ // [25] FIRCSEL, if FIRC is not the system clock source&lt;BR /&gt;SCG-&amp;gt;FIRCCSR &amp;amp;= ~(1 &amp;lt;&amp;lt; 0);&lt;BR /&gt;// [0] FIRCEN = 0 FIRC disabled&lt;BR /&gt;while(SCG-&amp;gt;FIRCCSR &amp;amp; (1 &amp;lt;&amp;lt; 24));&lt;BR /&gt;// [24] FIRCVLD = 0 Fast IRC is not enabled or clock is not valid&lt;BR /&gt;}&lt;/P&gt;
&lt;P&gt;if(!(SCG-&amp;gt;SOSCCSR &amp;amp; (1 &amp;lt;&amp;lt; 25)))&lt;BR /&gt;{&lt;BR /&gt;SCG-&amp;gt;SOSCCSR &amp;amp;= ~(1 &amp;lt;&amp;lt; 0);&lt;BR /&gt;while(SCG-&amp;gt;SOSCCSR &amp;amp; (1 &amp;lt;&amp;lt; 24));&lt;BR /&gt;}&lt;/P&gt;
&lt;P&gt;}&lt;/P&gt;
&lt;P&gt;After that, all of them are disabled:&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="dianabatrlova_0-1606401592166.png" style="width: 400px;"&gt;&lt;img src="https://community.nxp.com/t5/image/serverpage/image-id/131115i10403ACE64392A41/image-size/medium?v=v2&amp;amp;px=400" role="button" title="dianabatrlova_0-1606401592166.png" alt="dianabatrlova_0-1606401592166.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;I hope it helps.&lt;/P&gt;
&lt;P&gt;Best regads,&lt;/P&gt;
&lt;P&gt;Diana&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 26 Nov 2020 14:41:51 GMT</pubDate>
      <guid>https://community.nxp.com/t5/S32K/s32k-disabling-the-PLL/m-p/1189784#M9013</guid>
      <dc:creator>dianabatrlova</dc:creator>
      <dc:date>2020-11-26T14:41:51Z</dc:date>
    </item>
  </channel>
</rss>

