<?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>How to configure TWI/I2C for high Write Bit</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/14042/how-to-configure-twi-i2c-for-high-write-bit</link><description>Hello, 
 I am checking to see if it is possible to use app_twi_perform() to transmit TWI transactions that have a High Write bit. I have changed the polarity of APP_TWI_WRITE_OP, APP_TWI_READ_OP and APP_TWI_IS_READ_OP. I still see, on a scope, that the</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Thu, 26 May 2016 18:09:23 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/14042/how-to-configure-twi-i2c-for-high-write-bit" /><item><title>RE: How to configure TWI/I2C for high Write Bit</title><link>https://devzone.nordicsemi.com/thread/53694?ContentTypeID=1</link><pubDate>Thu, 26 May 2016 18:09:23 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:5a36ad72-5b64-4997-b269-068660410f1f</guid><dc:creator>John</dc:creator><description>&lt;p&gt;That has got to be a typo in the table. I&amp;#39;m using the same sensor family and it works with the R/W bit set per the standard.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: How to configure TWI/I2C for high Write Bit</title><link>https://devzone.nordicsemi.com/thread/53696?ContentTypeID=1</link><pubDate>Thu, 26 May 2016 15:41:35 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:60153dff-6ae7-4cf1-883d-79294d38d2cb</guid><dc:creator>Prasad</dc:creator><description>&lt;p&gt;I am using the SI7054 (Silicon Labs temperature sensor). The datasheet specifies (in Table 10) that the WRITE bit is 1. It could be errata because the DS also specifies &amp;quot;the R/W bit is set high for a read command and low for a write command&amp;quot; in Section 5.
As I was having a difficulty communicating with this sensor over TWI in an event handler, I wanted to check if I had the R/W bit mixed up.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: How to configure TWI/I2C for high Write Bit</title><link>https://devzone.nordicsemi.com/thread/53695?ContentTypeID=1</link><pubDate>Thu, 26 May 2016 08:58:17 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:8f7cf86f-edd7-407b-9234-b4969c284110</guid><dc:creator>MartinBL</dc:creator><description>&lt;p&gt;Hi.&lt;/p&gt;
&lt;p&gt;I&amp;#39;m looking into this and trying to find a definitive answer and explanation.
I tried your method of swapping the LSB in APP_TWI_WRITE_OP and APP_TWI_READ_OP and I think I see the same behaviour as you. However, I suspect that we are only fooling the drivers and not the hardware. As you have seen APP_TWI_WRITE_OP and APP_TWI_READ_OP simply left shifts the seven bit long TWI slave address and appends a READ or WRITE bit. However, the resulting byte is not the exact byte that is clocked out on the TWI bus. Later in the transfer process the TWI library separates the address and R/W bit again. It then checks the LSB and starts either a TX or an RX. The address bits go into the &lt;a href="http://infocenter.nordicsemi.com/topic/com.nordic.infocenter.nrf52832.ps.v1.0/twim.html?cp=2_2_0_31_7_17#register.ADDRESS"&gt;TWI-&amp;gt;ADDRESS&lt;/a&gt; register (note that it is 7-bit long) and the TWI driver fires either the &lt;a href="http://infocenter.nordicsemi.com/topic/com.nordic.infocenter.nrf52832.ps.v1.0/twim.html?cp=2_2_0_31_7#unique_1422789888"&gt;STARTTX OR STARTRX&lt;/a&gt; task. Simply put, by swapping R/W bits in APP_TWI_WRITE_OP  and APP_TWI_READ_OP you start a read when trying to start a write and vice versa. Furthermore, by initiating a read transfer you cannot expect the nRF52 TWI hardware to continue to write bytes to the bus. I have asked the designers though, to see if it is at all possible to manipulate the hardware to do what you want, but I am still waiting for an answer.&lt;/p&gt;
&lt;p&gt;May I ask what device you are using that requires swapping read and write bit like this? Sounds like a very odd way to do things.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>