<?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 scanner example stuck at address 0x1 on nRF51 DK board</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/50073/twi-scanner-example-stuck-at-address-0x1-on-nrf51-dk-board</link><description>Hi, 
 i&amp;#39;ve got the TWI scanner example flashed onto the NRF51 dk board, using the default &amp;quot;Arduino&amp;quot; pins of P0.07 and P0.30 as SDA/SCL. 
 I&amp;#39;ve added two lines to the example code inside the &amp;quot;for each address loop&amp;quot; so that it reads out each address as</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Tue, 06 Aug 2019 03:52:47 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/50073/twi-scanner-example-stuck-at-address-0x1-on-nrf51-dk-board" /><item><title>RE: TWI scanner example stuck at address 0x1 on nRF51 DK board</title><link>https://devzone.nordicsemi.com/thread/202502?ContentTypeID=1</link><pubDate>Tue, 06 Aug 2019 03:52:47 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:8921060b-5137-40f0-9e18-c2a6baf980a8</guid><dc:creator>myNrfDoesntWork</dc:creator><description>&lt;p&gt;&lt;span&gt;This issue has been resolved, thank you!&lt;/span&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: TWI scanner example stuck at address 0x1 on nRF51 DK board</title><link>https://devzone.nordicsemi.com/thread/202018?ContentTypeID=1</link><pubDate>Fri, 02 Aug 2019 03:25:05 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:fdad93ef-0534-4be0-8f83-30afe8bd1c78</guid><dc:creator>myNrfDoesntWork</dc:creator><description>&lt;p&gt;Right, I don&amp;#39;t have a good way to see a logic trace of the bus at the moment. I have a MAX7313 connected to the bus, address set to 0x40. It&amp;#39;s supplied with 3.3V as well. I have a small collection of i2c devices on the bus that can be jumpered in (sda/scl disconnected). No luck on any of them. Supply is good to all devices. &lt;br /&gt;&lt;br /&gt;I&amp;#39;ve ended up trying the sdk v10 examples, would you be able to tell me if the code will do what I think it will - namely sweep through all addresses and read out the first few registers of each?&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;//==========START example==================&lt;/p&gt;
