<?xml version="1.0" encoding="UTF-8" ?>
<?xml-stylesheet type="text/xsl" href="https://devzone.nordicsemi.com/cfs-file/__key/system/syndication/rss.xsl" media="screen"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:wfw="http://wellformedweb.org/CommentAPI/" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>the behavior of nrf52832 saadc when reading floating pin</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/77095/the-behavior-of-nrf52832-saadc-when-reading-floating-pin</link><description>Hello, 
 
 I am having trying to achieve hardware versioning via saadc. 
 
 Module model: nrf52832 
 Sdk: 15.2 
 
 There are two versions of the hardware: 
 version 1, there is no hardware versioning implemented with AIN7, the pin is floating. 
 version</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Tue, 06 Jul 2021 12:56:27 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/77095/the-behavior-of-nrf52832-saadc-when-reading-floating-pin" /><item><title>RE: the behavior of nrf52832 saadc when reading floating pin</title><link>https://devzone.nordicsemi.com/thread/318800?ContentTypeID=1</link><pubDate>Tue, 06 Jul 2021 12:56:27 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:827bca0b-6d25-45a3-9d5c-9cf8efae64f6</guid><dc:creator>Karl Ylvisaker</dc:creator><description>[quote user="EdwardC"]I have tested with pulldown enable and the pin reads ~0V now, so this works :)&amp;nbsp;[/quote]
&lt;p&gt;I am happy to hear that this achieves the functionality you were looking for! :)&lt;/p&gt;
[quote user="EdwardC"]With the above in mind, it looks like the Rladder resistance from saadc has less impact in this specific impact and easier to work with, since the Rladder resistance is typical at 160kohm:[/quote][quote user="EdwardC"]Now just need to make sure the when the pulldown is enabled, the extra 160kohm in parallel needs to be taken into account[/quote][quote user="EdwardC"]I think I will use the Rladder from saadc.[/quote]
&lt;p&gt;Yes, using the Rladder of the SAADC is of course easier in this case - I should have suggested it myself in the first place directly! :)&lt;/p&gt;
[quote user="EdwardC"]Thank you Karl[/quote][quote user="EdwardC"]Much appreciated, thanks![/quote]
&lt;p&gt;No problem at all, I am happy to help!&lt;br /&gt;&lt;br /&gt;Please do not hesitate to open another ticket if you should encounter any issues or questions in the future.&lt;br /&gt;&lt;br /&gt;Good luck with your development!&lt;br /&gt;&lt;br /&gt;Best regards,&lt;br /&gt;Karl&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: the behavior of nrf52832 saadc when reading floating pin</title><link>https://devzone.nordicsemi.com/thread/318704?ContentTypeID=1</link><pubDate>Mon, 05 Jul 2021 20:49:24 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:f74dfa8c-cee5-4524-b97d-feb345630f66</guid><dc:creator>EdwardC</dc:creator><description>&lt;p&gt;Thank you Karl,&lt;/p&gt;
&lt;p&gt;I have tested with pulldown enable and the pin reads ~0V now, so this works :)&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;I have read the specification regarding the internal GPIO pull-down&amp;nbsp;resistor, the typical resistance is 13kohm with a minimum of 11kohm and a maximum of 16kohm:&lt;/p&gt;
&lt;p&gt;&lt;img src="https://devzone.nordicsemi.com/resized-image/__size/320x240/__key/communityserver-discussions-components-files/4/pastedimage1625518004460v1.png" alt=" " /&gt;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;With the above in mind, it looks like the Rladder resistance from saadc has less impact in this specific impact and easier to work with, since the Rladder resistance is typical at 160kohm:&lt;/p&gt;
&lt;p&gt;&lt;img src="https://devzone.nordicsemi.com/resized-image/__size/320x240/__key/communityserver-discussions-components-files/4/pastedimage1625518117578v2.png" alt=" " /&gt;&lt;/p&gt;
&lt;p&gt;I think I will use the Rladder from saadc.&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;Now just need to make sure the when the pulldown is enabled, the extra 160kohm in parallel needs to be taken into account&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;Much appreciated, thanks!&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: the behavior of nrf52832 saadc when reading floating pin</title><link>https://devzone.nordicsemi.com/thread/318697?ContentTypeID=1</link><pubDate>Mon, 05 Jul 2021 19:38:31 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:a646e154-4c66-4fa1-8012-66424f179d93</guid><dc:creator>Karl Ylvisaker</dc:creator><description>&lt;p&gt;Hello,&amp;nbsp;&lt;/p&gt;
[quote user=""]version 1, there is no hardware versioning implemented with AIN7, the pin is floating.[/quote][quote user=""]version 2, there is hardware versioning implemented with AIN7, the pin is connected to a voltage divider which should read in the range from 0 to VDD for hardware different versions.[/quote]
&lt;p&gt;If the pin is floating there really is no way to guarantee or predict what value it will read. I suggest adding or enabling a pullup or pulldown on the pin, to bring it to a known state.&lt;/p&gt;
&lt;p&gt;If I understand your situation correctly then a pullup or pulldown should make you able to differentiate between the two hardware versions since the one that is connected to a voltage divider will still read the value of the voltage divider, while the version 1 will read a steady zero.&lt;/p&gt;
[quote user=""]Is there a way to get the floating pin read something consistent which make it possible to use AIN7 for hardware versioning purpose?[/quote]
&lt;p&gt;By using a pullup or pulldown resistor you will get consistent measurements on your pin measurements.&lt;br /&gt;You can enable the pullup or down &lt;a href="https://infocenter.nordicsemi.com/index.jsp?topic=%2Fcom.nordic.infocenter.nrf52832.ps.v1.1%2Fgpio.html&amp;amp;anchor=register.PIN_CNF-0"&gt;in the particular PINs CFG register directly&lt;/a&gt;&amp;nbsp;to avoid overwriting any other settings made by the SAADC initialization.&lt;br /&gt;&lt;br /&gt;Best regards,&lt;br /&gt;Karl&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>