<?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 Line Causing Bad Writes</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/4425/twi-clock-line-causing-bad-writes</link><description>I&amp;#39;m using the nrf51822 TWI library. I&amp;#39;ve tried both twi hardware and software master library files and see the same behavior when using both (as a side note an explanation of the difference would be helpful.) I have 3 I2C chips wired to the NRF51822 all</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Wed, 12 Nov 2014 17:19:09 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/4425/twi-clock-line-causing-bad-writes" /><item><title>RE: TWI Clock Line Causing Bad Writes</title><link>https://devzone.nordicsemi.com/thread/15709?ContentTypeID=1</link><pubDate>Wed, 12 Nov 2014 17:19:09 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:cebdf24b-bd76-47e4-a578-b8460bda2c5f</guid><dc:creator>Seth</dc:creator><description>&lt;p&gt;Thanks RK, you are completely right that the issue was with the Saleae analyzer. I found on their forums that others had had a similar issue, and that is was just noise resulting from too high of a sample rate. The expected ACK&amp;#39;s are what tipped me off in then (although it did create quite a headache for a while there.)&lt;/p&gt;
&lt;p&gt;Thanks!
Seth&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: TWI Clock Line Causing Bad Writes</title><link>https://devzone.nordicsemi.com/thread/15708?ContentTypeID=1</link><pubDate>Wed, 12 Nov 2014 00:40:41 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:6d31cec5-b07c-408d-8f64-f904b573dd60</guid><dc:creator>RK</dc:creator><description>&lt;p&gt;I can&amp;#39;t answer the question but I can make a couple of observations. I also by the way had problems when I added a TWI device in parallel with the NRF6530 (dot matrix + joystick) to find that what worked on two separate TWIs failed when I tried to use one .. I didn&amp;#39;t however stick the analyser on it at the time.&lt;/p&gt;
&lt;p&gt;I agree that low pulse is strange. Measuring using pixels it seems to me the overall length of the SCL high is correct for a start pulse but something is momentarily pulling it down around the point SDA goes low.&lt;/p&gt;
&lt;p&gt;If you ignore what the Saleae is decoding after that point however, assuming that that pulse has confused the decoder library (note it&amp;#39;s missing a start blob for one), the rest of the trace actually seems correct. Count the next 8 SCL pulses looking at SDA and that&amp;#39;s 00110000, then there&amp;#39;s a very slight gap but SDA stays low and an ACK is clocked in. Following similarly along the next one is 00110000 + ACK and then 10010101 + ACK which is what you&amp;#39;re trying to send. Finally data goes high, then low and high again with SCL high for a stop, also correct.&lt;/p&gt;
&lt;p&gt;In each case the 8 clock pulses for data are equally-spaced which seems to indicate the nrf51822 is doing the right thing, the clock pulse for ACK is slightly delayed, that&amp;#39;s ok, and something, I assume a device, is holding SDA low for an ACK, so it looks to me like the device you&amp;#39;re talking to is not confused by that blip (if it even sees it) and continues to respond correctly.&lt;/p&gt;
&lt;p&gt;If the devices really were seeing 0x18 as the address, unless you happened to have such a device, then none of them would respond, SDA would float high at the end of the first sequence and you&amp;#39;d get a NAK and an error in the TWI library (I assume, I don&amp;#39;t use the TWI library, I wrote my own).&lt;/p&gt;
&lt;p&gt;So are you getting errors in the library from NAK&amp;#39;s, what are your devices actually doing, are they malfunctioning, or are you just looking at the decoded traces from the Saleae and not seeing what you expect there? I agree that pulse is bizarre and shouldn&amp;#39;t be there, and that is certainly putting the Saleae decoder out of sync with the data for that transaction, but eyeballing the rest of the trace especially where the ACKs really are, it looks like the devices are responding properly.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>