&lt;p&gt;#&amp;lt;included everything needed for this thing to compile&amp;gt;&lt;/p&gt;
&lt;p&gt;void twi_init (void){&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; ret_code_t err_code;&lt;br /&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; //mma7660 is from the example, won&amp;#39;t bother changing variable names.&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; const nrf_drv_twi_config_t twi_mma_7660_config = {&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; .scl&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; = 16,&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; .sda&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; = 15,&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; .frequency&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; = NRF_TWI_FREQ_100K,&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; .interrupt_priority = APP_IRQ_PRIORITY_HIGH&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; };&lt;br /&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; err_code = nrf_drv_twi_init(&amp;amp;m_twi_mma_7660, &amp;amp;twi_mma_7660_config, twi_handler, NULL);&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; APP_ERROR_CHECK(err_code);&lt;br /&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; nrf_drv_twi_enable(&amp;amp;m_twi_mma_7660);&lt;br /&gt;}&lt;/p&gt;
&lt;p&gt;int main(void){&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; uart_config();&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; twi_init();&lt;br /&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;uint8_t readResult = 0x00;&lt;br /&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;ret_code_t rt;&lt;br /&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;for(int adr = 0; adr&amp;lt; 128; ++adr){&lt;br /&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;for(int i = 0; i&amp;lt;0xF; ++i){&lt;br /&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;rt = nrf_drv_twi_rx(&amp;amp;m_twi_mma_7660, adr, &amp;amp;readResult, 1, false);&lt;br /&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;nrf_delay_ms(100);&lt;br /&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;printf(&amp;quot;%d&amp;gt;&amp;gt;0x%d:%x\t%d\r\n&amp;quot;,adr,i,readResult,rt);&lt;br /&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&lt;br /&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;}&lt;br /&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;}&lt;br /&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;&lt;br /&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; while(true){&lt;br /&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;printf(&amp;quot;done\r\n&amp;quot;);&lt;br /&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;nrf_delay_ms(500);&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;br /&gt;}&lt;/p&gt;
&lt;p&gt;//================END of example======================&lt;/p&gt;
&lt;p&gt;I run that and end up getting error codes of 0, and readResults of 0 as well. But it runs and doesn&amp;#39;t get stuck.&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;Thanks.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: TWI scanner example stuck at address 0x1 on nRF51 DK board</title><link>https://devzone.nordicsemi.com/thread/200808?ContentTypeID=1</link><pubDate>Fri, 26 Jul 2019 15:33:55 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:6b334b9d-5e09-4699-a208-0759e46adf7f</guid><dc:creator>J&amp;#248;rgen Holmefjord</dc:creator><description>&lt;p&gt;It is not easy to give suggestions without seeing a logic trace of the bus. It seems that there is not generated a STOPPED event. Which device did you connect to the TWI bus? Have you tried with other devices? I assume the devices are powered and run at a similar voltage to the nRF?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: TWI scanner example stuck at address 0x1 on nRF51 DK board</title><link>https://devzone.nordicsemi.com/thread/200167?ContentTypeID=1</link><pubDate>Wed, 24 Jul 2019 00:20:59 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:a71b483a-a10a-4860-ba0c-8d081a706f2a</guid><dc:creator>myNrfDoesntWork</dc:creator><description>&lt;p&gt;Ok, I got the debug working by going into Windows control panel -&amp;gt; repair nrf toolkit. Why would a new installation require this step is beyond me.&lt;/p&gt;
&lt;p&gt;Anyways, the debugger does help - it gets stuck at a while loop that it never seems to exit within nrf_drv_twi.marked by the breakpoint.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;img alt=" " src="https://devzone.nordicsemi.com/resized-image/__size/1000x1000/__key/communityserver-discussions-components-files/4/pastedimage1563927353153v1.png" /&gt;&lt;/p&gt;
&lt;p&gt;That line of code calls this below, which seemingly returns true all the time (at least 200 times, anyways).&lt;/p&gt;
&lt;p&gt;&lt;img alt=" " src="https://devzone.nordicsemi.com/resized-image/__size/1000x1000/__key/communityserver-discussions-components-files/4/pastedimage1563927468741v2.png" /&gt;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;I&amp;#39;m in the situation where I am away from any of the usual debugging tools, with no oscilloscope and definitely no logic analyzer, so all I have is this debugger and a multimeter.&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;Do you have any suggestions on how to proceed?&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Thanks.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: TWI scanner example stuck at address 0x1 on nRF51 DK board</title><link>https://devzone.nordicsemi.com/thread/200119?ContentTypeID=1</link><pubDate>Tue, 23 Jul 2019 14:38:01 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:e054aa47-40cc-4e88-91fe-4d33167a402f</guid><dc:creator>J&amp;#248;rgen Holmefjord</dc:creator><description>&lt;p&gt;Please check using the debugger where the application is stopping. If you do not get more output, something seems to stop. You can also check the TWI lines using a logic analyzer, to see if anything is output on the bus.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: TWI scanner example stuck at address 0x1 on nRF51 DK board</title><link>https://devzone.nordicsemi.com/thread/199899?ContentTypeID=1</link><pubDate>Tue, 23 Jul 2019 00:40:35 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:ab42569a-2c72-43e7-babc-63e6f3b24864</guid><dc:creator>myNrfDoesntWork</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;Yes, I&amp;#39;ve gone around and tried &lt;em&gt;many&lt;/em&gt; pairs of pins. All the same behavior. What else do you suggest I try?&lt;/p&gt;
&lt;p&gt;To address your second point, Keil has been having issues with debugging and flashing. I&amp;#39;ve never gotten it to work quite right. This happens 90% of the time I try: &lt;strong&gt;(Update: I&amp;#39;ve managed to fix the Keil issue and can do debugging now. Will try to&amp;nbsp;add a debug log output shortly).&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;&lt;img alt=" " src="https://devzone.nordicsemi.com/resized-image/__size/320x240/__key/communityserver-discussions-components-files/4/pastedimage1563842217673v1.png" /&gt;&lt;/p&gt;
&lt;p&gt;I&amp;#39;ve went through most of the options here:&lt;/p&gt;
&lt;p&gt;&lt;img alt=" " src="https://devzone.nordicsemi.com/resized-image/__size/320x240/__key/communityserver-discussions-components-files/4/pastedimage1563842272958v2.png" /&gt;&lt;/p&gt;
&lt;p&gt;When I just try to flash the code, &lt;em&gt;sometimes&lt;/em&gt; Keil wants to connect to the nrf51-dk board and &amp;quot;download&amp;quot; the code, but I just go through nRF connect to do the flashing.&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;Thanks.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: TWI scanner example stuck at address 0x1 on nRF51 DK board</title><link>https://devzone.nordicsemi.com/thread/199791?ContentTypeID=1</link><pubDate>Mon, 22 Jul 2019 12:42:06 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:6e51b9c0-3cb5-4856-8abf-61bd6c745217</guid><dc:creator>J&amp;#248;rgen Holmefjord</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;Have you tried using other pins? P0.07 on the nRF51 DK is by default used for the CTS UART HW flow control line and connected to the interface MCU.&lt;/p&gt;
&lt;p&gt;Did you debug the application, to see if it is only the log that does not output, or if the application crashes?&lt;/p&gt;
&lt;p&gt;Best regards,&lt;br /&gt;Jørgen&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>