<?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 Re: How to read ADC values in IMX6ULL sysfs userspace ? in i.MX Processors</title>
    <link>https://community.nxp.com/t5/i-MX-Processors/How-to-read-ADC-values-in-IMX6ULL-sysfs-userspace/m-p/1728800#M213092</link>
    <description>&lt;P&gt;&lt;SPAN class="im"&gt;Hi &lt;a href="https://community.nxp.com/t5/user/viewprofilepage/user-id/123484"&gt;@_ZZ_&lt;/a&gt;,&lt;/SPAN&gt;&lt;/P&gt;
&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;
&lt;DIV&gt;I hope you are doing well.&lt;/DIV&gt;
&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;DIV&gt;One can try adding the below property in the adc node in the device tree.&lt;/DIV&gt;
&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;
&lt;DIV&gt;&lt;STRONG&gt;vref-supply = &amp;lt;&amp;amp;reg_vref_3v3&amp;gt;;&lt;/STRONG&gt;&lt;/DIV&gt;
&lt;DIV&gt;&lt;STRONG&gt;&amp;nbsp;&lt;/STRONG&gt;&lt;/DIV&gt;
&lt;DIV&gt;&amp;amp; below node in dts.&lt;/DIV&gt;
&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;
&lt;DIV&gt;reg_vref_3v3: regulator-adc-verf {&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;compatible = "regulator-fixed";&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;regulator-name = "vref-3v3";&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;regulator-min-microvolt = &amp;lt;3300000&amp;gt;;&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;regulator-max-microvolt = &amp;lt;3300000&amp;gt;;&lt;BR /&gt;};&lt;/DIV&gt;
&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;
&lt;DIV&gt;Please refer to&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;A href="https://github.com/nxp-imx/linux-imx/blob/lf-6.1.y/Documentation/devicetree/bindings/iio/adc/fsl%2Cvf610-adc.yaml" target="_blank" rel="noopener" data-saferedirecturl="https://www.google.com/url?q=https://github.com/nxp-imx/linux-imx/blob/lf-6.1.y/Documentation/devicetree/bindings/iio/adc/fsl%252Cvf610-adc.yaml&amp;amp;source=gmail&amp;amp;ust=1695706062268000&amp;amp;usg=AOvVaw29s0sMRwDMYWZ3mUJ4Hvqd"&gt;Documentation/devicetree/&lt;WBR /&gt;bindings/iio/adc/fsl,vf610-&lt;WBR /&gt;adc.yaml&lt;/A&gt;&lt;/DIV&gt;
&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;
&lt;DIV&gt;Please mention&amp;nbsp;linux BSP version &amp;amp; share the device tree file.&lt;/DIV&gt;
&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;
&lt;DIV&gt;Please share the actual voltage present at ADC channel pin and RAW input data for it.&lt;/DIV&gt;
&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;
&lt;DIV&gt;Please try to measure the output of Vref regulator &amp;amp; make sure it is exactly&amp;nbsp;around 3.3v.&lt;/DIV&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;
&lt;DIV&gt;Thanks &amp;amp;&amp;nbsp;Regards,&lt;/DIV&gt;
&lt;P&gt;&lt;LI-WRAPPER&gt;&lt;/LI-WRAPPER&gt;Sanket Parekh&lt;/P&gt;</description>
    <pubDate>Mon, 25 Sep 2023 09:30:05 GMT</pubDate>
    <dc:creator>Sanket_Parekh</dc:creator>
    <dc:date>2023-09-25T09:30:05Z</dc:date>
    <item>
      <title>How to read ADC values in IMX6ULL sysfs userspace ?</title>
      <link>https://community.nxp.com/t5/i-MX-Processors/How-to-read-ADC-values-in-IMX6ULL-sysfs-userspace/m-p/1725522#M212789</link>
      <description>&lt;P&gt;Hi,&amp;nbsp;&lt;/P&gt;&lt;P&gt;How do I read the&amp;nbsp; ADC values in IMX6ULL userspace?&lt;/P&gt;&lt;P&gt;for your information reference voltage is 3.3v&lt;/P&gt;&lt;P&gt;in&lt;STRONG&gt;&amp;nbsp;/sys/bus/iio/devices/iio:device0/&lt;/STRONG&gt; I have the following items&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="img_x.png" style="width: 999px;"&gt;&lt;img src="https://community.nxp.com/t5/image/serverpage/image-id/241620iE49CB35338ACCAD5/image-size/large?v=v2&amp;amp;px=999" role="button" title="img_x.png" alt="img_x.png" /&gt;&lt;/span&gt;some communities say it is done as below&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&amp;nbsp;awk "BEGIN{printf (\"%d\n\", (in_voltage0_raw + in_voltage_offset) * in_voltage_scale)}"&amp;nbsp;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;but in my case, there is no&amp;nbsp;&amp;nbsp;&lt;STRONG&gt;in_voltage_offset&lt;/STRONG&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;if I choose the in_voltage_offset as 0 , only one of the readings make sense&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 19 Sep 2023 12:36:31 GMT</pubDate>
      <guid>https://community.nxp.com/t5/i-MX-Processors/How-to-read-ADC-values-in-IMX6ULL-sysfs-userspace/m-p/1725522#M212789</guid>
      <dc:creator>_ZZ_</dc:creator>
      <dc:date>2023-09-19T12:36:31Z</dc:date>
    </item>
    <item>
      <title>Re: How to read ADC values in IMX6ULL sysfs userspace ?</title>
      <link>https://community.nxp.com/t5/i-MX-Processors/How-to-read-ADC-values-in-IMX6ULL-sysfs-userspace/m-p/1726708#M212902</link>
      <description>&lt;DIV&gt;Hi &lt;a href="https://community.nxp.com/t5/user/viewprofilepage/user-id/123484"&gt;@_ZZ_&lt;/a&gt;,&lt;/DIV&gt;
