<?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>Why nRF52832 output wrong TWI wave?</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/41726/why-nrf52832-output-wrong-twi-wave</link><description>Hi, 
 I was trying to communicate with an I2C device, which&amp;#39;s address is 0x7C 
 But I always got NRF_DRV_TWI_EVT_ADDRESS_NACK event, so I took a check on the TWI wave: 
 
 Looks like the signal on SDA is correct but the SCK signal is 1 cycle later than</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Wed, 19 Dec 2018 15:09:06 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/41726/why-nrf52832-output-wrong-twi-wave" /><item><title>RE: Why nRF52832 output wrong TWI wave?</title><link>https://devzone.nordicsemi.com/thread/162537?ContentTypeID=1</link><pubDate>Wed, 19 Dec 2018 15:09:06 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:7ca1be57-ce77-41c9-af98-d4b1d066b527</guid><dc:creator>zzzh</dc:creator><description>&lt;p&gt;Got it, this is probably the case.&lt;/p&gt;
&lt;p&gt;Though, I don&amp;#39;t think it&amp;#39;s a mistake, it&amp;#39;s just a different way of understanding, look&amp;nbsp;what slave datasheet shows.&lt;/p&gt;
&lt;p&gt;&lt;img alt=" " src="https://devzone.nordicsemi.com/resized-image/__size/640x480/__key/communityserver-discussions-components-files/4/I2C_5F00_issue.png" /&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Why nRF52832 output wrong TWI wave?</title><link>https://devzone.nordicsemi.com/thread/162536?ContentTypeID=1</link><pubDate>Wed, 19 Dec 2018 15:01:05 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:1b1e1522-a590-4142-940d-bdc7656b5861</guid><dc:creator>zzzh</dc:creator><description>&lt;p&gt;Good guess, but it&amp;#39;s 0x7C with the last bit being 0 (write)&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Why nRF52832 output wrong TWI wave?</title><link>https://devzone.nordicsemi.com/thread/162535?ContentTypeID=1</link><pubDate>Wed, 19 Dec 2018 15:00:05 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:351526b4-e923-4e1f-8e72-70c4d466c8f4</guid><dc:creator>Einar Thorsrud</dc:creator><description>&lt;p&gt;I see. Then this is probably just a confusion about the read/write bit. The lowest bit is the read write bit (1 = read), so when you want to write to your device (address 0x7C) you will see 0xF8. When you want to read from it you will see 0xF9. That is according to I2C spec.&lt;/p&gt;
&lt;p&gt;A typical mistake is to think that the address includes the r/w bit. If that is the case here, you should instead use the address 0x31 (which is 0x7C &amp;gt;&amp;gt; 1).&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Why nRF52832 output wrong TWI wave?</title><link>https://devzone.nordicsemi.com/thread/162534?ContentTypeID=1</link><pubDate>Wed, 19 Dec 2018 14:52:29 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:65ee5db8-4c23-4d16-a479-33d25e75bf04</guid><dc:creator>zzzh</dc:creator><description>&lt;p&gt;Sorry, it&amp;#39;s not 0x80, but 0xf8, I said it wrongly&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Why nRF52832 output wrong TWI wave?</title><link>https://devzone.nordicsemi.com/thread/162532?ContentTypeID=1</link><pubDate>Wed, 19 Dec 2018 14:48:46 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:fb8b49c2-0a04-4e86-b499-40881f65ed2f</guid><dc:creator>Einar Thorsrud</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;I am not able to see that. Looking at the plot (where I assume SDA is the top line and SCL the lower line) all seems to match with the I2C protocol as far as I can see. There are clearly several &amp;#39;1&amp;#39;s in the beginning (rising SCL with SDA high), so I don&amp;#39;t see how you can interpret it as 0x80 (&amp;quot;10000000&amp;quot;).&lt;/p&gt;
&lt;p&gt;Could it be that this is just a classical I2C confusion about whether the read/write bit should be included in the address or not?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Why nRF52832 output wrong TWI wave?</title><link>https://devzone.nordicsemi.com/thread/162529?ContentTypeID=1</link><pubDate>Wed, 19 Dec 2018 14:43:20 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:aef3609d-1e31-41b7-8ede-dd92867730f1</guid><dc:creator>zzzh</dc:creator><description>&lt;p&gt;To avoid using TWIM, I changed&amp;nbsp;TWI0_ENABLED to 1 in &lt;span&gt;nrf5_SDK_for_Mesh_v2.2.0_src\examples\light_switch\server\include\&lt;/span&gt;sdk_config.h&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Yeah, it looks like 0x7C on SDA, but if you read it per SCL wave as I2C protocol says, it&amp;#39;s 0xf8, that&amp;#39;s why it can&amp;#39;t get ACK.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Why nRF52832 output wrong TWI wave?</title><link>https://devzone.nordicsemi.com/thread/162527?ContentTypeID=1</link><pubDate>Wed, 19 Dec 2018 14:32:16 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:5d2fe18c-a9f7-46e4-8b1b-a67ea88f4d31</guid><dc:creator>Einar Thorsrud</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;I looked closer at the logic trace and it does not match the description. I do not see any problem with it, except for the fact that the slave nacks the transaction. After the start bit the bit pattern is &lt;span&gt;11111000 (0x7C&amp;lt;&amp;lt;1 = 0xF8) followed by a 1 (nack). So it seems you write what you intend to, but for some reason the slave nacks it. Where do you&amp;nbsp;get the number 0x80 from?&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;(Regarding&amp;nbsp;erratum 109 you should&amp;nbsp;not worry about it if you are using SDK version &amp;gt;= 13.0.0 as the workaround is implemented in the driver).&lt;/span&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Why nRF52832 output wrong TWI wave?</title><link>https://devzone.nordicsemi.com/thread/162525?ContentTypeID=1</link><pubDate>Wed, 19 Dec 2018 14:13:26 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:142bc39a-bffd-4aa7-aa17-8f4c4ec7c026</guid><dc:creator>zzzh</dc:creator><description>&lt;p&gt;Hi, Einar,&lt;/p&gt;
&lt;p&gt;I used the same code as in&amp;nbsp;nRF5_SDK_15.0.0_a53641a\examples\peripheral\twi_sensor, the difference is I used it in&amp;nbsp;BLE\nrf5_SDK_for_Mesh_v2.2.0_src\examples\light_switch\server after some changes.&lt;/p&gt;
&lt;p&gt;To avoid DMA issue of 109&amp;nbsp;in errata, I did not try TWIM.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Why nRF52832 output wrong TWI wave?</title><link>https://devzone.nordicsemi.com/thread/162486?ContentTypeID=1</link><pubDate>Wed, 19 Dec 2018 11:50:21 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:4c290da3-b100-44b9-b165-16b75b28c1c2</guid><dc:creator>Einar Thorsrud</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;Can you show us the code you are using when you see this? Also, do you get the same behavior when using TWIM? Assuming you use the driver you only need to set&amp;nbsp;TWI0_USE_EASY_DMA to 1 in your project sdk_config.h to use it.&lt;/p&gt;
&lt;p&gt;Regarding the DMA erratum, i assume you are referring to 109? This does not have any practical consequences if you are using the TWI driver from a recent SDK as it incorporates a workaround.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>