<?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 ADC Accuracy in MKE04 in Kinetis Microcontrollers</title>
    <link>https://community.nxp.com/t5/Kinetis-Microcontrollers/ADC-Accuracy-in-MKE04/m-p/966574#M55137</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;I am using MKE04Z64VLH4 in a control application. The ADC output is fluctuating a lot (Variation of 20 counts at DC input of 1.65V with only 3mV ripple in VDD and ADC input).&amp;nbsp;&lt;/P&gt;&lt;P&gt;While debugging, we have observed a note in datasheet to operate ADC in stop mode or wait state to get desired accuracy. I am trying to use wait state instruction in a PIT timer(625usec) but the controller gets stuck at that instruction whereas when i am using the same instruction in while(1), the controller works fine.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;What exactly is the problem when&amp;nbsp;shifting the controller to wait state inside PIT's ISR?&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Also, Is there any other way wherein i don't have to stop or put the controller in wait state to get the desired accuracy as this wait/stop time is reducing the CPU utilization.&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Please refer following code where i am facing the problem:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P style="margin: 2.0pt 0cm 2.0pt 0cm;"&gt;&lt;STRONG style="color: #7f0055; font-size: 10.0pt; "&gt;void&lt;/STRONG&gt;&lt;SPAN style="font-size: 10.0pt; color: black;"&gt; &lt;STRONG&gt;PIT_Task_Channel0&lt;/STRONG&gt;(&lt;/SPAN&gt;&lt;STRONG style="color: #7f0055; font-size: 10.0pt; "&gt;void&lt;/STRONG&gt;&lt;SPAN style="font-size: 10.0pt; color: black;"&gt;)&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin: 2.0pt 0cm 2.0pt 0cm;"&gt;&lt;SPAN style="font-size: 10.0pt; color: black;"&gt;{&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin: 2.0pt 0cm 2.0pt 0cm;"&gt;&lt;SPAN style="font-size: 10.0pt; color: black;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;ADC_SetChannel(ADC,ADC_CHANNEL_AD9);&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin: 2.0pt 0cm 2.0pt 0cm;"&gt;&lt;SPAN style="font-size: 10.0pt; color: black;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; ADC_SetChannel(ADC,ADC_CHANNEL_AD13);&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin: 2.0pt 0cm 2.0pt 0cm;"&gt;&lt;SPAN style="font-size: 10.0pt; color: black;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/SPAN&gt;&lt;STRONG style="color: #7f0055; font-size: 10.0pt; "&gt;asm&lt;/STRONG&gt;&lt;SPAN style="font-size: 10.0pt; color: black;"&gt;(&lt;/SPAN&gt;&lt;SPAN style="font-size: 10.0pt; color: #2a00ff;"&gt;"&lt;SPAN style="text-decoration: underline;"&gt;wfi&lt;/SPAN&gt;"&lt;/SPAN&gt;&lt;SPAN style="font-size: 10.0pt; color: black;"&gt;);&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin: 2.0pt 0cm 2.0pt 0cm;"&gt;&lt;SPAN style="font-size: 10.0pt; color: black;"&gt;}&lt;STRONG&gt;/*Code gets stuck at this brace*/&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks and best regards,&lt;/P&gt;&lt;P&gt;Prasanna&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 10 Jul 2019 09:58:25 GMT</pubDate>
    <dc:creator>prasannanaik</dc:creator>
    <dc:date>2019-07-10T09:58:25Z</dc:date>
    <item>
      <title>ADC Accuracy in MKE04</title>
      <link>https://community.nxp.com/t5/Kinetis-Microcontrollers/ADC-Accuracy-in-MKE04/m-p/966574#M55137</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;I am using MKE04Z64VLH4 in a control application. The ADC output is fluctuating a lot (Variation of 20 counts at DC input of 1.65V with only 3mV ripple in VDD and ADC input).&amp;nbsp;&lt;/P&gt;&lt;P&gt;While debugging, we have observed a note in datasheet to operate ADC in stop mode or wait state to get desired accuracy. I am trying to use wait state instruction in a PIT timer(625usec) but the controller gets stuck at that instruction whereas when i am using the same instruction in while(1), the controller works fine.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;What exactly is the problem when&amp;nbsp;shifting the controller to wait state inside PIT's ISR?&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Also, Is there any other way wherein i don't have to stop or put the controller in wait state to get the desired accuracy as this wait/stop time is reducing the CPU utilization.&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Please refer following code where i am facing the problem:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P style="margin: 2.0pt 0cm 2.0pt 0cm;"&gt;&lt;STRONG style="color: #7f0055; font-size: 10.0pt; "&gt;void&lt;/STRONG&gt;&lt;SPAN style="font-size: 10.0pt; color: black;"&gt; &lt;STRONG&gt;PIT_Task_Channel0&lt;/STRONG&gt;(&lt;/SPAN&gt;&lt;STRONG style="color: #7f0055; font-size: 10.0pt; "&gt;void&lt;/STRONG&gt;&lt;SPAN style="font-size: 10.0pt; color: black;"&gt;)&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin: 2.0pt 0cm 2.0pt 0cm;"&gt;&lt;SPAN style="font-size: 10.0pt; color: black;"&gt;{&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin: 2.0pt 0cm 2.0pt 0cm;"&gt;&lt;SPAN style="font-size: 10.0pt; color: black;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;ADC_SetChannel(ADC,ADC_CHANNEL_AD9);&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin: 2.0pt 0cm 2.0pt 0cm;"&gt;&lt;SPAN style="font-size: 10.0pt; color: black;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; ADC_SetChannel(ADC,ADC_CHANNEL_AD13);&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin: 2.0pt 0cm 2.0pt 0cm;"&gt;&lt;SPAN style="font-size: 10.0pt; color: black;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/SPAN&gt;&lt;STRONG style="color: #7f0055; font-size: 10.0pt; "&gt;asm&lt;/STRONG&gt;&lt;SPAN style="font-size: 10.0pt; color: black;"&gt;(&lt;/SPAN&gt;&lt;SPAN style="font-size: 10.0pt; color: #2a00ff;"&gt;"&lt;SPAN style="text-decoration: underline;"&gt;wfi&lt;/SPAN&gt;"&lt;/SPAN&gt;&lt;SPAN style="font-size: 10.0pt; color: black;"&gt;);&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin: 2.0pt 0cm 2.0pt 0cm;"&gt;&lt;SPAN style="font-size: 10.0pt; color: black;"&gt;}&lt;STRONG&gt;/*Code gets stuck at this brace*/&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks and best regards,&lt;/P&gt;&lt;P&gt;Prasanna&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 10 Jul 2019 09:58:25 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Microcontrollers/ADC-Accuracy-in-MKE04/m-p/966574#M55137</guid>
      <dc:creator>prasannanaik</dc:creator>
      <dc:date>2019-07-10T09:58:25Z</dc:date>
    </item>
    <item>
      <title>Re: ADC Accuracy in MKE04</title>
      <link>https://community.nxp.com/t5/Kinetis-Microcontrollers/ADC-Accuracy-in-MKE04/m-p/966575#M55138</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;KE04 ADC shouldn't be so bad.I think you can&lt;/P&gt;&lt;P&gt;1. check VDD power supply. Is there ripple?&lt;/P&gt;&lt;P&gt;2. check Ras/Cas(Figure 16 in datasheet)&lt;/P&gt;&lt;P&gt;3. Please try the ADC example in KE04 SDK to see if the problem caused by hardware or software.&lt;/P&gt;&lt;P&gt;4. Check Vrefh noise.&lt;SPAN style="font-size: 15px; font-family: Helvetica, sans-serif;"&gt; Reference voltage and supply voltage should come from low-impedance source, and this usually means sufficient number of ceramic decoupling capacitors close to Microntroller's pins. &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;There are some articles shows how to improve adc performance. You can also take a look.&lt;/P&gt;&lt;P&gt;&lt;A _jive_internal="true" data-containerid="2019" data-containertype="14" data-content-finding="Community" data-objectid="104288" data-objecttype="102" href="https://community.nxp.com/docs/DOC-104288"&gt;Improving my ADC design&lt;/A&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;AN5250&lt;/P&gt;&lt;P&gt;AN4373&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If the processor enters sleep in an exception handler, and if the newly arrived interrupt request has the same or lower priority as the current exception, the processor will not wake up and will remain in a pending state. So, normally we never enter sleep in an exception handler.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Jing&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 11 Jul 2019 08:05:49 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Microcontrollers/ADC-Accuracy-in-MKE04/m-p/966575#M55138</guid>
      <dc:creator>jingpan</dc:creator>
      <dc:date>2019-07-11T08:05:49Z</dc:date>
    </item>
  </channel>
</rss>

