<?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 PDB Error on AFE and SAR ADC Sampling Process in Kinetis Microcontrollers</title>
    <link>https://community.nxp.com/t5/Kinetis-Microcontrollers/PDB-Error-on-AFE-and-SAR-ADC-Sampling-Process/m-p/658592#M40388</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P style="margin: 0cm 0cm 8pt;"&gt;&lt;SPAN style="color: #000000; font-size: 15px; line-height: 107%; font-family: 'Arial',sans-serif;"&gt;Hi,&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin: 0cm 0cm 8pt;"&gt;&lt;SPAN style="color: #000000; font-size: 15px; line-height: 107%; font-family: 'Arial',sans-serif;"&gt;My project basic information as below:&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin: 0cm 0cm 8pt;"&gt;&lt;SPAN style="color: #000000; font-size: 15px; line-height: 107%; font-family: 'Arial',sans-serif;"&gt;Hardware:&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin: 0cm 0cm 8pt;"&gt;&lt;SPAN style="color: #000000; font-size: 15px; line-height: 107%; font-family: 'Arial',sans-serif;"&gt;MCU:&amp;nbsp;&amp;nbsp; &amp;nbsp;KM34Z256&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin: 0cm 0cm 8pt;"&gt;&lt;SPAN style="color: #000000; font-size: 15px; line-height: 107%; font-family: 'Arial',sans-serif;"&gt;Three channel AFE channels used for current sampling&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin: 0cm 0cm 8pt;"&gt;&lt;SPAN style="color: #000000; font-size: 15px; line-height: 107%; font-family: 'Arial',sans-serif;"&gt;Three channel SAR ADC used for the voltage sampling&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin: 0cm 0cm 8pt;"&gt;&lt;SPAN style="color: #000000; font-size: 15px; line-height: 107%; font-family: 'Arial',sans-serif;"&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN style="color: #000000; font-size: 15px; line-height: 107%; font-family: 'Arial',sans-serif;"&gt;Target:&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin: 0cm 0cm 8pt;"&gt;&lt;SPAN style="color: #000000; font-size: 15px; line-height: 107%; font-family: 'Arial',sans-serif;"&gt;Use AFE and SAR ADC to sampling three phase AC current and voltage&lt;/SPAN&gt;&lt;SPAN style="color: #000000; font-size: 15px; line-height: 107%; font-family: 'Arial',sans-serif;"&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin: 0cm 0cm 8pt;"&gt;&lt;SPAN style="color: #000000; font-size: 15px; line-height: 107%; font-family: 'Arial',sans-serif;"&gt;Sampling process like below figure: Using AFE CH0 COCO to trigger the PDB module and PDB module to trigger the SAR ADC module.&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin: 0cm 0cm 8pt;"&gt;&lt;/P&gt;&lt;P style="margin: 0cm 0cm 8pt;"&gt;&lt;/P&gt;&lt;P style="margin: 0cm 0cm 8pt;"&gt;&lt;SPAN style="color: #000000; font-size: 15px; line-height: 107%; font-family: 'Arial',sans-serif;"&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="Sampling Process.png"&gt;&lt;img src="https://community.nxp.com/t5/image/serverpage/image-id/14801i46B6889D754809B8/image-size/large?v=v2&amp;amp;px=999" role="button" title="Sampling Process.png" alt="Sampling Process.png" /&gt;&lt;/span&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin: 0cm 0cm 8pt;"&gt;&lt;/P&gt;&lt;P style="margin: 0cm 0cm 8pt;"&gt;&lt;SPAN style="font-size: 15px;"&gt;Normally the process works well. But in debug mode, if I stop the MCU to check some values, then start again (not reset the MCU), sometime&amp;nbsp;the SAR ADC seems not triggered any more, the SAR ADC result is not changed. But the AFE three channels work well. And there is an error in PDB module. &lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin: 0cm 0cm 8pt;"&gt;&lt;SPAN style="font-size: 15px;"&gt;My question is:&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin: 0cm 0cm 8pt;"&gt;&lt;SPAN style="font-size: 15px;"&gt;1. How to avoid this error happen&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin: 0cm 0cm 8pt;"&gt;&lt;SPAN style="font-size: 15px;"&gt;2. If this error occurred, how to restore the PDB or SAR ADC?&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin: 0cm 0cm 8pt;"&gt;&lt;SPAN style="font-size: 15px;"&gt;Martin&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 22 Feb 2017 08:19:07 GMT</pubDate>
    <dc:creator>martinzhang</dc:creator>
    <dc:date>2017-02-22T08:19:07Z</dc:date>
    <item>
      <title>PDB Error on AFE and SAR ADC Sampling Process</title>
      <link>https://community.nxp.com/t5/Kinetis-Microcontrollers/PDB-Error-on-AFE-and-SAR-ADC-Sampling-Process/m-p/658592#M40388</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P style="margin: 0cm 0cm 8pt;"&gt;&lt;SPAN style="color: #000000; font-size: 15px; line-height: 107%; font-family: 'Arial',sans-serif;"&gt;Hi,&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin: 0cm 0cm 8pt;"&gt;&lt;SPAN style="color: #000000; font-size: 15px; line-height: 107%; font-family: 'Arial',sans-serif;"&gt;My project basic information as below:&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin: 0cm 0cm 8pt;"&gt;&lt;SPAN style="color: #000000; font-size: 15px; line-height: 107%; font-family: 'Arial',sans-serif;"&gt;Hardware:&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin: 0cm 0cm 8pt;"&gt;&lt;SPAN style="color: #000000; font-size: 15px; line-height: 107%; font-family: 'Arial',sans-serif;"&gt;MCU:&amp;nbsp;&amp;nbsp; &amp;nbsp;KM34Z256&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin: 0cm 0cm 8pt;"&gt;&lt;SPAN style="color: #000000; font-size: 15px; line-height: 107%; font-family: 'Arial',sans-serif;"&gt;Three channel AFE channels used for current sampling&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin: 0cm 0cm 8pt;"&gt;&lt;SPAN style="color: #000000; font-size: 15px; line-height: 107%; font-family: 'Arial',sans-serif;"&gt;Three channel SAR ADC used for the voltage sampling&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin: 0cm 0cm 8pt;"&gt;&lt;SPAN style="color: #000000; font-size: 15px; line-height: 107%; font-family: 'Arial',sans-serif;"&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN style="color: #000000; font-size: 15px; line-height: 107%; font-family: 'Arial',sans-serif;"&gt;Target:&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin: 0cm 0cm 8pt;"&gt;&lt;SPAN style="color: #000000; font-size: 15px; line-height: 107%; font-family: 'Arial',sans-serif;"&gt;Use AFE and SAR ADC to sampling three phase AC current and voltage&lt;/SPAN&gt;&lt;SPAN style="color: #000000; font-size: 15px; line-height: 107%; font-family: 'Arial',sans-serif;"&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin: 0cm 0cm 8pt;"&gt;&lt;SPAN style="color: #000000; font-size: 15px; line-height: 107%; font-family: 'Arial',sans-serif;"&gt;Sampling process like below figure: Using AFE CH0 COCO to trigger the PDB module and PDB module to trigger the SAR ADC module.&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin: 0cm 0cm 8pt;"&gt;&lt;/P&gt;&lt;P style="margin: 0cm 0cm 8pt;"&gt;&lt;/P&gt;&lt;P style="margin: 0cm 0cm 8pt;"&gt;&lt;SPAN style="color: #000000; font-size: 15px; line-height: 107%; font-family: 'Arial',sans-serif;"&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="Sampling Process.png"&gt;&lt;img src="https://community.nxp.com/t5/image/serverpage/image-id/14801i46B6889D754809B8/image-size/large?v=v2&amp;amp;px=999" role="button" title="Sampling Process.png" alt="Sampling Process.png" /&gt;&lt;/span&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin: 0cm 0cm 8pt;"&gt;&lt;/P&gt;&lt;P style="margin: 0cm 0cm 8pt;"&gt;&lt;SPAN style="font-size: 15px;"&gt;Normally the process works well. But in debug mode, if I stop the MCU to check some values, then start again (not reset the MCU), sometime&amp;nbsp;the SAR ADC seems not triggered any more, the SAR ADC result is not changed. But the AFE three channels work well. And there is an error in PDB module. &lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin: 0cm 0cm 8pt;"&gt;&lt;SPAN style="font-size: 15px;"&gt;My question is:&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin: 0cm 0cm 8pt;"&gt;&lt;SPAN style="font-size: 15px;"&gt;1. How to avoid this error happen&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin: 0cm 0cm 8pt;"&gt;&lt;SPAN style="font-size: 15px;"&gt;2. If this error occurred, how to restore the PDB or SAR ADC?&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin: 0cm 0cm 8pt;"&gt;&lt;SPAN style="font-size: 15px;"&gt;Martin&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 22 Feb 2017 08:19:07 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Microcontrollers/PDB-Error-on-AFE-and-SAR-ADC-Sampling-Process/m-p/658592#M40388</guid>
      <dc:creator>martinzhang</dc:creator>
      <dc:date>2017-02-22T08:19:07Z</dc:date>
    </item>
    <item>
      <title>Re: PDB Error on AFE and SAR ADC Sampling Process</title>
      <link>https://community.nxp.com/t5/Kinetis-Microcontrollers/PDB-Error-on-AFE-and-SAR-ADC-Sampling-Process/m-p/658593#M40389</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi, Martin,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If you use debugger to intervene process that the PDB multiple channels&amp;nbsp; trigger multiple channel ADC conversion in&amp;nbsp; order, for example as you have done:&lt;/P&gt;&lt;P&gt;PDB_CH0 triggers ADC_RA&lt;/P&gt;&lt;P&gt;PDB_CH1 triggers ADC_RB&lt;/P&gt;&lt;P&gt;PDB_CH2 triggers ADC_RC&lt;/P&gt;&lt;P&gt;The order or sequence may be violated. For example, PDB_CH1 triggers ADC_RB while the ADC_RA conversion&amp;nbsp; is in progress, the fact will leads to ERR bits are set in PDB_CH1S register.&lt;/P&gt;&lt;P&gt;As a workaround or for reliability, I suggest you use ADC interrupt, in the ISR of ADC, read the ADC sample and check if the ERR bits in multiple PDB_CHxS registers, if ERR bits are set, just write 0 to ERR bits so that the ADC plus PDB can work later, if your application required, set flag to mark the sample maybe has issue.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Hope it can help you&lt;/P&gt;&lt;P&gt;BR&lt;/P&gt;&lt;P&gt;Xiangjun Rong&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 01 Mar 2017 09:30:06 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Microcontrollers/PDB-Error-on-AFE-and-SAR-ADC-Sampling-Process/m-p/658593#M40389</guid>
      <dc:creator>xiangjun_rong</dc:creator>
      <dc:date>2017-03-01T09:30:06Z</dc:date>
    </item>
  </channel>
</rss>

