<?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 Does not work</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/74690/twi-does-not-work</link><description>Hello, i am trying to develope a I2C application. I am using the twi_sensor example of the SDK 12.3.0 I have configured my pins to SDA 14 and SCL 30 and i just want to send some data with the nrf_drv_twi_tx funtion... but nothing happens. I am monitoring</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Tue, 04 May 2021 14:00:53 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/74690/twi-does-not-work" /><item><title>RE: TWI Does not work</title><link>https://devzone.nordicsemi.com/thread/308218?ContentTypeID=1</link><pubDate>Tue, 04 May 2021 14:00:53 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:9a738d21-d855-4ea7-bb6a-91fd79a5dd2a</guid><dc:creator>Nasib</dc:creator><description>&lt;p&gt;&lt;span&gt;Ok, now i can see that setting&amp;nbsp;&lt;/span&gt;&lt;span&gt;&amp;nbsp;&lt;/span&gt;&lt;span&gt;m_xfer_done to true the system sends a command each 0,8s more or less... What&amp;nbsp;&lt;/span&gt;&lt;span&gt;&amp;nbsp;&lt;/span&gt;&lt;span&gt;m_xfer_done does?&amp;nbsp;Does it is set to&amp;nbsp;true when the master receive an ACK? Why if i force this variable to true it sends periodically a command?&amp;nbsp;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span&gt;In my real application i want to use this twi with:&amp;nbsp;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span&gt;Soft device (Timer 0) for&amp;nbsp;&lt;/span&gt;&lt;span&gt;BLE_UART&lt;/span&gt;&lt;br /&gt;&lt;span&gt;Timer 1: interruption&lt;/span&gt;&lt;br /&gt;&lt;span&gt;Timer 2: pwm&amp;nbsp;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span&gt;If i copy the twi code to my real app... it does not generate any command even if i force&amp;nbsp;&lt;/span&gt;&lt;span&gt;m_xfer_done to true. Is there any conflict with the resources i&amp;nbsp;mention&amp;nbsp;before?&amp;nbsp;&lt;br /&gt;&lt;br /&gt;Thanks a lot!&lt;/span&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: TWI Does not work</title><link>https://devzone.nordicsemi.com/thread/308205?ContentTypeID=1</link><pubDate>Tue, 04 May 2021 13:40:30 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:11e47517-a37a-484b-b607-dd1372e15764</guid><dc:creator>Nasib</dc:creator><description>&lt;p&gt;Ok, now i can see that setting&amp;nbsp;&lt;span&gt; &lt;/span&gt;m_xfer_done to true the system sends a command each 0,8s more or less... What&amp;nbsp;&lt;span&gt; &lt;/span&gt;m_xfer_done does?&amp;nbsp;Does it is set to&amp;nbsp;true when the master receive an ACK? Why if i force this variable to true it sends periodically a command?&amp;nbsp;&lt;br /&gt;&lt;br /&gt;In my real application i want to use this twi with:&amp;nbsp;&lt;br /&gt;&lt;br /&gt;Soft device (Timer 0) for&amp;nbsp;BLE_UART&lt;br /&gt;Timer 1: interruption&lt;br /&gt;Timer 2: pwm&amp;nbsp;&lt;br /&gt;&lt;br /&gt;If i copy the twi code to my real app... it does not generate any command even if i force&amp;nbsp;&lt;span&gt;m_xfer_done to true. Is there any conflict with the resources i mention before?&amp;nbsp;&lt;br /&gt;&lt;br /&gt;Thanks a lot!&lt;/span&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: TWI Does not work</title><link>https://devzone.nordicsemi.com/thread/308182?ContentTypeID=1</link><pubDate>Tue, 04 May 2021 12:50:17 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:3681a25a-09ce-4588-8ee7-15f7d1abeb20</guid><dc:creator>H&amp;#229;kon Alseth</dc:creator><description>&lt;p&gt;Here&amp;#39;s my scope when triggering on SDA line:&lt;/p&gt;
&lt;p&gt;&lt;img src="https://devzone.nordicsemi.com/resized-image/__size/320x240/__key/communityserver-discussions-components-files/4/pastedimage1620132239966v1.png" alt=" " /&gt;&lt;/p&gt;
&lt;p&gt;I used internal pullup in the GPIO. Since you use 2.5kOhm, you sink ~1 mA, which might require you to setup the GPIOs in high-drive mode (See NRF_GPIO-&amp;gt;PIN_CNF[] register). You could try a bit of a weaker pull-resistor, but you should still see something on your oscilloscope just after reset.&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;for testing purposes: You could also set m_xfer_done=true in function main.c::twi_handler(), regardless of event received. This will then send every ~0.5 second.&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Kind regards,&lt;/p&gt;
&lt;p&gt;Håkon&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: TWI Does not work</title><link>https://devzone.nordicsemi.com/thread/308154?ContentTypeID=1</link><pubDate>Tue, 04 May 2021 11:42:20 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:6052f8a3-4a86-4f54-bd13-d4cb65e9cb1c</guid><dc:creator>Nasib</dc:creator><description>&lt;p&gt;I have reduced the problem to the minimum now:&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;I am using sdk12 3 twi_sensor example&lt;/li&gt;
&lt;li&gt;I am using pca10028 board&lt;/li&gt;
&lt;li&gt;I have installed a 2,5k pull up resistor from gpio07 to vcc&lt;/li&gt;
&lt;li&gt;I have installed a 2,5k pull up resistor form gpio30 to vcc&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;I have no sensor connected now. I load the example and i see absolutely nothing in the scope...&lt;/p&gt;
&lt;p&gt;I have reset the device but even with this i can not see anything...&amp;nbsp;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: TWI Does not work</title><link>https://devzone.nordicsemi.com/thread/308139?ContentTypeID=1</link><pubDate>Tue, 04 May 2021 11:07:07 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:367a6fb3-4b62-44f4-b084-4f8da846e663</guid><dc:creator>H&amp;#229;kon Alseth</dc:creator><description>&lt;p&gt;The program will send one transfer, wait for a successful event, then do another.&lt;/p&gt;
&lt;p&gt;If the transfer is not successful, it will send one transaction and then hang forever. This is the reason why I asked if you could reset the device and capture the trace and see if you get any output on SCL/SDA pins. Regardless, this points towards a issue with addressing the i2c sensor. Please doublecheck that the i2c address is correct, and please verify that the i2c master sends anything on boot-up.&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Kind regards,&lt;/p&gt;
&lt;p&gt;Håkon&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: TWI Does not work</title><link>https://devzone.nordicsemi.com/thread/308108?ContentTypeID=1</link><pubDate>Tue, 04 May 2021 09:14:01 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:9b3a5859-5664-44a3-a6c0-5f88db2c047a</guid><dc:creator>Nasib</dc:creator><description>&lt;p&gt;Thanks for your answer. What happens here is that even if I send the command in the main endless loop I am not able to see anything in the scope. Anything, no a single bit. And of course not a single ack.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Is there any pre configuration that I should do to use this example ?&amp;nbsp;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: TWI Does not work</title><link>https://devzone.nordicsemi.com/thread/308105?ContentTypeID=1</link><pubDate>Tue, 04 May 2021 09:03:00 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:5e0302fa-a202-431c-89ab-67deaac130e2</guid><dc:creator>H&amp;#229;kon Alseth</dc:creator><description>&lt;p&gt;But, does it ACK the command you send? If you scope the initial communication, you should be able to see if the ACK bit is set or not.&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;Kind regards,&lt;/p&gt;
&lt;p&gt;Håkon&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: TWI Does not work</title><link>https://devzone.nordicsemi.com/thread/307944?ContentTypeID=1</link><pubDate>Mon, 03 May 2021 13:02:57 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:278319b8-c23a-4716-93dd-eee452686a04</guid><dc:creator>Nasib</dc:creator><description>&lt;p&gt;Yes there is a sensor connected. But even with the sensor or with out i dont see any comand sent with my oscilloscope&amp;nbsp;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: TWI Does not work</title><link>https://devzone.nordicsemi.com/thread/307908?ContentTypeID=1</link><pubDate>Mon, 03 May 2021 12:03:47 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:cafa419a-72a9-4faf-8769-2197f8c59324</guid><dc:creator>H&amp;#229;kon Alseth</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;If nothing is connected, then it only sends one command and waits for an ACK in the twi_handler.&lt;/p&gt;
&lt;p&gt;Try power cycling your nrf and see if it initially sends one transaction.&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Kind regards,&lt;/p&gt;
&lt;p&gt;Håkon&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>