<?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>NFCのトピックNHS3152 ADC convertion and accuracy</title>
    <link>https://community.nxp.com/t5/NFC/NHS3152-ADC-convertion-and-accuracy/m-p/862734#M4896</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi guys,&lt;/P&gt;&lt;P&gt;I met a problem. I am trying to use NHS3152 to measure resistance.&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="pastedImage_1.png"&gt;&lt;img src="https://community.nxp.com/t5/image/serverpage/image-id/77385iE7CEF474308ADE91/image-size/large?v=v2&amp;amp;px=999" role="button" title="pastedImage_1.png" alt="pastedImage_1.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;R0 = 8200;&lt;/P&gt;&lt;P&gt;R = 3900;&lt;/P&gt;&lt;P&gt;VDD = 3300 mV&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The strange thing is the resistance R = 3069.49, not 3900. The ADC value was 898.8 mV (Native value: 2301 ). Is there any problems of the ADC configuration and IOCON? I don't understand where the error is.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Code is :&lt;/P&gt;&lt;P&gt;- Init ADC&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Chip_IOCON_SetPinConfig(NSS_IOCON, IOCON_ANA0_3, IOCON_FUNC_1); /* Set pin function to analog */&lt;BR /&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;Chip_ADCDAC_Init(NSS_ADCDAC0);&lt;BR /&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;Chip_ADCDAC_SetMuxADC(NSS_ADCDAC0, AN3);&lt;BR /&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;Chip_ADCDAC_SetInputRangeADC(NSS_ADCDAC0, ADCDAC_INPUTRANGE_WIDE);&lt;BR /&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;Chip_ADCDAC_SetModeADC(NSS_ADCDAC0, ADCDAC_SINGLE_SHOT);&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;- Get val&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; float res;&lt;BR /&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;int vdd_input = 3300; //Input voltage&lt;BR /&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;int r_0 = 8200; //Pull-up Resistor&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;Chip_ADCDAC_StartADC(NSS_ADCDAC0);&lt;BR /&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;while (!(Chip_ADCDAC_ReadStatus(NSS_ADCDAC0) &amp;amp; ADCDAC_STATUS_ADC_DONE)) {&lt;BR /&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; ; /* Wait until measurement completes. For single-shot mode only! */&lt;BR /&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;}&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;adcInput = ((float)Chip_ADCDAC_GetValueADC(NSS_ADCDAC0) * 1600) / 4096;&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; res = ((float)r_0 * adcInput)/ ((float)&lt;SPAN&gt;v&lt;/SPAN&gt;&lt;SPAN&gt;dd&lt;/SPAN&gt;&lt;SPAN&gt;_input&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/SPAN&gt;- adcInput);&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Sun, 03 Mar 2019 16:19:32 GMT</pubDate>
    <dc:creator>wenyangxie</dc:creator>
    <dc:date>2019-03-03T16:19:32Z</dc:date>
    <item>
      <title>NHS3152 ADC convertion and accuracy</title>
      <link>https://community.nxp.com/t5/NFC/NHS3152-ADC-convertion-and-accuracy/m-p/862734#M4896</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi guys,&lt;/P&gt;&lt;P&gt;I met a problem. I am trying to use NHS3152 to measure resistance.&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="pastedImage_1.png"&gt;&lt;img src="https://community.nxp.com/t5/image/serverpage/image-id/77385iE7CEF474308ADE91/image-size/large?v=v2&amp;amp;px=999" role="button" title="pastedImage_1.png" alt="pastedImage_1.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;R0 = 8200;&lt;/P&gt;&lt;P&gt;R = 3900;&lt;/P&gt;&lt;P&gt;VDD = 3300 mV&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The strange thing is the resistance R = 3069.49, not 3900. The ADC value was 898.8 mV (Native value: 2301 ). Is there any problems of the ADC configuration and IOCON? I don't understand where the error is.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Code is :&lt;/P&gt;&lt;P&gt;- Init ADC&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Chip_IOCON_SetPinConfig(NSS_IOCON, IOCON_ANA0_3, IOCON_FUNC_1); /* Set pin function to analog */&lt;BR /&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;Chip_ADCDAC_Init(NSS_ADCDAC0);&lt;BR /&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;Chip_ADCDAC_SetMuxADC(NSS_ADCDAC0, AN3);&lt;BR /&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;Chip_ADCDAC_SetInputRangeADC(NSS_ADCDAC0, ADCDAC_INPUTRANGE_WIDE);&lt;BR /&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;Chip_ADCDAC_SetModeADC(NSS_ADCDAC0, ADCDAC_SINGLE_SHOT);&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;- Get val&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; float res;&lt;BR /&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;int vdd_input = 3300; //Input voltage&lt;BR /&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;int r_0 = 8200; //Pull-up Resistor&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;Chip_ADCDAC_StartADC(NSS_ADCDAC0);&lt;BR /&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;while (!(Chip_ADCDAC_ReadStatus(NSS_ADCDAC0) &amp;amp; ADCDAC_STATUS_ADC_DONE)) {&lt;BR /&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; ; /* Wait until measurement completes. For single-shot mode only! */&lt;BR /&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;}&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;adcInput = ((float)Chip_ADCDAC_GetValueADC(NSS_ADCDAC0) * 1600) / 4096;&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; res = ((float)r_0 * adcInput)/ ((float)&lt;SPAN&gt;v&lt;/SPAN&gt;&lt;SPAN&gt;dd&lt;/SPAN&gt;&lt;SPAN&gt;_input&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/SPAN&gt;- adcInput);&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 03 Mar 2019 16:19:32 GMT</pubDate>
      <guid>https://community.nxp.com/t5/NFC/NHS3152-ADC-convertion-and-accuracy/m-p/862734#M4896</guid>
      <dc:creator>wenyangxie</dc:creator>
      <dc:date>2019-03-03T16:19:32Z</dc:date>
    </item>
    <item>
      <title>Re: NHS3152 ADC convertion and accuracy</title>
      <link>https://community.nxp.com/t5/NFC/NHS3152-ADC-convertion-and-accuracy/m-p/862735#M4897</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Wenyang,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If I understand correctly, VSS is the ground signal, right?&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="pastedImage_1.png"&gt;&lt;img src="https://community.nxp.com/t5/image/serverpage/image-id/78357i963862C47A0DA517/image-size/large?v=v2&amp;amp;px=999" role="button" title="pastedImage_1.png" alt="pastedImage_1.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;so I think this issue might be due to the measuring method, and we provide a reference in the data sheet, please refer to the following for details.&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="pastedImage_2.png"&gt;&lt;img src="https://community.nxp.com/t5/image/serverpage/image-id/78401i7C820A907986883A/image-size/large?v=v2&amp;amp;px=999" role="button" title="pastedImage_2.png" alt="pastedImage_2.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Hope that helps,&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;Have a great day,&lt;BR /&gt;Kan&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;-------------------------------------------------------------------------------&lt;BR /&gt;Note:&lt;BR /&gt;- If this post answers your question, please click the "Mark Correct" button. Thank you!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;- We are following threads for 7 weeks after the last post, later replies are ignored&lt;BR /&gt; Please open a new thread and refer to the closed one, if you have a related question at a later point in time.&lt;BR /&gt;-------------------------------------------------------------------------------&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 05 Mar 2019 06:53:13 GMT</pubDate>
      <guid>https://community.nxp.com/t5/NFC/NHS3152-ADC-convertion-and-accuracy/m-p/862735#M4897</guid>
      <dc:creator>Kan_Li</dc:creator>
      <dc:date>2019-03-05T06:53:13Z</dc:date>
    </item>
    <item>
      <title>Re: NHS3152 ADC convertion and accuracy</title>
      <link>https://community.nxp.com/t5/NFC/NHS3152-ADC-convertion-and-accuracy/m-p/862736#M4898</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Kan,&lt;/P&gt;&lt;P&gt;Sorry, I made you feel confusing. I put the wrong label there, Vss is reference voltage, here should be Vdd.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 05 Mar 2019 13:39:32 GMT</pubDate>
      <guid>https://community.nxp.com/t5/NFC/NHS3152-ADC-convertion-and-accuracy/m-p/862736#M4898</guid>
      <dc:creator>wenyangxie</dc:creator>
      <dc:date>2019-03-05T13:39:32Z</dc:date>
    </item>
    <item>
      <title>Re: NHS3152 ADC convertion and accuracy</title>
      <link>https://community.nxp.com/t5/NFC/NHS3152-ADC-convertion-and-accuracy/m-p/862737#M4899</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Wenyang,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks for the clarification! this issue is related with the measuring method, due to some special feature of the ADC module, it is only recommend using the method from the data sheet just as above, and we provide a reference code&amp;nbsp; for that purpose , please kindly refer to app_demo_dp_tadherence project in the SDK for details. The sample code can be found in "/app_demo_dp_tadherence/mods/sense/resistive/sense_resistive.c".&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Hope that helps,&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;Have a great day,&lt;BR /&gt;Kan&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;-------------------------------------------------------------------------------&lt;BR /&gt;Note:&lt;BR /&gt;- If this post answers your question, please click the "Mark Correct" button. Thank you!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;- We are following threads for 7 weeks after the last post, later replies are ignored&lt;BR /&gt; Please open a new thread and refer to the closed one, if you have a related question at a later point in time.&lt;BR /&gt;-------------------------------------------------------------------------------&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 06 Mar 2019 05:17:25 GMT</pubDate>
      <guid>https://community.nxp.com/t5/NFC/NHS3152-ADC-convertion-and-accuracy/m-p/862737#M4899</guid>
      <dc:creator>Kan_Li</dc:creator>
      <dc:date>2019-03-06T05:17:25Z</dc:date>
    </item>
    <item>
      <title>Re: NHS3152 ADC convertion and accuracy</title>
      <link>https://community.nxp.com/t5/NFC/NHS3152-ADC-convertion-and-accuracy/m-p/862738#M4900</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&lt;SPAN style="color: #51626f; background-color: #ffffff;"&gt;Hello Wenyang,&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #51626f; background-color: #ffffff;"&gt;Your conversion formula to convert from native value to micro volt uV is not correct. It is a bit more complicated:&lt;/SPAN&gt;&lt;/P&gt;&lt;BLOCKQUOTE class="jive_macro_quote jive-quote jive_text_macro"&gt;&lt;SPAN style="color: #51626f; background-color: #ffffff;"&gt;output in uV = ((native value - native offset) * internal operating voltage / steps per uV) + offset&lt;/SPAN&gt;&lt;/BLOCKQUOTE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #51626f; background-color: #ffffff;"&gt;Plugging in the values for a wide measurement:&lt;/SPAN&gt;&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;&lt;SPAN style="color: #51626f; background-color: #ffffff;"&gt;native offset = 2048&lt;/SPAN&gt;&lt;/LI&gt;&lt;LI&gt;&lt;SPAN style="color: #51626f; background-color: #ffffff;"&gt;internal voltage = 1.2V&lt;/SPAN&gt;&lt;/LI&gt;&lt;LI&gt;&lt;SPAN style="color: #51626f; background-color: #ffffff;"&gt;gain (steps per uV) = 2730&lt;/SPAN&gt;&lt;/LI&gt;&lt;LI&gt;&lt;SPAN style="color: #51626f; background-color: #ffffff;"&gt;offset = 0.9V&lt;/SPAN&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;&lt;SPAN style="color: #51626f; background-color: #ffffff;"&gt;I get a converted measured voltage of&amp;nbsp;a little over 1V, which gives a resistor value for R of a little over 3500.&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN style="color: #51626f; background-color: #ffffff;"&gt;Better, but not correct yet. What is the tolerance on&amp;nbsp;your chosen&amp;nbsp;resistor?&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #51626f; background-color: #ffffff;"&gt;&amp;nbsp;&lt;A class="jx-jive-macro-user" href="https://community.nxp.com/people/Kan"&gt;Kan&lt;/A&gt;&amp;nbsp;'s response here is to be taken to heart: the NHS3152 cannot be used as an accurate generic voltage measurement device. Reason for this is that the saturation of the ADC block sets in too early at the extremities.&amp;nbsp;It is well suited for&amp;nbsp;therapy adherence monitoring and logging. In such cases it can reliably monitor changes and after a calibration step, pill intakes can be monitored accurately, with minimal external components.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #51626f; background-color: #ffffff;"&gt;Kind regards,&lt;BR /&gt;Dries.&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 18 Mar 2019 12:00:18 GMT</pubDate>
      <guid>https://community.nxp.com/t5/NFC/NHS3152-ADC-convertion-and-accuracy/m-p/862738#M4900</guid>
      <dc:creator>driesmoors</dc:creator>
      <dc:date>2019-03-18T12:00:18Z</dc:date>
    </item>
  </channel>
</rss>

