<?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/TWIM bus probing / bus scanning</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/127812/twi-twim-bus-probing-bus-scanning</link><description>Dear DevZone Team 
 To detect possible TWI slave devices connected on a TWI bus, we want to scan for device addresses and check if they are being acknowledged. 
 In the twi_scanner example found within the nRF5 SDK, the scanning is solved by reading one</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Mon, 20 Apr 2026 13:52:37 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/127812/twi-twim-bus-probing-bus-scanning" /><item><title>RE: TWI/TWIM bus probing / bus scanning</title><link>https://devzone.nordicsemi.com/thread/565181?ContentTypeID=1</link><pubDate>Mon, 20 Apr 2026 13:52:37 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:772ce422-2e18-453b-bd06-04b128642b9b</guid><dc:creator>Einar Thorsrud</dc:creator><description>&lt;p&gt;Hi&amp;nbsp;Pascal,&lt;/p&gt;
&lt;p&gt;The problem as I see it is that configuring TWIM-&amp;gt;TXD.MAXCNT = 0 and starting transmission with TASKS_STARTTX is not a compliant method for TWI bus scanning. The fact that no LASTTX or STOPPED event is generated when the address is ACKed indicates that the peripheral is not completing a normal, valid transfer sequence. Because of this, using the absence of EVENTS_ERROR after a timeout as confirmation of ACK is not a robust solution. (And again, it is also a&amp;nbsp;potential problem on the slave side.)&lt;/p&gt;
&lt;p&gt;That is why I would recommend using&amp;nbsp;a normal TWI/TWIM transfer for probing, as done in the twi_scanner example, and evaluating whether the addressed slave ACKs the transaction.&lt;/p&gt;
&lt;p&gt;Br,&lt;/p&gt;
&lt;p&gt;Einar&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: TWI/TWIM bus probing / bus scanning</title><link>https://devzone.nordicsemi.com/thread/565138?ContentTypeID=1</link><pubDate>Mon, 20 Apr 2026 06:29:26 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:b00a6594-6896-4022-a774-02ce2fa36390</guid><dc:creator>Pascal K&amp;#252;nzi</dc:creator><description>&lt;p&gt;Hi Einar&lt;/p&gt;
&lt;p&gt;Thank you for your assessment!&lt;/p&gt;
&lt;p&gt;We were asked for a generic TWI bus probing functionality that does not transmit or read additional data. Hence, I cannot give you a specific use case but would assume, that the possible target devices withstand the probing.&lt;/p&gt;
&lt;p&gt;Nonetheless, I agree that there are TWI slave devices that may end up in a bad state. As a result, it will be necessary to verify that the probing is actually &amp;quot;supported&amp;quot; on the target devices before using it in production.&lt;/p&gt;
&lt;p&gt;If you are unsure about the nRF&amp;#39;s behavior in this situation, I rather not use my suggested approach.&amp;nbsp;&lt;br /&gt;I would appreciate it if you could clarify or elaborate on the potential side effects on the nRF side. If there is a chance that this may cause a problem, this idea will be rejected.&lt;/p&gt;
&lt;p&gt;Best regards,&lt;br /&gt;Pascal&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: TWI/TWIM bus probing / bus scanning</title><link>https://devzone.nordicsemi.com/thread/565112?ContentTypeID=1</link><pubDate>Fri, 17 Apr 2026 12:54:32 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:6110f906-6d0a-4ea5-b355-b383cb463854</guid><dc:creator>Einar Thorsrud</dc:creator><description>&lt;p&gt;Hi&amp;nbsp;Pascal,&lt;/p&gt;
&lt;p&gt;Zero length read/writes are problematic. Doing like you write with a timeout before stopping may work, but I am not sure of potential side effecs. Generally, TWI/I2C bus scanning is performed for development purposes and you should expect that devices on the bus may be in a bad state afterwards. May I ask for the use case? What is the end goal? Could it be that it could be done in another way?&lt;/p&gt;
&lt;p&gt;Br,&lt;/p&gt;
&lt;p&gt;Einar&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>