<?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 Reading ADC_LDD values in MQX Software Solutions</title>
    <link>https://community.nxp.com/t5/MQX-Software-Solutions/Reading-ADC-LDD-values/m-p/223592#M6000</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;I have&amp;nbsp; TWR-K20D72M and I read the quick start pdf of the TWR-K20D72M .I am&amp;nbsp; Freescale MQX RTOS 4.0 BSP for TWR-K20D72M.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;Now I want to read the ADC value which comes from the Potentiometer Already attach to the board. So I added ADC_LDD from processor expert and set the pin no. of the potentiometer mentioned in the Manual. My settings are shown in the picture attached. then I generate the code and build bsp.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;My code for reading the value is below.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;LDD_TDeviceData&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; *Analog_DeviceData;&lt;/P&gt;&lt;P&gt;LDD_TError&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Analog;&lt;/P&gt;&lt;P&gt;LDD_TData&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; *Buffer_DAta;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;static uint16_t value;&lt;/P&gt;&lt;P&gt;void Analog_task&lt;/P&gt;&lt;P&gt;(&lt;/P&gt;&lt;P&gt;&amp;nbsp; uint_32 initial_data&lt;/P&gt;&lt;P&gt;)&lt;/P&gt;&lt;P&gt;{&lt;/P&gt;&lt;P&gt;&amp;nbsp; puts("\nInitializing Analog device.....");&lt;/P&gt;&lt;P&gt;&amp;nbsp; Analog_DeviceData = AD1_Init(NULL);&lt;/P&gt;&lt;P&gt;&amp;nbsp; if (Analog_DeviceData == NULL)&amp;nbsp;&amp;nbsp;&amp;nbsp; {&lt;/P&gt;&lt;P&gt;&amp;nbsp; puts("failed");&lt;/P&gt;&lt;P&gt;&amp;nbsp; _task_block();&lt;/P&gt;&lt;P&gt;&amp;nbsp; }&lt;/P&gt;&lt;P&gt;&amp;nbsp; else {&lt;/P&gt;&lt;P&gt;&amp;nbsp; puts("done");&lt;/P&gt;&lt;P&gt;&amp;nbsp; }&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp; for(;;) {&lt;/P&gt;&lt;P&gt;&amp;nbsp; //AD1_StartLoopMeasurement();&lt;/P&gt;&lt;P&gt;&amp;nbsp; AD1_StartLoopMeasurement(&amp;amp;Analog_DeviceData); /* do conversion and wait for the result */&lt;/P&gt;&lt;P&gt;&amp;nbsp; AD1_GetMeasuredValues(&amp;amp;Analog_DeviceData,&amp;amp;Buffer_DAta); /* get the result into value variable */&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; printf("\n - Buffer_DAta&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; = %d Hz", &amp;amp;Buffer_DAta);&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; puts(Buffer_DAta);&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp; }&lt;/P&gt;&lt;P&gt;} &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;But no output Shown I change the value.&lt;/P&gt;&lt;P&gt;Can any one suggest me the efficient way of reading the ADC values using MQX and Processor Expert.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="ADC Freescale.png"&gt;&lt;img src="https://community.nxp.com/t5/image/serverpage/image-id/119497i3A30BA3AC1433F5F/image-size/large?v=v2&amp;amp;px=999" role="button" title="ADC Freescale.png" alt="ADC Freescale.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN class="mce_paste_marker"&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Mon, 17 Jun 2013 10:50:22 GMT</pubDate>
    <dc:creator>yogesh8418</dc:creator>
    <dc:date>2013-06-17T10:50:22Z</dc:date>
    <item>
      <title>Reading ADC_LDD values</title>
      <link>https://community.nxp.com/t5/MQX-Software-Solutions/Reading-ADC-LDD-values/m-p/223592#M6000</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;I have&amp;nbsp; TWR-K20D72M and I read the quick start pdf of the TWR-K20D72M .I am&amp;nbsp; Freescale MQX RTOS 4.0 BSP for TWR-K20D72M.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;Now I want to read the ADC value which comes from the Potentiometer Already attach to the board. So I added ADC_LDD from processor expert and set the pin no. of the potentiometer mentioned in the Manual. My settings are shown in the picture attached. then I generate the code and build bsp.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;My code for reading the value is below.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;LDD_TDeviceData&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; *Analog_DeviceData;&lt;/P&gt;&lt;P&gt;LDD_TError&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Analog;&lt;/P&gt;&lt;P&gt;LDD_TData&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; *Buffer_DAta;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;static uint16_t value;&lt;/P&gt;&lt;P&gt;void Analog_task&lt;/P&gt;&lt;P&gt;(&lt;/P&gt;&lt;P&gt;&amp;nbsp; uint_32 initial_data&lt;/P&gt;&lt;P&gt;)&lt;/P&gt;&lt;P&gt;{&lt;/P&gt;&lt;P&gt;&amp;nbsp; puts("\nInitializing Analog device.....");&lt;/P&gt;&lt;P&gt;&amp;nbsp; Analog_DeviceData = AD1_Init(NULL);&lt;/P&gt;&lt;P&gt;&amp;nbsp; if (Analog_DeviceData == NULL)&amp;nbsp;&amp;nbsp;&amp;nbsp; {&lt;/P&gt;&lt;P&gt;&amp;nbsp; puts("failed");&lt;/P&gt;&lt;P&gt;&amp;nbsp; _task_block();&lt;/P&gt;&lt;P&gt;&amp;nbsp; }&lt;/P&gt;&lt;P&gt;&amp;nbsp; else {&lt;/P&gt;&lt;P&gt;&amp;nbsp; puts("done");&lt;/P&gt;&lt;P&gt;&amp;nbsp; }&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp; for(;;) {&lt;/P&gt;&lt;P&gt;&amp;nbsp; //AD1_StartLoopMeasurement();&lt;/P&gt;&lt;P&gt;&amp;nbsp; AD1_StartLoopMeasurement(&amp;amp;Analog_DeviceData); /* do conversion and wait for the result */&lt;/P&gt;&lt;P&gt;&amp;nbsp; AD1_GetMeasuredValues(&amp;amp;Analog_DeviceData,&amp;amp;Buffer_DAta); /* get the result into value variable */&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; printf("\n - Buffer_DAta&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; = %d Hz", &amp;amp;Buffer_DAta);&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; puts(Buffer_DAta);&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp; }&lt;/P&gt;&lt;P&gt;} &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;But no output Shown I change the value.&lt;/P&gt;&lt;P&gt;Can any one suggest me the efficient way of reading the ADC values using MQX and Processor Expert.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="ADC Freescale.png"&gt;&lt;img src="https://community.nxp.com/t5/image/serverpage/image-id/119497i3A30BA3AC1433F5F/image-size/large?v=v2&amp;amp;px=999" role="button" title="ADC Freescale.png" alt="ADC Freescale.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN class="mce_paste_marker"&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 17 Jun 2013 10:50:22 GMT</pubDate>
      <guid>https://community.nxp.com/t5/MQX-Software-Solutions/Reading-ADC-LDD-values/m-p/223592#M6000</guid>
      <dc:creator>yogesh8418</dc:creator>
      <dc:date>2013-06-17T10:50:22Z</dc:date>
    </item>
    <item>
      <title>Re: Reading ADC_LDD values</title>
      <link>https://community.nxp.com/t5/MQX-Software-Solutions/Reading-ADC-LDD-values/m-p/223593#M6001</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Yogesh,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I would suggest that you take a look to “CW for Microcontrollers v10 and MQX” which can be found at this path:&lt;/P&gt;&lt;P&gt;C:\Freescale\Freescale_MQX_4_0\doc\tools\cw&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;In page 64 you will find an explanation on how to add a new driver and specifically how to add ADC_LDD component.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I just ran a test using the pe_demo and added a task and it works with no issues. I am attaching the main.c file for your reference.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Hope this helps.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;-Alí&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 21 Aug 2013 03:49:03 GMT</pubDate>
      <guid>https://community.nxp.com/t5/MQX-Software-Solutions/Reading-ADC-LDD-values/m-p/223593#M6001</guid>
      <dc:creator>Ali_Pina</dc:creator>
      <dc:date>2013-08-21T03:49:03Z</dc:date>
    </item>
    <item>
      <title>Re: Reading ADC_LDD values</title>
      <link>https://community.nxp.com/t5/MQX-Software-Solutions/Reading-ADC-LDD-values/m-p/223594#M6002</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello Yogesh,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;was this suggestion helpful? Please keep us posted :smileywink:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Best,&lt;/P&gt;&lt;P&gt;Monica.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 27 Aug 2013 19:55:51 GMT</pubDate>
      <guid>https://community.nxp.com/t5/MQX-Software-Solutions/Reading-ADC-LDD-values/m-p/223594#M6002</guid>
      <dc:creator>Monica</dc:creator>
      <dc:date>2013-08-27T19:55:51Z</dc:date>
    </item>
  </channel>
</rss>

