<?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 Help needed on Processor Expert Coding on ADC_LDD KE06Z in CodeWarrior Development Tools</title>
    <link>https://community.nxp.com/t5/CodeWarrior-Development-Tools/Help-needed-on-Processor-Expert-Coding-on-ADC-LDD-KE06Z/m-p/662908#M5875</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I am using&amp;nbsp;FRDM-KE06Z (&lt;SPAN&gt;MKE06Z128VLK4)&lt;/SPAN&gt; to measure the temperature (analog input) and display output at hyper terminal with time stamp. I am using CW 10.6 Processor Expert (PE) to generate&amp;nbsp;code for RTC, ConsoleIO and ADC.&amp;nbsp;I have selected the required components from&amp;nbsp;the components library and configured them in component inspector.&amp;nbsp;I don't have major problem on RTC and Console coding since&amp;nbsp;I &amp;nbsp;can manage to printf the time stamp at the hyper terminal based on internal RTC clocking from controller. My major problem is I cannot&amp;nbsp;get ADC input readings correctly and to display the raw hex value at hyper terminal.&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="172227_172227.jpg"&gt;&lt;img src="https://community.nxp.com/t5/image/serverpage/image-id/122626i402C90780063139E/image-size/large?v=v2&amp;amp;px=999" role="button" title="172227_172227.jpg" alt="172227_172227.jpg" /&gt;&lt;/span&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="ADC_LDD component inspector.jpg"&gt;&lt;img src="https://community.nxp.com/t5/image/serverpage/image-id/9802iCC0D11CDB493093C/image-size/large?v=v2&amp;amp;px=999" role="button" title="ADC_LDD component inspector.jpg" alt="ADC_LDD component inspector.jpg" /&gt;&lt;/span&gt;&amp;nbsp;&lt;span class="lia-inline-image-display-wrapper" image-alt="172228_172228.jpg"&gt;&lt;img src="https://community.nxp.com/t5/image/serverpage/image-id/122627iD82B418E0E82D3F8/image-size/large?v=v2&amp;amp;px=999" role="button" title="172228_172228.jpg" alt="172228_172228.jpg" /&gt;&lt;/span&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="output at hyperterminal.jpg"&gt;&lt;img src="https://community.nxp.com/t5/image/serverpage/image-id/9757i0A5F09620FFAAA02/image-size/large?v=v2&amp;amp;px=999" role="button" title="output at hyperterminal.jpg" alt="output at hyperterminal.jpg" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;I have attached screen shot of ADC_LDD configuration, main.c code and hyper terminal output.&lt;/P&gt;&lt;P&gt;I follow the typical usage code that can be found at the Help on Component &amp;gt; Component ADC_LDD &amp;gt; Typical Usage.&lt;/P&gt;&lt;P&gt;I suspect the program &amp;nbsp;stuck at before this line:&lt;/P&gt;&lt;P style="min- padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P style="min- padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;....&lt;BR /&gt;&lt;SPAN style="font-size: 13px;"&gt;&lt;EM&gt; while (!AD1_GetMeasurementCompleteStatus(MyADCPtr)) {}; /* Wait for conversion completeness */&lt;/EM&gt;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-size: 13px;"&gt;&lt;EM&gt; Error = AD1_GetMeasuredValues(MyADCPtr, (LDD_TData *)MeasuredValues); /* Read measured values */&lt;/EM&gt;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-size: 13px;"&gt;&lt;EM&gt; i++;&lt;/EM&gt;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-size: 13px;"&gt;&lt;EM&gt; printf("MyADCPtr:0x%x 0x%x MeasuredValues:0x%x 0x%x [%d]\n",MyADCPtr,&amp;amp;MyADCPtr,MeasuredValues, &amp;amp;MeasuredValues, i);&lt;/EM&gt;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-size: 13px;"&gt;&lt;EM&gt; Wait_ms(12000);&lt;/EM&gt;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-size: 13px;"&gt;&lt;EM&gt; }&lt;/EM&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="min- padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;May I know what is the problem? and what is the suggestion to fix it? Thank you in advance.&lt;/P&gt;&lt;P style="min- padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;P/S: Before using PE&amp;nbsp;for code generation. I had tried on the ADC_poll_demo sample code from &lt;A _jive_internal="true" class="" href="https://community.nxp.com/external-link.jspa?url=http%3A%2F%2Fwww.nxp.com%2Fwebapp%2Fsps%2Fdownload%2Flicense.jsp%3FcolCode%3DKEXX_DRIVERS_V1.2.1_DEVD"&gt;FRDM-KEXX Driver Library Package&lt;/A&gt;&amp;nbsp;and it works fine to read and show the raw hex value of each analog channel. I would expect to get the similar kind of raw hex value from the code generated from PE.&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Original Attachment has been moved to: &lt;A _jive_internal="true" href="https://community.nxp.com/docs/DOC-337848"&gt;main.c.zip&lt;/A&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Fri, 09 Dec 2016 09:43:42 GMT</pubDate>
    <dc:creator>eyeow84</dc:creator>
    <dc:date>2016-12-09T09:43:42Z</dc:date>
    <item>
      <title>Help needed on Processor Expert Coding on ADC_LDD KE06Z</title>
      <link>https://community.nxp.com/t5/CodeWarrior-Development-Tools/Help-needed-on-Processor-Expert-Coding-on-ADC-LDD-KE06Z/m-p/662908#M5875</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I am using&amp;nbsp;FRDM-KE06Z (&lt;SPAN&gt;MKE06Z128VLK4)&lt;/SPAN&gt; to measure the temperature (analog input) and display output at hyper terminal with time stamp. I am using CW 10.6 Processor Expert (PE) to generate&amp;nbsp;code for RTC, ConsoleIO and ADC.&amp;nbsp;I have selected the required components from&amp;nbsp;the components library and configured them in component inspector.&amp;nbsp;I don't have major problem on RTC and Console coding since&amp;nbsp;I &amp;nbsp;can manage to printf the time stamp at the hyper terminal based on internal RTC clocking from controller. My major problem is I cannot&amp;nbsp;get ADC input readings correctly and to display the raw hex value at hyper terminal.&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="172227_172227.jpg"&gt;&lt;img src="https://community.nxp.com/t5/image/serverpage/image-id/122626i402C90780063139E/image-size/large?v=v2&amp;amp;px=999" role="button" title="172227_172227.jpg" alt="172227_172227.jpg" /&gt;&lt;/span&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="ADC_LDD component inspector.jpg"&gt;&lt;img src="https://community.nxp.com/t5/image/serverpage/image-id/9802iCC0D11CDB493093C/image-size/large?v=v2&amp;amp;px=999" role="button" title="ADC_LDD component inspector.jpg" alt="ADC_LDD component inspector.jpg" /&gt;&lt;/span&gt;&amp;nbsp;&lt;span class="lia-inline-image-display-wrapper" image-alt="172228_172228.jpg"&gt;&lt;img src="https://community.nxp.com/t5/image/serverpage/image-id/122627iD82B418E0E82D3F8/image-size/large?v=v2&amp;amp;px=999" role="button" title="172228_172228.jpg" alt="172228_172228.jpg" /&gt;&lt;/span&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="output at hyperterminal.jpg"&gt;&lt;img src="https://community.nxp.com/t5/image/serverpage/image-id/9757i0A5F09620FFAAA02/image-size/large?v=v2&amp;amp;px=999" role="button" title="output at hyperterminal.jpg" alt="output at hyperterminal.jpg" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;I have attached screen shot of ADC_LDD configuration, main.c code and hyper terminal output.&lt;/P&gt;&lt;P&gt;I follow the typical usage code that can be found at the Help on Component &amp;gt; Component ADC_LDD &amp;gt; Typical Usage.&lt;/P&gt;&lt;P&gt;I suspect the program &amp;nbsp;stuck at before this line:&lt;/P&gt;&lt;P style="min- padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P style="min- padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;....&lt;BR /&gt;&lt;SPAN style="font-size: 13px;"&gt;&lt;EM&gt; while (!AD1_GetMeasurementCompleteStatus(MyADCPtr)) {}; /* Wait for conversion completeness */&lt;/EM&gt;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-size: 13px;"&gt;&lt;EM&gt; Error = AD1_GetMeasuredValues(MyADCPtr, (LDD_TData *)MeasuredValues); /* Read measured values */&lt;/EM&gt;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-size: 13px;"&gt;&lt;EM&gt; i++;&lt;/EM&gt;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-size: 13px;"&gt;&lt;EM&gt; printf("MyADCPtr:0x%x 0x%x MeasuredValues:0x%x 0x%x [%d]\n",MyADCPtr,&amp;amp;MyADCPtr,MeasuredValues, &amp;amp;MeasuredValues, i);&lt;/EM&gt;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-size: 13px;"&gt;&lt;EM&gt; Wait_ms(12000);&lt;/EM&gt;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-size: 13px;"&gt;&lt;EM&gt; }&lt;/EM&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="min- padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;May I know what is the problem? and what is the suggestion to fix it? Thank you in advance.&lt;/P&gt;&lt;P style="min- padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;P/S: Before using PE&amp;nbsp;for code generation. I had tried on the ADC_poll_demo sample code from &lt;A _jive_internal="true" class="" href="https://community.nxp.com/external-link.jspa?url=http%3A%2F%2Fwww.nxp.com%2Fwebapp%2Fsps%2Fdownload%2Flicense.jsp%3FcolCode%3DKEXX_DRIVERS_V1.2.1_DEVD"&gt;FRDM-KEXX Driver Library Package&lt;/A&gt;&amp;nbsp;and it works fine to read and show the raw hex value of each analog channel. I would expect to get the similar kind of raw hex value from the code generated from PE.&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Original Attachment has been moved to: &lt;A _jive_internal="true" href="https://community.nxp.com/docs/DOC-337848"&gt;main.c.zip&lt;/A&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 09 Dec 2016 09:43:42 GMT</pubDate>
      <guid>https://community.nxp.com/t5/CodeWarrior-Development-Tools/Help-needed-on-Processor-Expert-Coding-on-ADC-LDD-KE06Z/m-p/662908#M5875</guid>
      <dc:creator>eyeow84</dc:creator>
      <dc:date>2016-12-09T09:43:42Z</dc:date>
    </item>
    <item>
      <title>Re: Help needed on Processor Expert Coding on ADC_LDD KE06Z</title>
      <link>https://community.nxp.com/t5/CodeWarrior-Development-Tools/Help-needed-on-Processor-Expert-Coding-on-ADC-LDD-KE06Z/m-p/662909#M5876</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello Eyeow,&lt;/P&gt;&lt;P&gt;I think is some error in the generate code of PE.&lt;/P&gt;&lt;P&gt;For the function of "AD1_GetMeasurementCompleteStatus()":&lt;/P&gt;&lt;PRE class="language-c line-numbers"&gt;&lt;CODE&gt;bool &lt;SPAN class="token function"&gt;AD1_GetMeasurementCompleteStatus&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;LDD_TDeviceData &lt;SPAN class="operator token"&gt;*&lt;/SPAN&gt;DeviceDataPtr&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;
