<?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>Error when turn on sensor with TWI</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/52964/error-when-turn-on-sensor-with-twi</link><description>I need to save energy for my ble application. So I turned off the sensor when there was no ble connection. A ble connection is a condition for me to turn on the sensor, but I cannot connect to the peripheral, when placing a connection command on nRF Connect</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Tue, 15 Oct 2019 08:08:47 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/52964/error-when-turn-on-sensor-with-twi" /><item><title>RE: Error when turn on sensor with TWI</title><link>https://devzone.nordicsemi.com/thread/214983?ContentTypeID=1</link><pubDate>Tue, 15 Oct 2019 08:08:47 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:e221bf22-074f-4f43-b4cd-1d8919626b23</guid><dc:creator>J&amp;#248;rgen Holmefjord</dc:creator><description>[quote user="HuanVH"]And one more thing is, when I turned the sensor on and off, even though i2c was not declared, the chip was still restarted.[/quote]
&lt;p&gt;Like I said in my answer above, the chip will only restart if an error is reported. Please debug the application to find which function is reporting an error.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Error when turn on sensor with TWI</title><link>https://devzone.nordicsemi.com/thread/213846?ContentTypeID=1</link><pubDate>Tue, 08 Oct 2019 10:11:31 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:28c1bd99-c59a-4a1c-8b9c-e6be36367427</guid><dc:creator>HuanVH</dc:creator><description>&lt;p&gt;When I use the latest version. The scl, sda pins are all pulled up to vcc, which makes the sensor still work, because my hardware has SCL and SDA suspension resistors.&lt;br /&gt;And one more thing is, when I turned the sensor on and off, even though i2c was not declared, the chip was still restarted.&lt;/p&gt;
&lt;p&gt;&lt;img src="https://devzone.nordicsemi.com/resized-image/__size/320x240/__key/communityserver-discussions-components-files/4/pastedimage1570529472751v1.png" alt=" " /&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Error when turn on sensor with TWI</title><link>https://devzone.nordicsemi.com/thread/213833?ContentTypeID=1</link><pubDate>Tue, 08 Oct 2019 09:36:39 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:2598876b-bd06-4d22-8377-7d928528a812</guid><dc:creator>HuanVH</dc:creator><description>&lt;p&gt;I mean when I need to save energy, so I turn off the sensor. When I need to read I turn it on.&lt;br /&gt;The problem I&amp;#39;m having, even though the CPU is not sleeping, when I connect to the device, the device will turn on the sensor. The process of turning on the sensor caused the nrf52832 to be restarted.&lt;/p&gt;
&lt;p&gt;Even though the sensor is set to power down, it still consumes about 0.51mA, which is great for my ble application.&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="c_cpp"&gt;        case BLE_GAP_EVT_CONNECTED:
            NRF_LOG_DEBUG(&amp;quot;Connected&amp;quot;);
            app_timer_stop(app_timer_adv);
            m_conn_handle = p_ble_evt-&amp;gt;evt.gap_evt.conn_handle;
            err_code = nrf_ble_qwr_conn_handle_assign(&amp;amp;m_qwr, m_conn_handle);
            APP_ERROR_CHECK(err_code);
            nrf_gpio_pin_write(BLE_SENSOR_PIN, 1);
            nrf_delay_ms(1);

            twi_init();            
            break;&lt;/pre&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Error when turn on sensor with TWI</title><link>https://devzone.nordicsemi.com/thread/213830?ContentTypeID=1</link><pubDate>Tue, 08 Oct 2019 09:29:42 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:5fa8b28f-4faf-402d-9196-eb5c6995246d</guid><dc:creator>awneil</dc:creator><description>[quote userid="83281" url="~/f/nordic-q-a/52964/error-when-turn-on-sensor-with-twi/213768"]Whether declared or not declared i2c, the phenomenon still occurs[/quote]
&lt;p&gt;So you&amp;#39;re saying this has nothing to do with your I2C sensor - it is purely a BLE thing?&lt;/p&gt;
&lt;p&gt;If this is about energy saving, are you putting the CPU to sleep - so that the debugger loses connection ?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Error when turn on sensor with TWI</title><link>https://devzone.nordicsemi.com/thread/213771?ContentTypeID=1</link><pubDate>Tue, 08 Oct 2019 02:29:48 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:40a5a499-5f88-45bc-9ec1-770850543543</guid><dc:creator>HuanVH</dc:creator><description>&lt;p&gt;I previously used this latest HW version, but I had trouble reading one of my sensors, so I switched to the older version. Now, I will try to try the latest version again, many thanks&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Error when turn on sensor with TWI</title><link>https://devzone.nordicsemi.com/thread/213768?ContentTypeID=1</link><pubDate>Tue, 08 Oct 2019 01:21:18 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:39b5ac5e-1075-44f3-a826-7a858c4c48ab</guid><dc:creator>HuanVH</dc:creator><description>&lt;p&gt;I need to save energy for my ble application. So I turned off the sensor when there was no ble connection. A ble connection is a condition for me to turn on the sensor, but I cannot connect to the peripheral, when placing a connection command on nRF Connect, the debugger reports &amp;quot;Memory read failure&amp;quot;.&lt;br /&gt;Whether declared or not declared i2c, the phenomenon still occurs.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Error when turn on sensor with TWI</title><link>https://devzone.nordicsemi.com/thread/213627?ContentTypeID=1</link><pubDate>Mon, 07 Oct 2019 11:28:41 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:3b87cdbb-d8d9-4827-ac35-ddaf92e9f6b4</guid><dc:creator>J&amp;#248;rgen Holmefjord</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;Any particular reason you are using a deprecated software (bit-bang) TWI driver? There are new (HW) drivers located in&amp;nbsp;nRF5_SDK_15.3.0_59ac345\modules\nrfx\drivers\src - nrfx_twi.c and nrfx_twim.c, and these can also be used with the legacy API found in&amp;nbsp;nRF5_SDK_15.3.0_59ac345\integration\nrfx\legacy\nrf_drv_twi.h.&lt;/p&gt;
&lt;p&gt;If the chip rebooted, you most likely ended up in the error handler. Please check out &lt;a href="https://devzone.nordicsemi.com/f/nordic-q-a/10729/my-device-is-freezing-and-restarting"&gt;this post&lt;/a&gt; about debugging errors.&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><item><title>RE: Error when turn on sensor with TWI</title><link>https://devzone.nordicsemi.com/thread/213623?ContentTypeID=1</link><pubDate>Mon, 07 Oct 2019 11:21:50 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:ba045395-ed90-4157-87c2-0baef683b92b</guid><dc:creator>awneil</dc:creator><description>&lt;p&gt;So does turning the sensor on/off work without the BLE connection?&lt;/p&gt;
&lt;p&gt;Does the BLE connection work on its own?&lt;/p&gt;
[quote userid="83281" url="~/f/nordic-q-a/52964/error-when-turn-on-sensor-with-twi"]I have a problem connecting[/quote]
&lt;p&gt;What &amp;quot;connection&amp;quot; ar you referring to?&lt;/p&gt;
&lt;p&gt;What &amp;quot;problem&amp;quot; are you having?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>