<?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>Change I2C peripheral drive strength</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/80960/change-i2c-peripheral-drive-strength</link><description>Hi, 
 I noticed that the nRF9160s I2C low level logic voltage is quite high. With a 2kR resistor at 3.3V it&amp;#39;s already more than 200mV. Because this is quite high and will get even more when the resistor gets smaller, I wanted to increase the GPIO drive</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Mon, 01 Nov 2021 09:25:10 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/80960/change-i2c-peripheral-drive-strength" /><item><title>RE: Change I2C peripheral drive strength</title><link>https://devzone.nordicsemi.com/thread/336802?ContentTypeID=1</link><pubDate>Mon, 01 Nov 2021 09:25:10 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:5d4a935b-5b0a-42a8-a41d-6d5a97d6cec7</guid><dc:creator>ruimtepuin</dc:creator><description>&lt;p&gt;Hi Karl,&lt;/p&gt;
&lt;p&gt;Thank for the tip! There are a lot of devices on the bus with relatively long lines, which is why the 2k resistor is required.&lt;/p&gt;
&lt;p&gt;In nrfx_twim.c I changed the &lt;code&gt;TWIM_PIN_INIT&lt;/code&gt; macro to use the H0D1 drive flag instead of S0D1.&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="c_cpp"&gt;#define TWIM_PIN_INIT(_pin) nrf_gpio_cfg((_pin),                     \
                                         NRF_GPIO_PIN_DIR_INPUT,     \
                                         NRF_GPIO_PIN_INPUT_CONNECT, \
                                         NRF_GPIO_PIN_PULLUP,        \
                                         NRF_GPIO_PIN_H0D1,          \
                                         NRF_GPIO_PIN_NOSENSE)&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;Unfortunately it requires a change in the SDK, but hopefully there will be some way of changing this in the dtc in the future.&lt;/p&gt;
&lt;p&gt;Best regards,&lt;br /&gt;Martin&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Change I2C peripheral drive strength</title><link>https://devzone.nordicsemi.com/thread/335498?ContentTypeID=1</link><pubDate>Fri, 22 Oct 2021 13:01:02 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:69b91204-e3dd-4b3d-9f96-d8e114cac899</guid><dc:creator>Karl Ylvisaker</dc:creator><description>&lt;p&gt;Hello Martin,&lt;/p&gt;
[quote user=""]With a 2kR resistor at 3.3V it&amp;#39;s already more than 200mV.[/quote]
&lt;p&gt;Is there a particular reason for choosing 2 k Ohm for your pullup resistor?&lt;br /&gt;I would recommend that you use the standard size of 4.7k Ohm for your pullup resistor, instead of the 2 k Ohm.&lt;/p&gt;
[quote user=""]With this config it seems to work, but I don&amp;#39;t like the approach of having to guess the default flags and having to change this in the main code (I would prefer to have this changed at boot time). Is there any way of specifying this in the devicetree or some way of appending flags so I keep the default?[/quote]
&lt;p&gt;There is no way to change this in the device tree, since this only concern which physical pins and peripheral that will be in use by the application.&lt;br /&gt;You might be able to incorporate this change in the twi init function that is run by Zephyr when you have enabled the TWI peripheral through the prj.conf file.&lt;br /&gt;In the TWIM case, this would be the &lt;em&gt;twim_init&lt;/em&gt; function located in&amp;nbsp; .. ncs\zephyr\drivers\i2c\i2c_nrfx_twim.c, for example.&lt;br /&gt;For the general case please keep in mind that modifying the function&amp;#39;s Zephyr rely on behind the scenes might break the different driver&amp;#39;s functionality.&lt;br /&gt;&lt;br /&gt;Alternatively, you will have to initialize the TWI in your main.c file (or other project file), where you pretty much do the initialization yourself instead of having Zephyr do it behind the scenes through the prj.conf. In this case, you could just add your line at the end of this 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>