&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;
&lt;DIV&gt;I hope you are doing well.&lt;/DIV&gt;
&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;
&lt;DIV&gt;Could please please share more information regarding&amp;nbsp;which channel and pin is used to read ADC values &amp;amp; sampling frequency?&lt;/DIV&gt;
&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;
&lt;DIV&gt;Thanks &amp;amp; Regards,&lt;BR /&gt;Sanket Parekh&lt;/DIV&gt;</description>
      <pubDate>Thu, 21 Sep 2023 04:46:58 GMT</pubDate>
      <guid>https://community.nxp.com/t5/i-MX-Processors/How-to-read-ADC-values-in-IMX6ULL-sysfs-userspace/m-p/1726708#M212902</guid>
      <dc:creator>Sanket_Parekh</dc:creator>
      <dc:date>2023-09-21T04:46:58Z</dc:date>
    </item>
    <item>
      <title>Re: How to read ADC values in IMX6ULL sysfs userspace ?</title>
      <link>https://community.nxp.com/t5/i-MX-Processors/How-to-read-ADC-values-in-IMX6ULL-sysfs-userspace/m-p/1727014#M212933</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.nxp.com/t5/user/viewprofilepage/user-id/202155"&gt;@Sanket_Parekh&lt;/a&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;According to the&amp;nbsp;i.MX 6ULL Applications Processor Reference Manual section 13.2&lt;/P&gt;&lt;P&gt;&lt;FONT color="#0000FF"&gt;&lt;STRONG&gt;ADC1_IN0 Analog channel 1 input 0 GPIO1_IO00&lt;/STRONG&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#0000FF"&gt;&lt;FONT color="#000000"&gt;Also&amp;nbsp;&lt;/FONT&gt;&lt;STRONG&gt;&lt;FONT color="#FF0000"&gt;vf610&amp;nbsp;&lt;/FONT&gt;&lt;/STRONG&gt;&lt;FONT color="#000000"&gt;ADC driver in my Linux firmware and 12 bit resolution is used.&amp;nbsp;&amp;nbsp;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;in my Linux user space, it is &lt;FONT color="#FF0000"&gt;&lt;STRONG&gt;in_voltage0_raw &lt;/STRONG&gt;&lt;FONT color="#000000"&gt;is the corresponding sysfs file to read the value.&amp;nbsp;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#FF0000"&gt;&lt;FONT color="#000000"&gt;&lt;SPAN&gt;&lt;SPAN class=""&gt;&lt;STRONG&gt;&lt;FONT color="#FF0000"&gt;in_voltage_scale&lt;/FONT&gt;&lt;/STRONG&gt; is &lt;STRONG&gt;1048.575927734&lt;/STRONG&gt; (I am not sure how it has been calculated as I have not build the firmware myself).&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#FF0000"&gt;&lt;FONT color="#000000"&gt;&lt;SPAN&gt;&lt;SPAN class=""&gt;&lt;STRONG&gt;58098&lt;/STRONG&gt; is my default sampling frequency and available sampling frequencies are below: &lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&lt;FONT color="#FF0000"&gt;&lt;FONT color="#000000"&gt;&lt;SPAN class=""&gt;&lt;SPAN class=""&gt;206250, 58098, 29676, 15000, 7541&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#000000"&gt;Reference&amp;nbsp;voltage is 3.3v which is an actual regulator. however, every time after I power up my board and run "&lt;STRONG&gt;dmesg&lt;/STRONG&gt;" Linux&amp;nbsp;command, I see few kernel warning messages related to the ADC and the reference voltage as below:&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#FF6600"&gt;&lt;SPAN&gt;&lt;SPAN class=""&gt;[&amp;nbsp;&amp;nbsp;&amp;nbsp; 2.568224] vf610-adc 2198000.adc: 2198000.adc supply vref not found, using dummy regulator&lt;BR /&gt;[&amp;nbsp;&amp;nbsp;&amp;nbsp; 2.569165] vf610-adc 2198000.adc: Linked as a consumer to regulator.0&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;Thanks,&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;</description>
      <pubDate>Fri, 22 Sep 2023 08:03:29 GMT</pubDate>
      <guid>https://community.nxp.com/t5/i-MX-Processors/How-to-read-ADC-values-in-IMX6ULL-sysfs-userspace/m-p/1727014#M212933</guid>
      <dc:creator>_ZZ_</dc:creator>
      <dc:date>2023-09-22T08:03:29Z</dc:date>
    </item>
    <item>
      <title>Re: How to read ADC values in IMX6ULL sysfs userspace ?</title>
      <link>https://community.nxp.com/t5/i-MX-Processors/How-to-read-ADC-values-in-IMX6ULL-sysfs-userspace/m-p/1728800#M213092</link>
      <description>&lt;P&gt;&lt;SPAN class="im"&gt;Hi &lt;a href="https://community.nxp.com/t5/user/viewprofilepage/user-id/123484"&gt;@_ZZ_&lt;/a&gt;,&lt;/SPAN&gt;&lt;/P&gt;
