<?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>TWI clock pull up</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/16116/twi-clock-pull-up</link><description>The data sheet recommends that both the TWI clock and data lines use pull ups and the GPIOs should be set to S0D1, essentially open collector drive. I can see the need for this on the data line, but if my I2C device does not do any clock stretching, is</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Wed, 30 Aug 2017 15:40:48 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/16116/twi-clock-pull-up" /><item><title>RE: TWI clock pull up</title><link>https://devzone.nordicsemi.com/thread/61451?ContentTypeID=1</link><pubDate>Wed, 30 Aug 2017 15:40:48 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:618543ec-c9a9-4e68-bf75-24227f06998c</guid><dc:creator>Paolo A.</dc:creator><description>&lt;p&gt;Hi everyone,
about this question I have some perplexity too.&lt;/p&gt;
&lt;p&gt;If I set the pin as S0D1(like Ole suggest) the clock signal has a slow slope (as if it were filtered). If I set the pin as S0S1 the clock signal has a steep slope (like a step signal).
I use the TWI0 with 10KOhm pull-up resistor, without internal pull-up, and pin drive as S0S1.
So, the answer&amp;#39;s Ole and datasheet say the truth, but for me the behaviour is better if I set the pin like S0S1 instead of S0D1 (like Aras said).&lt;/p&gt;
&lt;p&gt;What is the right way to take?
Thanks.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: TWI clock pull up</title><link>https://devzone.nordicsemi.com/thread/61450?ContentTypeID=1</link><pubDate>Tue, 15 Nov 2016 12:17:48 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:e3f55021-04b0-4c5f-8dd8-21b976bc5ab5</guid><dc:creator>Ole Bauck</dc:creator><description>&lt;p&gt;Sorry for the late answer, the slave should pull both lines.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: TWI clock pull up</title><link>https://devzone.nordicsemi.com/thread/61449?ContentTypeID=1</link><pubDate>Sat, 05 Nov 2016 11:39:29 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:1bda171c-1c8d-4606-b9ea-54c3078c94af</guid><dc:creator>aras</dc:creator><description>&lt;p&gt;The slave pulls the DATA, not clock. Is this correct?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: TWI clock pull up</title><link>https://devzone.nordicsemi.com/thread/61448?ContentTypeID=1</link><pubDate>Mon, 12 Sep 2016 14:55:06 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:f765fb2b-308e-4809-a1e5-502eba880713</guid><dc:creator>Ole Bauck</dc:creator><description>&lt;p&gt;Now I understand. You cannot set the drive to S0S1. If you do you will have a short when the slave pulls the clock down to ACK the master. I will update my original answer with more info.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: TWI clock pull up</title><link>https://devzone.nordicsemi.com/thread/61447?ContentTypeID=1</link><pubDate>Thu, 08 Sep 2016 14:05:10 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:12fd84f0-cc1f-4a21-a2d2-b3c006df4cc7</guid><dc:creator>aras</dc:creator><description>&lt;p&gt;I verified with the slave device removed. No pull-up. No other connection. Exactly the same result.
Chip is N51822, CFACA0, 1506AK&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: TWI clock pull up</title><link>https://devzone.nordicsemi.com/thread/61446?ContentTypeID=1</link><pubDate>Tue, 06 Sep 2016 13:58:53 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:aee288a7-1bee-44f1-b5c1-378671dbecc1</guid><dc:creator>Ole Bauck</dc:creator><description>&lt;p&gt;You are sure the slave does not have internal pull-ups? Try measuring without the slave attached.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: TWI clock pull up</title><link>https://devzone.nordicsemi.com/thread/61445?ContentTypeID=1</link><pubDate>Fri, 02 Sep 2016 16:10:35 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:7d9c109f-c23e-4c81-89c0-69ccaf33a343</guid><dc:creator>aras</dc:creator><description>&lt;p&gt;I&amp;#39;m not so sure about that.&lt;/p&gt;
&lt;p&gt;I set up my clock pin as follows:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;  NRF_GPIO-&amp;gt;PIN_CNF[twiInstance[twiHandle].clockPinNumber] =     \
    (GPIO_PIN_CNF_SENSE_Disabled &amp;lt;&amp;lt; GPIO_PIN_CNF_SENSE_Pos) \
  | (GPIO_PIN_CNF_DRIVE_S0S1     &amp;lt;&amp;lt; GPIO_PIN_CNF_DRIVE_Pos) \
  | (NRF_GPIO_PIN_NOPULL    	 &amp;lt;&amp;lt; GPIO_PIN_CNF_PULL_Pos)  \
  | (GPIO_PIN_CNF_INPUT_Disconnect  &amp;lt;&amp;lt; GPIO_PIN_CNF_INPUT_Pos) \
  | (GPIO_PIN_CNF_DIR_Output      &amp;lt;&amp;lt; GPIO_PIN_CNF_DIR_Pos);
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;There is no external pullup.
Attached is the scope trace of the clock pin.&lt;/p&gt;
&lt;p&gt;&lt;a href="https://devzone.nordicsemi.com/cfs-file/__key/communityserver-discussions-components-files/4/IMG_5F00_20160902_5F00_102434.jpg"&gt;IMG_20160902_102434.jpg&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;Of course, this only works if there is only one master and the slave device does not do any clock stretching.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: TWI clock pull up</title><link>https://devzone.nordicsemi.com/thread/61444?ContentTypeID=1</link><pubDate>Thu, 01 Sep 2016 13:01:35 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:8b226feb-8839-445a-86ae-663c103edcf8</guid><dc:creator>Ole Bauck</dc:creator><description>&lt;p&gt;You need to have some pull-up resistors on the lines. The lines on TWI (or i2c) are &amp;quot;open drain&amp;quot;, meaning that they can only be driven low. If you omit the pull-up resistors, the line will float when it is not driven low.&lt;/p&gt;
&lt;p&gt;Since the lines can only be driven low you should use S0D1.&lt;/p&gt;
&lt;p&gt;The internal pull-up on nRF51 is about 13KOhm. This is a bit too high for TWI and will give problems when running at 400KHz (the clock will be skewed due to the RC circuit the lines create). Recommended pull-up is about 4.7KOhm.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;EDIT 2016.09.12:&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;You should not use S0S1&lt;/strong&gt;. Then you will have a short when the slave pulls the line low for ACK. The configuration should be as defined in the Reference Manual:&lt;/p&gt;
&lt;p&gt;&lt;img src="https://devzone.nordicsemi.com/cfs-file/__key/communityserver-discussions-components-files/4/twi_5F00_gpio.JPG" alt="image description" /&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>