<?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 QN9080 - using ADC and CTIMER in Wireless MCU</title>
    <link>https://community.nxp.com/t5/Wireless-MCU/QN9080-using-ADC-and-CTIMER/m-p/1093928#M9981</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello Team,&lt;/P&gt;&lt;P&gt;My customer has the following inquiries below:&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;We need to sample two analog channels with 12 bits at a sample rate of Fs (Fs is in the range&lt;BR /&gt;of 500Hz to 10KHz). Our application needs to store N samples (N is in the range of 100 to&lt;BR /&gt;1000).&lt;BR /&gt;We are using the QN9080 with an internal clock of 32MHz.&lt;BR /&gt;We made two tests :&lt;BR /&gt;1) With basic and minimal instructions we toggle an IO when configuring the processor&lt;BR /&gt;with maximum speed.&lt;BR /&gt;In this test, we expected to have an output frequency of at least 5MHz (we expected that each&lt;BR /&gt;loop would take no more than 100nSec).&lt;BR /&gt;We got a result of 400KHz which means that each loop took about 1250nSec (12.5 times&lt;BR /&gt;slower).&lt;BR /&gt;Attached please find the software that we built and the confirmation of the processor&lt;BR /&gt;(led_test.zip)&lt;BR /&gt;a. Please advise.&lt;BR /&gt;b. Alternatively, please provide us a short program that can demonstrate a&lt;BR /&gt;toggling IO of at least 5 MHz.&lt;BR /&gt;2) We programmed a CTIMER triggered interrupt to trigger the ADC to perform a single&lt;BR /&gt;sampling every T seconds (T is in the range of 2mSec down to 100nSec).&lt;BR /&gt;In addition,&lt;BR /&gt;Upon each CTIMER interrupt (which triggered ACD start sample) - we toggled 1st IO -&lt;BR /&gt;please find the BLUE channel in Picture 1 and Picture 2&lt;BR /&gt;Upen each ADC end of conversion (ACD ready status) - we toggled a 2nd IO - please&lt;BR /&gt;find the YELLOW channel in the Picture 1 and Picture 2&lt;BR /&gt;Our conclusions from the results are that the ADC conversion time is about 2 mSec (we&lt;BR /&gt;need 100uSec).&lt;BR /&gt;Attached please find the software that we used.&lt;BR /&gt;Attached source code project file name: adc_test.zip&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;a. Please advise.&lt;BR /&gt;b. Alternatively, please provide a short program that interrupts the ADC&lt;BR /&gt;every 100nSec and the ADC results are stored in the memory for example 100&lt;BR /&gt;samples.&lt;BR /&gt;Picture 1:&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="qn9080_pic1.jpg"&gt;&lt;img src="https://community.nxp.com/t5/image/serverpage/image-id/51568i154DE7D74A339B97/image-size/large?v=v2&amp;amp;px=999" role="button" title="qn9080_pic1.jpg" alt="qn9080_pic1.jpg" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;Picture 2:&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="qn9080_pic2.jpg"&gt;&lt;img src="https://community.nxp.com/t5/image/serverpage/image-id/51698iA963E25665A9957D/image-size/large?v=v2&amp;amp;px=999" role="button" title="qn9080_pic2.jpg" alt="qn9080_pic2.jpg" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;I would appreciate your support, thanks in advance.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Kind regards,&lt;/P&gt;&lt;P&gt;Shai&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 29 Apr 2020 18:45:20 GMT</pubDate>
    <dc:creator>shai_b</dc:creator>
    <dc:date>2020-04-29T18:45:20Z</dc:date>
    <item>
      <title>QN9080 - using ADC and CTIMER</title>
      <link>https://community.nxp.com/t5/Wireless-MCU/QN9080-using-ADC-and-CTIMER/m-p/1093928#M9981</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello Team,&lt;/P&gt;&lt;P&gt;My customer has the following inquiries below:&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;We need to sample two analog channels with 12 bits at a sample rate of Fs (Fs is in the range&lt;BR /&gt;of 500Hz to 10KHz). Our application needs to store N samples (N is in the range of 100 to&lt;BR /&gt;1000).&lt;BR /&gt;We are using the QN9080 with an internal clock of 32MHz.&lt;BR /&gt;We made two tests :&lt;BR /&gt;1) With basic and minimal instructions we toggle an IO when configuring the processor&lt;BR /&gt;with maximum speed.&lt;BR /&gt;In this test, we expected to have an output frequency of at least 5MHz (we expected that each&lt;BR /&gt;loop would take no more than 100nSec).&lt;BR /&gt;We got a result of 400KHz which means that each loop took about 1250nSec (12.5 times&lt;BR /&gt;slower).&lt;BR /&gt;Attached please find the software that we built and the confirmation of the processor&lt;BR /&gt;(led_test.zip)&lt;BR /&gt;a. Please advise.&lt;BR /&gt;b. Alternatively, please provide us a short program that can demonstrate a&lt;BR /&gt;toggling IO of at least 5 MHz.&lt;BR /&gt;2) We programmed a CTIMER triggered interrupt to trigger the ADC to perform a single&lt;BR /&gt;sampling every T seconds (T is in the range of 2mSec down to 100nSec).&lt;BR /&gt;In addition,&lt;BR /&gt;Upon each CTIMER interrupt (which triggered ACD start sample) - we toggled 1st IO -&lt;BR /&gt;please find the BLUE channel in Picture 1 and Picture 2&lt;BR /&gt;Upen each ADC end of conversion (ACD ready status) - we toggled a 2nd IO - please&lt;BR /&gt;find the YELLOW channel in the Picture 1 and Picture 2&lt;BR /&gt;Our conclusions from the results are that the ADC conversion time is about 2 mSec (we&lt;BR /&gt;need 100uSec).&lt;BR /&gt;Attached please find the software that we used.&lt;BR /&gt;Attached source code project file name: adc_test.zip&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;a. Please advise.&lt;BR /&gt;b. Alternatively, please provide a short program that interrupts the ADC&lt;BR /&gt;every 100nSec and the ADC results are stored in the memory for example 100&lt;BR /&gt;samples.&lt;BR /&gt;Picture 1:&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="qn9080_pic1.jpg"&gt;&lt;img src="https://community.nxp.com/t5/image/serverpage/image-id/51568i154DE7D74A339B97/image-size/large?v=v2&amp;amp;px=999" role="button" title="qn9080_pic1.jpg" alt="qn9080_pic1.jpg" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;Picture 2:&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="qn9080_pic2.jpg"&gt;&lt;img src="https://community.nxp.com/t5/image/serverpage/image-id/51698iA963E25665A9957D/image-size/large?v=v2&amp;amp;px=999" role="button" title="qn9080_pic2.jpg" alt="qn9080_pic2.jpg" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;I would appreciate your support, thanks in advance.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Kind regards,&lt;/P&gt;&lt;P&gt;Shai&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 29 Apr 2020 18:45:20 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Wireless-MCU/QN9080-using-ADC-and-CTIMER/m-p/1093928#M9981</guid>
      <dc:creator>shai_b</dc:creator>
      <dc:date>2020-04-29T18:45:20Z</dc:date>
    </item>
    <item>
      <title>Re: QN9080 - using ADC and CTIMER</title>
      <link>https://community.nxp.com/t5/Wireless-MCU/QN9080-using-ADC-and-CTIMER/m-p/1093929#M9982</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Shai,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I hope you are doing great. I am checking your issue and get back to you as soon as possible.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Mario&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 06 May 2020 02:25:23 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Wireless-MCU/QN9080-using-ADC-and-CTIMER/m-p/1093929#M9982</guid>
      <dc:creator>mario_castaneda</dc:creator>
      <dc:date>2020-05-06T02:25:23Z</dc:date>
    </item>
    <item>
      <title>Re: QN9080 - using ADC and CTIMER</title>
      <link>https://community.nxp.com/t5/Wireless-MCU/QN9080-using-ADC-and-CTIMER/m-p/1093930#M9983</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Dear Mario,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The customer was able to sample two channels using BURST mode (of 100 samples per trigger) on two channels,&lt;/P&gt;&lt;P&gt;but he was able to reach only a sample rate of 2.5ksps per channel.&lt;/P&gt;&lt;P&gt;The goal is to sample two ADC channels (in parallel as much as possible) and reach at least a sample rate of 11ksps per channel.&lt;/P&gt;&lt;P&gt;BTW, while using only one ADC channel he was able to reach ~60ksps in burst mode with downsamples of 32 and Clock of 2M.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;Please advise what is the best practice to achieve this?&lt;/P&gt;&lt;P&gt;I am sharing the relevant part of his code for reviewing (using ADC CH4 and CH5), Thanks in advance.&lt;/P&gt;&lt;BLOCKQUOTE class="jive_macro_quote jive-quote jive_text_macro"&gt;&lt;P&gt;int main(void)&lt;BR /&gt;{&lt;BR /&gt; uint32_t i;&lt;BR /&gt; uint32_t data[ADC_BURST_EXAMPLE_NUMBER];&lt;/P&gt;&lt;P&gt;/* Power on ADC */&lt;BR /&gt; POWER_EnableADC(true);&lt;/P&gt;&lt;P&gt;/* Initialize board hardware. */&lt;BR /&gt; BOARD_InitPins();&lt;BR /&gt; BOARD_BootClockRUN();&lt;BR /&gt; BOARD_InitDebugConsole();&lt;/P&gt;&lt;P&gt;/* Configure the converter and work mode. */&lt;BR /&gt; ADC_Configuration();&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;float fresult;&lt;/P&gt;&lt;P&gt;while (1)&lt;BR /&gt; {&lt;BR /&gt; GETCHAR();&lt;/P&gt;&lt;P&gt;/* Start burst */&lt;BR /&gt; ADC_Enable(DEMO_ADC_BASE, true);&lt;BR /&gt; /* Do software trigger */&lt;BR /&gt; ADC_DoSoftwareTrigger(DEMO_ADC_BASE);&lt;BR /&gt; for (i = 0; i &amp;lt; ADC_BURST_EXAMPLE_NUMBER; i++)&lt;BR /&gt; {&lt;BR /&gt; /* Wait for convert complete */&lt;BR /&gt; while (!(ADC_GetStatusFlags(DEMO_ADC_BASE) &amp;amp; kADC_DataReadyFlag))&lt;BR /&gt; {&lt;BR /&gt; }&lt;BR /&gt; /* Get the result */&lt;BR /&gt; data[i] = (ADC_Type *)DEMO_ADC_BASE-&amp;gt;DATA; // ADC_GetConversionResult(DEMO_ADC_BASE);&lt;BR /&gt; }&lt;BR /&gt; /* Stop burst */&lt;BR /&gt; ADC_Enable(DEMO_ADC_BASE, false);&lt;/P&gt;&lt;P&gt;&lt;BR /&gt; PRINTF("\r\nCH4: \r\n", fresult);&lt;/P&gt;&lt;P&gt;for (i = 0; i &amp;lt; ADC_BURST_EXAMPLE_NUMBER; i++)&lt;BR /&gt; {&lt;BR /&gt; fresult = ADC_ConversionResult2Mv(DEMO_ADC_BASE, DEMO_ADC_CHANNEL_4, DEMO_ADC_CFG_IDX, g_AdcBandgap,&lt;BR /&gt; g_AdcVinn, data[i]);&lt;/P&gt;&lt;P&gt;if (i % 2 == 0)&lt;BR /&gt; {&lt;BR /&gt; PRINTF("%f\r\n", fresult);&lt;BR /&gt; }&lt;BR /&gt; }&lt;/P&gt;&lt;P&gt;PRINTF("\r\nCH5: \r\n", fresult);&lt;/P&gt;&lt;P&gt;for (i = 0; i &amp;lt; ADC_BURST_EXAMPLE_NUMBER; i++)&lt;BR /&gt; {&lt;BR /&gt; fresult = ADC_ConversionResult2Mv(DEMO_ADC_BASE, DEMO_ADC_CHANNEL_5, DEMO_ADC_CFG_IDX, g_AdcBandgap,&lt;BR /&gt; g_AdcVinn, data[i]);&lt;/P&gt;&lt;P&gt;&lt;BR /&gt; if (i % 2 == 1)&lt;BR /&gt; {&lt;BR /&gt; PRINTF("%f\r\n", fresult);&lt;BR /&gt; }&lt;BR /&gt; }&lt;/P&gt;&lt;P&gt;}&lt;BR /&gt;}&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;static void ADC_Configuration(void)&lt;BR /&gt;{&lt;BR /&gt; adc_config_t adcConfigStruct;&lt;BR /&gt; adc_sd_config_t adcSdConfigStruct;&lt;/P&gt;&lt;P&gt;/**&lt;BR /&gt; * Initial ADC to default configuration.&lt;BR /&gt; */&lt;BR /&gt; ADC_GetDefaultConfig(&amp;amp;adcConfigStruct);&lt;BR /&gt; adcConfigStruct.channelEnable = (1U &amp;lt;&amp;lt; DEMO_ADC_CHANNEL_4) | (1U &amp;lt;&amp;lt; DEMO_ADC_CHANNEL_5);&lt;BR /&gt; adcConfigStruct.channelConfig = DEMO_ADC_CFG_IDX;&lt;BR /&gt; adcConfigStruct.triggerSource = DEMO_ADC_TRIGGER;&amp;nbsp;&amp;nbsp;&amp;nbsp; //the TRIGGER is kADC_TriggerSelectSoftware&lt;BR /&gt; adcConfigStruct.convMode = kADC_ConvModeBurstScan;&lt;BR /&gt; adcConfigStruct.clock = kADC_Clock2M;&lt;/P&gt;&lt;P&gt;ADC_Init(DEMO_ADC_BASE, &amp;amp;adcConfigStruct);&lt;/P&gt;&lt;P&gt;/* Initial ADC Sigma Delta(SD) configuration */&lt;BR /&gt; ADC_GetSdDefaultConfig(&amp;amp;adcSdConfigStruct);&lt;BR /&gt; adcSdConfigStruct.downSample = kADC_DownSample32;&lt;BR /&gt; ADC_SetSdConfig(DEMO_ADC_BASE, DEMO_ADC_CFG_IDX, &amp;amp;adcSdConfigStruct);&lt;/P&gt;&lt;P&gt;/* Bandgap voltage */&lt;BR /&gt; g_AdcBandgap = ADC_GetBandgapCalibrationResult(DEMO_ADC_BASE, DEMO_ADC_CFG_IDX);&lt;/P&gt;&lt;P&gt;/* Calibration VINN value */&lt;BR /&gt; g_AdcVinn = ADC_GetVinnCalibrationResult(DEMO_ADC_BASE, &amp;amp;adcConfigStruct);&lt;BR /&gt;}&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;/BLOCKQUOTE&gt;&lt;P&gt;I would appreciate your code review and the support to improve the ADC performance?&lt;/P&gt;&lt;P&gt;In addition, I was thinking that if we use a timer as for ADC trigger (now using software trigger) it might improve ADC performance?&lt;/P&gt;&lt;P&gt;Waiting for your kind response, Thanks a lot.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P style="color: #51626f; background-color: #ffffff; border: 0px; font-size: 14px;"&gt;Kind regards,&lt;/P&gt;&lt;P style="color: #51626f; background-color: #ffffff; border: 0px; font-size: 14px;"&gt;Shai&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 08 May 2020 06:30:48 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Wireless-MCU/QN9080-using-ADC-and-CTIMER/m-p/1093930#M9983</guid>
      <dc:creator>shai_b</dc:creator>
      <dc:date>2020-05-08T06:30:48Z</dc:date>
    </item>
    <item>
      <title>Re: QN9080 - using ADC and CTIMER</title>
      <link>https://community.nxp.com/t5/Wireless-MCU/QN9080-using-ADC-and-CTIMER/m-p/1093931#M9984</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Shai,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Is it possible that you could provide the clock configuration that the customer set?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;However, I have been checking your code, and is it possible that you could comment on the&amp;nbsp;PRINTF("%f\r\n", fresult), the QN9080 is printing in terminal a floating variable, the customer could save all this data and print at the end. You could add a ping toggle and be sure the ksps with an oscilloscope instead.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Please let me know if the customer is not achieving the ksps that they want.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Mario&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 14 May 2020 20:58:25 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Wireless-MCU/QN9080-using-ADC-and-CTIMER/m-p/1093931#M9984</guid>
      <dc:creator>mario_castaneda</dc:creator>
      <dc:date>2020-05-14T20:58:25Z</dc:date>
    </item>
  </channel>
</rss>