&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;
&lt;DIV&gt;I hope you are doing well.&lt;/DIV&gt;
&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;DIV&gt;One can try adding the below property in the adc node in the device tree.&lt;/DIV&gt;
&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;
&lt;DIV&gt;&lt;STRONG&gt;vref-supply = &amp;lt;&amp;amp;reg_vref_3v3&amp;gt;;&lt;/STRONG&gt;&lt;/DIV&gt;
&lt;DIV&gt;&lt;STRONG&gt;&amp;nbsp;&lt;/STRONG&gt;&lt;/DIV&gt;
&lt;DIV&gt;&amp;amp; below node in dts.&lt;/DIV&gt;
&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;
&lt;DIV&gt;reg_vref_3v3: regulator-adc-verf {&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;compatible = "regulator-fixed";&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;regulator-name = "vref-3v3";&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;regulator-min-microvolt = &amp;lt;3300000&amp;gt;;&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;regulator-max-microvolt = &amp;lt;3300000&amp;gt;;&lt;BR /&gt;};&lt;/DIV&gt;
&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;
&lt;DIV&gt;Please refer to&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;A href="https://github.com/nxp-imx/linux-imx/blob/lf-6.1.y/Documentation/devicetree/bindings/iio/adc/fsl%2Cvf610-adc.yaml" target="_blank" rel="noopener" data-saferedirecturl="https://www.google.com/url?q=https://github.com/nxp-imx/linux-imx/blob/lf-6.1.y/Documentation/devicetree/bindings/iio/adc/fsl%252Cvf610-adc.yaml&amp;amp;source=gmail&amp;amp;ust=1695706062268000&amp;amp;usg=AOvVaw29s0sMRwDMYWZ3mUJ4Hvqd"&gt;Documentation/devicetree/&lt;WBR /&gt;bindings/iio/adc/fsl,vf610-&lt;WBR /&gt;adc.yaml&lt;/A&gt;&lt;/DIV&gt;
&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;
&lt;DIV&gt;Please mention&amp;nbsp;linux BSP version &amp;amp; share the device tree file.&lt;/DIV&gt;
&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;
&lt;DIV&gt;Please share the actual voltage present at ADC channel pin and RAW input data for it.&lt;/DIV&gt;
&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;
&lt;DIV&gt;Please try to measure the output of Vref regulator &amp;amp; make sure it is exactly&amp;nbsp;around 3.3v.&lt;/DIV&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;
&lt;DIV&gt;Thanks &amp;amp;&amp;nbsp;Regards,&lt;/DIV&gt;
&lt;P&gt;&lt;LI-WRAPPER&gt;&lt;/LI-WRAPPER&gt;Sanket Parekh&lt;/P&gt;</description>
      <pubDate>Mon, 25 Sep 2023 09:30:05 GMT</pubDate>
      <guid>https://community.nxp.com/t5/i-MX-Processors/How-to-read-ADC-values-in-IMX6ULL-sysfs-userspace/m-p/1728800#M213092</guid>
      <dc:creator>Sanket_Parekh</dc:creator>
      <dc:date>2023-09-25T09:30:05Z</dc:date>
    </item>
    <item>
      <title>Re: How to read ADC values in IMX6ULL sysfs userspace ?</title>
      <link>https://community.nxp.com/t5/i-MX-Processors/How-to-read-ADC-values-in-IMX6ULL-sysfs-userspace/m-p/1742174#M214279</link>
      <description>&lt;P&gt;&lt;a href="https://community.nxp.com/t5/user/viewprofilepage/user-id/202155"&gt;@Sanket_Parekh&lt;/a&gt;&amp;nbsp; Thanks for your reply,&lt;/P&gt;&lt;P&gt;Modified the device tree as instructed and resolved issue.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 18 Oct 2023 14:13:30 GMT</pubDate>
      <guid>https://community.nxp.com/t5/i-MX-Processors/How-to-read-ADC-values-in-IMX6ULL-sysfs-userspace/m-p/1742174#M214279</guid>
      <dc:creator>_ZZ_</dc:creator>
      <dc:date>2023-10-18T14:13:30Z</dc:date>
    </item>
  </channel>
</rss>

