<?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>Reconfigure TWIM so pins can be driven pnis low when not in use</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/124887/reconfigure-twim-so-pins-can-be-driven-pnis-low-when-not-in-use</link><description>I have a battery application where I power off areas of the circuit. One of which has my I2C/TWIM peripherals. However, the TWIM controller configured on the nRF52832 is pulling the lines high. I want to be able to keep the bluetooth runing, but power</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Fri, 10 Oct 2025 14:01:36 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/124887/reconfigure-twim-so-pins-can-be-driven-pnis-low-when-not-in-use" /><item><title>RE: Reconfigure TWIM so pins can be driven pnis low when not in use</title><link>https://devzone.nordicsemi.com/thread/551148?ContentTypeID=1</link><pubDate>Fri, 10 Oct 2025 14:01:36 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:4afb007b-2c52-4e18-a9ac-07dba54d5652</guid><dc:creator>Edvin</dc:creator><description>&lt;p&gt;Hello,&lt;/p&gt;
[quote user=""]so I can diable the TWIM &amp;amp; drive the pins low, then when required enable the TWIM[/quote]
&lt;p&gt;Do you want to drive these low externally, or from the nRF?&amp;nbsp;&lt;/p&gt;
&lt;p&gt;I assume you don&amp;#39;t want to backpower something connected to the I2C pins when you don&amp;#39;t actively use the I2C?&lt;/p&gt;
&lt;p&gt;If that is the case, you are halfway there. You have defined your sleep state for the I2C pins. You just need to put it in sleep mode, which will disable the pullup, and put them in disconnected input mode.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;To do this, you can use the device manager:&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="c_cpp"&gt;// Put the I2C to sleep:
int rc = pm_device_action_run(i2c_dev, PM_DEVICE_ACTION_SUSPEND);
if (rc &amp;lt; 0) {
    printf(&amp;quot;Could not suspend I2C (%d)\n&amp;quot;, rc);
}

// Enable the I2C again:
int rc = pm_device_action_run(i2c_dev, PM_DEVICE_ACTION_RESUME);
if (rc &amp;lt; 0) {
    printf(&amp;quot;Could not resume I2C (%d)\n&amp;quot;, rc);
}&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;Remember to enable the&amp;nbsp;power management in your prj.conf:&lt;/p&gt;
&lt;p&gt;CONFIG_PM_DEVICE=y&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;Best regards,&lt;/p&gt;
&lt;p&gt;Edvin&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>