<?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>Kinetis MicrocontrollersのトピックRe: K20 VREF_OUT Never Stabilizes</title>
    <link>https://community.nxp.com/t5/Kinetis-Microcontrollers/K20-VREF-OUT-Never-Stabilizes/m-p/230430#M4909</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Chris,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The code is definitely not in low power mode.&amp;nbsp; The application stays in run mode throughout its life.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;When the application calls my &lt;SPAN style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;EnableVRefAlt() function, I have not yet set up interrupts for the peripheral devices on the board.&amp;nbsp; But even if interrupts were happening, the application completes the loop and prints that the value in the VREF_SC register is 0x80 -- the &lt;SPAN style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;VREF_SC_VREFEN_MASK&lt;/SPAN&gt; bit is ON, but the &lt;SPAN style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;VREF_SC_VREFST_MASK&lt;/SPAN&gt; bit is OFF.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;When I vary the &lt;SPAN style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;VOLTAGE_STABLE_MS value between 10 ms and 500 ms, I can see a change in the delay when the printf() message appears on the debug port, so I'm sure the function is waiting long enough.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The code does only two things to the VREF module before checking the VREFST bit:&lt;/P&gt;&lt;P&gt; - Turn on the VREF clock via the &lt;SPAN style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;SIM_SCGC&lt;/SPAN&gt;4 register, and&lt;/P&gt;&lt;P&gt; - Turn on the VREFEN bit in the VREF_SC register.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Given that the MCU is in RUN mode, is there anything else required?&amp;nbsp; Is there any other module on the K20 that would interfere with the VREFST bit becoming HIGH?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Ben&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 09 May 2013 16:40:23 GMT</pubDate>
    <dc:creator>tsxer</dc:creator>
    <dc:date>2013-05-09T16:40:23Z</dc:date>
    <item>
      <title>K20 VREF_OUT Never Stabilizes</title>
      <link>https://community.nxp.com/t5/Kinetis-Microcontrollers/K20-VREF-OUT-Never-Stabilizes/m-p/230428#M4907</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I have a custom board with an MK20DX256VLK10.&amp;nbsp; We are trying to use a single-ended line on ADC0 to measure a voltage with respect to the VREF_OUT pin.&amp;nbsp; We want to use the mode where VREF_OUT is a 1.2V output from the K20.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;My issue is that the VREF_SCVREFST_MASK bit never goes HIGH in the VREF_SC register.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I use the following MQX code to try to initialize the VREF module.&amp;nbsp; I've confirmed the VREFST bit is LOW from the CodeWarrior debugger.&amp;nbsp; The VREF_OUT pin on the K20 has a 100 nF capacity between it and GND as required by the Reference Manual.&amp;nbsp; I've tried cranking out the delay loop to 500 ms, but I still get the same result.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Please help.&amp;nbsp; Am I doing something incorrect here?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Ben&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;boolean EnableVRefAlt (void)&lt;/P&gt;&lt;P&gt;{&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; int32_t&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; iReturn;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; boolean&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; returnValue;&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;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; // Return value from this function.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; const int32_t&amp;nbsp; VOLTAGE_STABLE_MS = 10;&amp;nbsp;&amp;nbsp;&amp;nbsp; // Milliseconds to wait for the VREF_OUT voltage to&lt;/P&gt;&lt;P&gt;&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;&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;&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;&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; stabilize.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; // Make sure the clock is turned on to the K20 VREF module.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; SIM_SCGC4 |= SIM_SCGC4_VREF_MASK;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; VREF_SC = VREF_SC_VREFEN_MASK;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; returnValue = FALSE;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; // Wait for the voltage to stabilize.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; for (iReturn = 0; iReturn &amp;lt; VOLTAGE_STABLE_MS; ++iReturn)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; {&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; if (VREF_SC_VREFST_MASK == (VREF_SC &amp;amp; VREF_SC_VREFST_MASK))&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; {&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; returnValue = TRUE;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; break;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; else&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; _time_delay(1);&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; }&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; if (! returnValue)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; printf("After %d ms, VREF voltage is not stable, VREF_SC = 0x%X.\n", iReturn, VREF_SC);&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; return returnValue;&lt;/P&gt;&lt;P&gt;}&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 08 May 2013 20:01:34 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Microcontrollers/K20-VREF-OUT-Never-Stabilizes/m-p/230428#M4907</guid>
      <dc:creator>tsxer</dc:creator>
      <dc:date>2013-05-08T20:01:34Z</dc:date>
    </item>
    <item>
      <title>Re: K20 VREF_OUT Never Stabilizes</title>
      <link>https://community.nxp.com/t5/Kinetis-Microcontrollers/K20-VREF-OUT-Never-Stabilizes/m-p/230429#M4908</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Ben,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have tried this on a K60 (which has the same VREF module) and haven't seen an issue.&amp;nbsp; Is this function being called from a low power mode?&amp;nbsp; Could some other task be interrupting this one?&amp;nbsp; Are you sure you're waiting 500ms (because that should definitely be enough time)?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Best of luck,&lt;/P&gt;&lt;P&gt;~Chris&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 09 May 2013 15:47:32 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Microcontrollers/K20-VREF-OUT-Never-Stabilizes/m-p/230429#M4908</guid>
      <dc:creator>chris_brown</dc:creator>
      <dc:date>2013-05-09T15:47:32Z</dc:date>
    </item>
    <item>
      <title>Re: K20 VREF_OUT Never Stabilizes</title>
      <link>https://community.nxp.com/t5/Kinetis-Microcontrollers/K20-VREF-OUT-Never-Stabilizes/m-p/230430#M4909</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Chris,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The code is definitely not in low power mode.&amp;nbsp; The application stays in run mode throughout its life.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;When the application calls my &lt;SPAN style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;EnableVRefAlt() function, I have not yet set up interrupts for the peripheral devices on the board.&amp;nbsp; But even if interrupts were happening, the application completes the loop and prints that the value in the VREF_SC register is 0x80 -- the &lt;SPAN style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;VREF_SC_VREFEN_MASK&lt;/SPAN&gt; bit is ON, but the &lt;SPAN style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;VREF_SC_VREFST_MASK&lt;/SPAN&gt; bit is OFF.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;When I vary the &lt;SPAN style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;VOLTAGE_STABLE_MS value between 10 ms and 500 ms, I can see a change in the delay when the printf() message appears on the debug port, so I'm sure the function is waiting long enough.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The code does only two things to the VREF module before checking the VREFST bit:&lt;/P&gt;&lt;P&gt; - Turn on the VREF clock via the &lt;SPAN style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;SIM_SCGC&lt;/SPAN&gt;4 register, and&lt;/P&gt;&lt;P&gt; - Turn on the VREFEN bit in the VREF_SC register.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Given that the MCU is in RUN mode, is there anything else required?&amp;nbsp; Is there any other module on the K20 that would interfere with the VREFST bit becoming HIGH?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Ben&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 09 May 2013 16:40:23 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Microcontrollers/K20-VREF-OUT-Never-Stabilizes/m-p/230430#M4909</guid>
      <dc:creator>tsxer</dc:creator>
      <dc:date>2013-05-09T16:40:23Z</dc:date>
    </item>
    <item>
      <title>Re: K20 VREF_OUT Never Stabilizes</title>
      <link>https://community.nxp.com/t5/Kinetis-Microcontrollers/K20-VREF-OUT-Never-Stabilizes/m-p/230431#M4910</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Ben,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;It sounds like you are doing everything correctly.&amp;nbsp; It makes no sense why this would be happening.&amp;nbsp; Does this happen for every chip you have tried (or have you been able to try different chips)?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Best Regards,&lt;/P&gt;&lt;P&gt;Chris &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 09 May 2013 20:17:12 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Microcontrollers/K20-VREF-OUT-Never-Stabilizes/m-p/230431#M4910</guid>
      <dc:creator>chris_brown</dc:creator>
      <dc:date>2013-05-09T20:17:12Z</dc:date>
    </item>
    <item>
      <title>Re: K20 VREF_OUT Never Stabilizes</title>
      <link>https://community.nxp.com/t5/Kinetis-Microcontrollers/K20-VREF-OUT-Never-Stabilizes/m-p/230432#M4911</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Chris,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I've tried this on four of our prototype platforms.&amp;nbsp; They all behave the same way.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Just to try something new, I shut&lt;SPAN style="font-size: 10pt; line-height: 1.5em;"&gt; off the VREF module before running the code above, but problem still persists.&amp;nbsp; The RM says turning off the clock to the VREF module is not sufficient to shut off the VREF module -- you also have to disable the VREFEN bit.&amp;nbsp; Here is the code I ran before calling the &lt;SPAN style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;EnableVRefAlt() routine:&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; // Kill any previous VREF set up, then wait a little bit.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; VREF_SC &amp;amp;= ~(VREF_SC_VREFEN_MASK);&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; SIM_SCGC4 &amp;amp;= ~(SIM_SCGC4_VREF_MASK);&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; _time_delay(10);&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; // Now try to initialize the VREF module.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; &lt;SPAN style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;EnableVRefAlt();&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Ben&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 13 May 2013 14:43:18 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Microcontrollers/K20-VREF-OUT-Never-Stabilizes/m-p/230432#M4911</guid>
      <dc:creator>tsxer</dc:creator>
      <dc:date>2013-05-13T14:43:18Z</dc:date>
    </item>
    <item>
      <title>Re: K20 VREF_OUT Never Stabilizes</title>
      <link>https://community.nxp.com/t5/Kinetis-Microcontrollers/K20-VREF-OUT-Never-Stabilizes/m-p/230433#M4912</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Ben,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;So, you say you aren't using a low power mode, but are you using VLPR?&amp;nbsp; If not, could you try enabling the bandgap in the PMC module anyways and see if that makes a difference?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;~Chris&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 16 May 2013 22:10:25 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Microcontrollers/K20-VREF-OUT-Never-Stabilizes/m-p/230433#M4912</guid>
      <dc:creator>chris_brown</dc:creator>
      <dc:date>2013-05-16T22:10:25Z</dc:date>
    </item>
    <item>
      <title>Re: K20 VREF_OUT Never Stabilizes</title>
      <link>https://community.nxp.com/t5/Kinetis-Microcontrollers/K20-VREF-OUT-Never-Stabilizes/m-p/230434#M4913</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;It turns out to have been a hardware issue that caused the problem.&amp;nbsp; An incorrect part was identified in the BOM for supporting circuitry.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 06 Jun 2013 16:37:24 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Microcontrollers/K20-VREF-OUT-Never-Stabilizes/m-p/230434#M4913</guid>
      <dc:creator>tsxer</dc:creator>
      <dc:date>2013-06-06T16:37:24Z</dc:date>
    </item>
  </channel>
</rss>

