<?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: Questions to K60 ADCs in use with PDB in Kinetis Microcontrollers</title>
    <link>https://community.nxp.com/t5/Kinetis-Microcontrollers/Question-to-K60-ADCs-in-use-with-PDB/m-p/382065#M20344</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Christine&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Using ADC1 A and B requires HW triggering mode otherwie only the A channel can be used. This means that you need to use the PDB triggering it at 10ms and not use an interrupt routine to read it (it can't trigger B channel conversions).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I don't known why you have glitchs on ADC0 since a 1ms interrupt read should be OK. However you could instead try using DMA to store the ADC0 channe value at 1ms rate to a buffer and then at each 10ms PDB interrupt you can process the 10 ADC0 values and the ADC1 A and B values (&lt;EM&gt;assuming that the ADC operatio works around the cause of the glitches&lt;/EM&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;Mark&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Kinetis: &lt;A href="http://www.utasker.com/kinetis.html" title="http://www.utasker.com/kinetis.html"&gt;µTasker Kinetis support&lt;/A&gt;&lt;/P&gt;&lt;P&gt;K60: &lt;A href="http://www.utasker.com/kinetis/TWR-K60N512.html" title="http://www.utasker.com/kinetis/TWR-K60N512.html"&gt;µTasker Kinetis TWR-K60N512 support&lt;/A&gt; / &lt;A href="http://www.utasker.com/kinetis/TWR-K60D100M.html" title="http://www.utasker.com/kinetis/TWR-K60D100M.html"&gt;µTasker Kinetis TWR-K60D100M support&lt;/A&gt; / &lt;A href="http://www.utasker.com/kinetis/TWR-K60F120M.html" title="http://www.utasker.com/kinetis/TWR-K60F120M.html"&gt;µTasker Kinetis TWR-K60F120M support&lt;/A&gt;&lt;/P&gt;&lt;P&gt;ADC/DAC: &lt;A href="http://www.utasker.com/docs/uTasker/uTaskerADC.pdf" title="http://www.utasker.com/docs/uTasker/uTaskerADC.pdf"&gt;http://www.utasker.com/docs/uTasker/uTaskerADC.pdf&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;For the complete "out-of-the-box" Kinetis experience and faster time to market&lt;/EM&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 12 Mar 2015 17:00:49 GMT</pubDate>
    <dc:creator>mjbcswitzerland</dc:creator>
    <dc:date>2015-03-12T17:00:49Z</dc:date>
    <item>
      <title>Question to K60 ADCs in use with PDB</title>
      <link>https://community.nxp.com/t5/Kinetis-Microcontrollers/Question-to-K60-ADCs-in-use-with-PDB/m-p/382064#M20343</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have a question about using PDB with ADCs on a Kinetis K60.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;My system is as follows:&lt;/P&gt;&lt;P&gt;ADC0, A-channel must be converted every 1 ms&lt;BR /&gt;ADC1, A-channel must be converted every 10 ms&lt;BR /&gt;ADC1, B-channel must be converted every 10 ms&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;So I initialized PDB for running with 1 ms and enable ADC1 pre-trigger in every 10th PDB interrupt service routine..&lt;BR /&gt;It seems to work, but I don't know if this is a safe way to do that. My code for the pdb-isr is as following:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier; font-size: 10pt; line-height: 1.5em;"&gt;void pdb_isr( void )&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: courier new,courier; font-size: 10pt;"&gt;{&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-family: courier new,courier; font-size: 10pt;"&gt;&amp;nbsp; PDB0_SC &amp;amp;= ~PDB_SC_PDBIF_MASK;&lt;/SPAN&gt;&lt;BR /&gt;&amp;nbsp; &lt;BR /&gt;&lt;SPAN style="font-family: courier new,courier; font-size: 10pt;"&gt;&amp;nbsp; static intx cntPDB = 0;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-family: courier new,courier; font-size: 10pt;"&gt;&amp;nbsp; if( ++cntPDB == 10 )&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-family: courier new,courier; font-size: 10pt;"&gt;&amp;nbsp; {&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-family: courier new,courier; font-size: 10pt;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; cntPDB = 0;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-family: courier new,courier; font-size: 10pt;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; PDB0_CH1C1 = PDB_C1_EN(0x01) | PDB_C1_TOS(0x01) | PDB_C1_EN(0x02) | PDB_C1_TOS(0x02);&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-family: courier new,courier; font-size: 10pt;"&gt;&amp;nbsp; }&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-family: courier new,courier; font-size: 10pt;"&gt;&amp;nbsp; else&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-family: courier new,courier; font-size: 10pt;"&gt;&amp;nbsp; {&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-family: courier new,courier; font-size: 10pt;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; PDB0_CH1C1 = 0;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-family: courier new,courier; font-size: 10pt;"&gt;&amp;nbsp; }&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-size: 10pt; font-family: courier new,courier;"&gt;}// end of HwADC_PDBISR()&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 12 Mar 2015 15:00:06 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Microcontrollers/Question-to-K60-ADCs-in-use-with-PDB/m-p/382064#M20343</guid>
      <dc:creator>chn</dc:creator>
      <dc:date>2015-03-12T15:00:06Z</dc:date>
    </item>
    <item>
      <title>Re: Questions to K60 ADCs in use with PDB</title>
      <link>https://community.nxp.com/t5/Kinetis-Microcontrollers/Question-to-K60-ADCs-in-use-with-PDB/m-p/382065#M20344</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Christine&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Using ADC1 A and B requires HW triggering mode otherwie only the A channel can be used. This means that you need to use the PDB triggering it at 10ms and not use an interrupt routine to read it (it can't trigger B channel conversions).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I don't known why you have glitchs on ADC0 since a 1ms interrupt read should be OK. However you could instead try using DMA to store the ADC0 channe value at 1ms rate to a buffer and then at each 10ms PDB interrupt you can process the 10 ADC0 values and the ADC1 A and B values (&lt;EM&gt;assuming that the ADC operatio works around the cause of the glitches&lt;/EM&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;Mark&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Kinetis: &lt;A href="http://www.utasker.com/kinetis.html" title="http://www.utasker.com/kinetis.html"&gt;µTasker Kinetis support&lt;/A&gt;&lt;/P&gt;&lt;P&gt;K60: &lt;A href="http://www.utasker.com/kinetis/TWR-K60N512.html" title="http://www.utasker.com/kinetis/TWR-K60N512.html"&gt;µTasker Kinetis TWR-K60N512 support&lt;/A&gt; / &lt;A href="http://www.utasker.com/kinetis/TWR-K60D100M.html" title="http://www.utasker.com/kinetis/TWR-K60D100M.html"&gt;µTasker Kinetis TWR-K60D100M support&lt;/A&gt; / &lt;A href="http://www.utasker.com/kinetis/TWR-K60F120M.html" title="http://www.utasker.com/kinetis/TWR-K60F120M.html"&gt;µTasker Kinetis TWR-K60F120M support&lt;/A&gt;&lt;/P&gt;&lt;P&gt;ADC/DAC: &lt;A href="http://www.utasker.com/docs/uTasker/uTaskerADC.pdf" title="http://www.utasker.com/docs/uTasker/uTaskerADC.pdf"&gt;http://www.utasker.com/docs/uTasker/uTaskerADC.pdf&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;For the complete "out-of-the-box" Kinetis experience and faster time to market&lt;/EM&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 12 Mar 2015 17:00:49 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Microcontrollers/Question-to-K60-ADCs-in-use-with-PDB/m-p/382065#M20344</guid>
      <dc:creator>mjbcswitzerland</dc:creator>
      <dc:date>2015-03-12T17:00:49Z</dc:date>
    </item>
    <item>
      <title>Re: Questions to K60 ADCs in use with PDB</title>
      <link>https://community.nxp.com/t5/Kinetis-Microcontrollers/Question-to-K60-ADCs-in-use-with-PDB/m-p/382066#M20345</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&lt;SPAN lang="EN-US" style="font-size: 10pt; font-family: Arial, sans-serif;"&gt;Hi Mark,&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN lang="EN-US" style="font-size: 10pt; font-family: Arial, sans-serif;"&gt;thanks for your response.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN lang="EN-US" style="font-size: 10pt; font-family: Arial, sans-serif;"&gt;Yes I know, that I have to use PDB. If your remarks for B channel is to question 3:&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN lang="EN-US" style="font-size: 10pt; font-family: Arial, sans-serif;"&gt;I wanted to say that triggers for conversion come correct from PDB, but in the adc1_isr routine, when getting the isr for B channel I read also the A-channel value, if I don't switch the cahnnels with MUXSEL before as in my posted code. But his I have never seen in examples from internet (that don't work for me).&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN lang="EN-US" style="font-size: 10pt; font-family: Arial, sans-serif;"&gt;Am I doing something wrong?&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN lang="EN-US" style="font-size: 10pt; font-family: Arial, sans-serif;"&gt;The glitches when using ADC0 with timerinterrupt and ADC1 with PDB were on the values for ADC1.&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 13 Mar 2015 06:14:51 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Microcontrollers/Question-to-K60-ADCs-in-use-with-PDB/m-p/382066#M20345</guid>
      <dc:creator>chn</dc:creator>
      <dc:date>2015-03-13T06:14:51Z</dc:date>
    </item>
    <item>
      <title>Re: Question to K60 ADCs in use with PDB</title>
      <link>https://community.nxp.com/t5/Kinetis-Microcontrollers/Question-to-K60-ADCs-in-use-with-PDB/m-p/382067#M20346</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Christine&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If there are gitches on the ADC1 value(s) it probably means that the conversion is either not complete when you read the value or it is being disturbed by the enable/disable process (or its conversion time is longer than the 1ms period).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;My feeling is that it would be best to use the PDB with a 10ms cycle so that it suits ADC1 (channels A and B) and use a 1ms timer for ADC0. ADC0 can be set to free-running mode and the 1ms timer can be used to read it. This way there is no risk of disturbing ADC1 PDB operation. Also the ADC1 conversion parameters can be set to highest averaging since it can take longer and so the optimal convesion accuracy be obtained.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Since you already use a 1ms interrupt there is no increase in interrupt overhead involved.&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;Mark&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Kinetis: &lt;A class="jive-link-external-small" data-content-finding="Community" href="http://www.utasker.com/kinetis.html" target="_blank"&gt;µTasker Kinetis support&lt;/A&gt;&lt;/P&gt;&lt;P&gt;K60: &lt;A class="jive-link-external-small" data-content-finding="Community" href="http://www.utasker.com/kinetis/TWR-K60N512.html" target="_blank"&gt;µTasker Kinetis TWR-K60N512 support&lt;/A&gt; / &lt;A class="jive-link-external-small" data-content-finding="Community" href="http://www.utasker.com/kinetis/TWR-K60D100M.html" target="_blank"&gt;µTasker Kinetis TWR-K60D100M support&lt;/A&gt; / &lt;A class="jive-link-external-small" data-content-finding="Community" href="http://www.utasker.com/kinetis/TWR-K60F120M.html" target="_blank"&gt;µTasker Kinetis TWR-K60F120M support&lt;/A&gt;&lt;/P&gt;&lt;P&gt;ADC/DAC: &lt;A class="jive-link-external-small" data-content-finding="Community" href="http://www.utasker.com/docs/uTasker/uTaskerADC.pdf" target="_blank"&gt;http://www.utasker.com/docs/uTasker/uTaskerADC.pdf&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;For the complete "out-of-the-box" Kinetis experience and faster time to market&lt;/EM&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 14 Mar 2015 16:41:21 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Microcontrollers/Question-to-K60-ADCs-in-use-with-PDB/m-p/382067#M20346</guid>
      <dc:creator>mjbcswitzerland</dc:creator>
      <dc:date>2015-03-14T16:41:21Z</dc:date>
    </item>
  </channel>
</rss>

