<?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 KEA ADC FIFO in Kinetis Microcontrollers</title>
    <link>https://community.nxp.com/t5/Kinetis-Microcontrollers/KEA-ADC-FIFO/m-p/1377751#M61944</link>
    <description>&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;I am trying to add a new channel to my ADC polling. Adding this new channel to the FIFO breaks everything and I am unsure why. I am trying to measure the internal chip temperature if an I2C connected temperature sensor is not found.&amp;nbsp;&lt;/P&gt;&lt;P&gt;When initializing my ADC I set my FIFO depth to 5 then add the 5 channels to read.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;	ADC_SetFifoDepth(ADC_FIFO_LEVEL5);
	ADC_SetChannel(ADC_CHANNEL_AD10);
	ADC_SetChannel(ADC_CHANNEL_AD13);
	ADC_SetChannel(ADC_CHANNEL_AD5);
	ADC_SetChannel(ADC_CHANNEL_AD14);
	ADC_SetChannel(ADC_CHANNEL_TEMPERATURE);&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;If I add the first 4, or the last 1 it all works as expected. The issue is when I add them all together.&amp;nbsp;&lt;/P&gt;&lt;P&gt;Before this step I check for the I2C temp sensor. If not found I read my Vbg to calculate Vdd as per AN3031.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;	if(!i2c_temp_sensor_found) {
		I2C0_Disable();
		ADC_EnablePCM_BG();
		ADC_SetFifoDepth(ADC_FIFO_LEVEL2);
		ADC_SetChannel(ADC_CHANNEL_BANDGAP);
		ADC_SetChannel(ADC_CHANNEL_BANDGAP);
		keazxx_temp_init();
		ADC_SetFifoDepth(ADC_FIFO_DISABLE);
	}&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;In keazxx_temp_init() I retrieve 2 samples from the FIFO. This should empty the FIFO. Periodically I set my FIFO channels to trigger a new conversion. My ADC IRQ runs as expected. Can anyone see any issues with my setup? Is my FIFO not being cleared correctly? Why when I add one more ADC point does everything go haywire?&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Edit 1: I can confirm that my FIFO is empty at the end of my IRQ routine. I am not only reading some of my data. I am reading it all.&amp;nbsp;&lt;/P&gt;&lt;P&gt;Edit 2: At the end of keazz_init_temp my FIFO is also empty.&amp;nbsp;&lt;/P&gt;&lt;P&gt;Edit 3: I have set my FIFO to AND all compare registers. ADC_SC4 -&amp;gt;&amp;nbsp;ACFSEL = 1 This has no effect.&amp;nbsp;&lt;/P&gt;&lt;P&gt;Edit 4: I have confirmed that my FIFO is full when my ADC IRQ occurs and empty after I read the ADC-&amp;gt;R register 5 times.&lt;/P&gt;&lt;P&gt;Edit 5: The issue has been resolved by setting the&amp;nbsp;Long Sample Time Configuration. My only remaining question is how do I know which of the two slopes to use? When calculating the temp I am given two slops one for temps greater than 25 and one for temps less than 25. If I have not calculated the temp, how do I know which to use?&lt;/P&gt;</description>
    <pubDate>Mon, 29 Nov 2021 16:01:49 GMT</pubDate>
    <dc:creator>MichaelBMiner</dc:creator>
    <dc:date>2021-11-29T16:01:49Z</dc:date>
    <item>
      <title>KEA ADC FIFO</title>
      <link>https://community.nxp.com/t5/Kinetis-Microcontrollers/KEA-ADC-FIFO/m-p/1377751#M61944</link>
      <description>&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;I am trying to add a new channel to my ADC polling. Adding this new channel to the FIFO breaks everything and I am unsure why. I am trying to measure the internal chip temperature if an I2C connected temperature sensor is not found.&amp;nbsp;&lt;/P&gt;&lt;P&gt;When initializing my ADC I set my FIFO depth to 5 then add the 5 channels to read.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;	ADC_SetFifoDepth(ADC_FIFO_LEVEL5);
	ADC_SetChannel(ADC_CHANNEL_AD10);
	ADC_SetChannel(ADC_CHANNEL_AD13);
	ADC_SetChannel(ADC_CHANNEL_AD5);
	ADC_SetChannel(ADC_CHANNEL_AD14);
	ADC_SetChannel(ADC_CHANNEL_TEMPERATURE);&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;If I add the first 4, or the last 1 it all works as expected. The issue is when I add them all together.&amp;nbsp;&lt;/P&gt;&lt;P&gt;Before this step I check for the I2C temp sensor. If not found I read my Vbg to calculate Vdd as per AN3031.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;	if(!i2c_temp_sensor_found) {
		I2C0_Disable();
		ADC_EnablePCM_BG();
		ADC_SetFifoDepth(ADC_FIFO_LEVEL2);
		ADC_SetChannel(ADC_CHANNEL_BANDGAP);
		ADC_SetChannel(ADC_CHANNEL_BANDGAP);
		keazxx_temp_init();
		ADC_SetFifoDepth(ADC_FIFO_DISABLE);
	}&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;In keazxx_temp_init() I retrieve 2 samples from the FIFO. This should empty the FIFO. Periodically I set my FIFO channels to trigger a new conversion. My ADC IRQ runs as expected. Can anyone see any issues with my setup? Is my FIFO not being cleared correctly? Why when I add one more ADC point does everything go haywire?&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Edit 1: I can confirm that my FIFO is empty at the end of my IRQ routine. I am not only reading some of my data. I am reading it all.&amp;nbsp;&lt;/P&gt;&lt;P&gt;Edit 2: At the end of keazz_init_temp my FIFO is also empty.&amp;nbsp;&lt;/P&gt;&lt;P&gt;Edit 3: I have set my FIFO to AND all compare registers. ADC_SC4 -&amp;gt;&amp;nbsp;ACFSEL = 1 This has no effect.&amp;nbsp;&lt;/P&gt;&lt;P&gt;Edit 4: I have confirmed that my FIFO is full when my ADC IRQ occurs and empty after I read the ADC-&amp;gt;R register 5 times.&lt;/P&gt;&lt;P&gt;Edit 5: The issue has been resolved by setting the&amp;nbsp;Long Sample Time Configuration. My only remaining question is how do I know which of the two slopes to use? When calculating the temp I am given two slops one for temps greater than 25 and one for temps less than 25. If I have not calculated the temp, how do I know which to use?&lt;/P&gt;</description>
      <pubDate>Mon, 29 Nov 2021 16:01:49 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Microcontrollers/KEA-ADC-FIFO/m-p/1377751#M61944</guid>
      <dc:creator>MichaelBMiner</dc:creator>
      <dc:date>2021-11-29T16:01:49Z</dc:date>
    </item>
    <item>
      <title>Re: KEA ADC FIFO</title>
      <link>https://community.nxp.com/t5/Kinetis-Microcontrollers/KEA-ADC-FIFO/m-p/1380726#M61975</link>
      <description>&lt;P&gt;Hi, Michael&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Hoping you are excellent.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I would like to know which AD channel are you using for the temperature sensor (ADC_CHANNEL_TEMPERATURE) ?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Also, please refer to this reference manual, in the section 3.8.1.4 page number 78-79 &lt;A href="https://www.nxp.com/webapp/sps/download/preDownload.jsp?render=true" target="_blank"&gt;KEA128 Reference Manual&lt;/A&gt;.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Regarding your last question, about the slopes, you can read this thread, so it can be helpful: &lt;A href="https://community.nxp.com/t5/Kinetis-Microcontrollers/On-chip-temperature-Calculations/m-p/465611" target="_blank"&gt;https://community.nxp.com/t5/Kinetis-Microcontrollers/On-chip-temperature-Calculations/m-p/465611&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Please let me know if you have more questions.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Best Regards,&lt;/P&gt;
&lt;P&gt;Pablo Avalos.&lt;/P&gt;</description>
      <pubDate>Thu, 02 Dec 2021 15:02:30 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Microcontrollers/KEA-ADC-FIFO/m-p/1380726#M61975</guid>
      <dc:creator>PabloAvalos</dc:creator>
      <dc:date>2021-12-02T15:02:30Z</dc:date>
    </item>
  </channel>
</rss>

