<?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>NRF problem with mpu6050 and twi.</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/86505/nrf-problem-with-mpu6050-and-twi</link><description>Here is the situation:I can read the accvalues by uart without the ble, but when I was trying to read the values on the phone with the ble, it didnt work. I modified the official tutorial code&amp;quot;ble_uart&amp;quot;, it can be built, but the bluetooth didnt work.</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Mon, 04 Apr 2022 06:54:41 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/86505/nrf-problem-with-mpu6050-and-twi" /><item><title>RE: NRF problem with mpu6050 and twi.</title><link>https://devzone.nordicsemi.com/thread/361392?ContentTypeID=1</link><pubDate>Mon, 04 Apr 2022 06:54:41 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:874316e6-722b-472c-8f67-fd2a4c89613f</guid><dc:creator>Edvin</dc:creator><description>&lt;p&gt;I meant the log from the nRF Chip. The nRF52840 DK. Do you see any log from the nRF52840 DK at all? If not, do you see the definition of NRF_LOG_ENABLED in sdk_config.h?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: NRF problem with mpu6050 and twi.</title><link>https://devzone.nordicsemi.com/thread/361299?ContentTypeID=1</link><pubDate>Sat, 02 Apr 2022 01:51:45 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:f162516f-4b32-46f7-a978-d13e79985072</guid><dc:creator>jaychou</dc:creator><description>&lt;p&gt;let me see...my phone connects nRF, and now I intered mpu6050, the log says&lt;/p&gt;
&lt;p&gt;[Callback] centralManager(central, didDisconnectPeripheral:peripheral,error:The connection has timed out unexpectedly.)&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: NRF problem with mpu6050 and twi.</title><link>https://devzone.nordicsemi.com/thread/361263?ContentTypeID=1</link><pubDate>Fri, 01 Apr 2022 14:04:25 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:48677b69-0253-4001-a892-d2e3d1ae6792</guid><dc:creator>Edvin</dc:creator><description>&lt;p&gt;Do you see any logs from the nRF? If not, can you try to set the define:&lt;/p&gt;
&lt;p&gt;NRF_FPRINTF_FLAG_AUTOMATIC_CR_ON_LF_ENABLED&lt;/p&gt;
&lt;p&gt;to 0 in sdk_config. Do you see any logs then? If so, what does the log say when it disconnects?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: NRF problem with mpu6050 and twi.</title><link>https://devzone.nordicsemi.com/thread/361257?ContentTypeID=1</link><pubDate>Fri, 01 Apr 2022 13:52:54 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:9e57137e-eab7-423b-81f4-5b9e621d8e90</guid><dc:creator>jaychou</dc:creator><description>&lt;p&gt;Thanks for answering me, UART has no problem, my problem is that it can run &amp;ldquo;ble_uart&amp;rdquo; and my phone actually can connect the NRF,but the instance I intered the mpu6050 in nrf52840, my phone disconnect&amp;nbsp;automatically. After that, I modified the code based on &amp;quot;ble_uart&amp;quot; and &amp;quot;i2c drives mpu6050&amp;quot;, which can run respectively. I tried to combined the two codes to make bluetooth read acceleration values, unfortunately, it failed.&lt;/p&gt;
&lt;p&gt;Here is some snippet&lt;pre class="ui-code" data-mode="text"&gt;accel_values_t AccValue;
	uint8_t Mpu_D1[8];
	mpu6050_read_accel(&amp;amp;AccValue);
	Mpu_D1[0]=flags;
	Mpu_D1[1]=AccValue.x&amp;gt;&amp;gt;8;
	Mpu_D1[2]=AccValue.x;
	Mpu_D1[3]=AccValue.y&amp;gt;&amp;gt;8;
	Mpu_D1[4]=AccValue.y;
	Mpu_D1[5]=AccValue.z&amp;gt;&amp;gt;8;
	Mpu_D1[6]=AccValue.z;
	Mpu_D1[7]=0x00;
	uint16_t M_Len;
	M_Len= sizeof(Mpu_D1);
  err_code = ble_nus_data_send(&amp;amp;m_nus,Mpu_D1,M_Len,m_conn_handle);
  
  &lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;Thanks again,your answer means a lot for me!&lt;span class="emoticon" data-url="https://devzone.nordicsemi.com/cfs-file/__key/system/emoji/2764.svg" title="Heart"&gt;&amp;#x2764;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;Jay Chou&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: NRF problem with mpu6050 and twi.</title><link>https://devzone.nordicsemi.com/thread/361241?ContentTypeID=1</link><pubDate>Fri, 01 Apr 2022 13:02:06 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:145a324e-073a-4416-9927-14d9cdf8664a</guid><dc:creator>Edvin</dc:creator><description>&lt;p&gt;Hello,&lt;/p&gt;
&lt;p&gt;Are you actually using UART or TWI between the MPU6050 and the nRF?&amp;nbsp;&lt;/p&gt;
&lt;p&gt;And if I understand you correctly, it is working one at the time (either Bluetooth or MPU), so what happens when you try to run it? Does the log say anything? Can you upload your main.c and your sdk_config.h? Perhaps it can give some hints on what may be the problem.&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;Best regards,&lt;/p&gt;
&lt;p&gt;Edvin&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>