&lt;SPAN class="punctuation token"&gt;{&lt;/SPAN&gt;
&amp;nbsp; uint8_t Status&lt;SPAN class="punctuation token"&gt;;&lt;/SPAN&gt;
&amp;nbsp; AD1_TDeviceDataPtr DeviceDataPrv &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; &lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;AD1_TDeviceDataPtr&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;DeviceDataPtr&lt;SPAN class="punctuation token"&gt;;&lt;/SPAN&gt;
&amp;nbsp; Status &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; DeviceDataPrv&lt;SPAN class="operator token"&gt;-&amp;gt;&lt;/SPAN&gt;CompleteStatus&lt;SPAN class="punctuation token"&gt;;&lt;/SPAN&gt; &lt;SPAN class="comment token"&gt;/* Save flag for return */&lt;/SPAN&gt;
&amp;nbsp; DeviceDataPrv&lt;SPAN class="operator token"&gt;-&amp;gt;&lt;/SPAN&gt;CompleteStatus &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; FALSE&lt;SPAN class="punctuation token"&gt;;&lt;/SPAN&gt; &lt;SPAN class="comment token"&gt;/* Clear measurement complete status flag */&lt;/SPAN&gt;
&amp;nbsp; &lt;SPAN class="keyword token"&gt;return&lt;/SPAN&gt; &lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;bool&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;Status&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&lt;SPAN class="operator token"&gt;?&lt;/SPAN&gt; TRUE &lt;SPAN class="punctuation token"&gt;:&lt;/SPAN&gt; FALSE&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;;&lt;/SPAN&gt; &lt;SPAN class="comment token"&gt;/* Return saved status */&lt;/SPAN&gt;
&lt;SPAN class="punctuation token"&gt;}&lt;/SPAN&gt;‍‍‍‍‍‍‍‍&lt;SPAN class="line-numbers-rows"&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;it have not really check the Conversion Complete Flag ADC_SCA -&amp;gt; COCO .&lt;/P&gt;&lt;P&gt;In fact , you can check this flag have been set to "1" :&lt;/P&gt;&lt;P&gt;&lt;SPAN class="lia-inline-image-display-wrapper" image-alt="pastedImage_1.png"&gt;&lt;IMG alt="pastedImage_1.png" src="https://community.nxp.com/t5/image/serverpage/image-id/11223i5ECA8C4C9AC57B27/image-size/large?v=v2&amp;amp;px=999" title="pastedImage_1.png" /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;So the workaround is change this function , to check the flag of COCO . The detail code please refer to the generated code of KL or K series .&lt;/P&gt;&lt;P&gt;For example create a project about MKL25, then add ADC_LDD component , check the function of "AD1_GetMeasurementCompleteStatus()":&lt;/P&gt;&lt;P&gt;&lt;SPAN class="lia-inline-image-display-wrapper" image-alt="pastedImage_2.png"&gt;&lt;IMG alt="pastedImage_2.png" src="https://community.nxp.com/t5/image/serverpage/image-id/11311iD37E19BF27321CB0/image-size/large?v=v2&amp;amp;px=999" title="pastedImage_2.png" /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;Also the function of "AD1_GetMeasuredValues" .&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Hope it helps&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;Have a great day,&lt;BR /&gt;Alice Yang&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;-----------------------------------------------------------------------------------------------------------------------&lt;BR /&gt;Note: If this post answers your question, please click the Correct Answer button. Thank you!&lt;BR /&gt;-----------------------------------------------------------------------------------------------------------------------&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 02 Nov 2020 13:56:41 GMT</pubDate>
      <guid>https://community.nxp.com/t5/CodeWarrior-Development-Tools/Help-needed-on-Processor-Expert-Coding-on-ADC-LDD-KE06Z/m-p/662909#M5876</guid>
      <dc:creator>Alice_Yang</dc:creator>
      <dc:date>2020-11-02T13:56:41Z</dc:date>
    </item>
  </channel>
</rss>

