<?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, mpu650 + hmc5883l</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/22957/twi-mpu650-hmc5883l</link><description>HI, i m beginner in TWI with nrf52832. i want to write a bit in a registre of hmc5883l but i didnt succeed. what i want to do is : 
 writeByte(devAddr, regAddr, b) ==&amp;gt; ( 0x1E,0x37,1) 
 tgis my own code that i tried but i didn&amp;#39;t understand why is not</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Mon, 03 Jul 2017 15:30:57 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/22957/twi-mpu650-hmc5883l" /><item><title>RE: twi, mpu650 + hmc5883l</title><link>https://devzone.nordicsemi.com/thread/90318?ContentTypeID=1</link><pubDate>Mon, 03 Jul 2017 15:30:57 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:a5d21f6c-ba24-4198-b7a4-8f72844e672d</guid><dc:creator>omar </dc:creator><description>&lt;p&gt;The three chip are included in the same card, we use gyro 87 and the mpu6050 is actived by default but the HMC5883L need the bypass active to get the communication with it. The problem is resolved and now I get communication with all chips, we get library for NRF51 that simplify the communication TWI so we have updated it to NRF52 and we use it, one library for both MPU6050 and HMC5883L.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: twi, mpu650 + hmc5883l</title><link>https://devzone.nordicsemi.com/thread/90317?ContentTypeID=1</link><pubDate>Mon, 03 Jul 2017 15:06:12 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:96339d39-dbc2-49b0-93d8-c392ca600f8c</guid><dc:creator>MartinBL</dc:creator><description>&lt;p&gt;To set the I2C_BYPASS_EN bit in the register you will need to write the value 2 to the register:
&lt;img src="https://devzone.nordicsemi.com/cfs-file/__key/communityserver-discussions-components-files/4/0243.Untitled.png" alt="image description" /&gt;
Anyway, I think I may have misunderstood you. Is it so that you have three slave devices, one MPU6050, one BME280, and one HMC5883L? But only the first two are responding? How have you connected everything? Why do you need to enable the I2C bypass features in the MPU6050?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: twi, mpu650 + hmc5883l</title><link>https://devzone.nordicsemi.com/thread/90319?ContentTypeID=1</link><pubDate>Wed, 28 Jun 2017 14:08:46 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:409ebfec-c262-46f7-8277-440e38a773dd</guid><dc:creator>omar </dc:creator><description>&lt;p&gt;I don&amp;#39;t now why you put 2 to register 0x37 because in the datasheet, there are just 0 or 1.
I tried with 2 but it doesn&amp;#39;t work.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: twi, mpu650 + hmc5883l</title><link>https://devzone.nordicsemi.com/thread/90316?ContentTypeID=1</link><pubDate>Wed, 28 Jun 2017 13:36:53 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:a149bfc0-b026-43f2-a263-432a30bb9dee</guid><dc:creator>MartinBL</dc:creator><description>&lt;p&gt;Hi @omar,&lt;/p&gt;
&lt;p&gt;I think you are setting the bypass bit wrong. You need to write a &amp;#39;1&amp;#39; to the I2C_BYPASS_EN bit in the INT_PIN_CFG register &lt;em&gt;in the MPU6050&lt;/em&gt;, not in the magnetometer. In other words, try something like this:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;bool writeBit()
{
        uint8_t packet[2] = {0x37, 2}; // &amp;lt;- WRITE THE VALUE 2 TO REGISTER 0x37
        ret_code_t err_code;
        err_code = nrf_drv_twi_tx(&amp;amp;m_twi,0x68,packet,sizeof(packet),false); // &amp;lt;- USE THE ADDRESS OF THE MPU
        APP_ERROR_CHECK(err_code);

   return err_code;
}
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;After doing this you should be able to get a response from the magnetometer by using the twi_scanner example in our SDK.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: twi, mpu650 + hmc5883l</title><link>https://devzone.nordicsemi.com/thread/90325?ContentTypeID=1</link><pubDate>Mon, 26 Jun 2017 14:49:54 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:e084c4dc-284d-464b-b119-998ee955c9b6</guid><dc:creator>omar </dc:creator><description>&lt;p&gt;I have tested these adress and they work well but i want to activate in this program the bypass of mpu6050 to detect adress of magnetometer which is 0x1E, the activation of this bypass made by writting one byte into the register 0x37 and then i can detect magnetometer device and we can get magnetic component but i didn&amp;#39;t to activate it and I think the problem is in the TWI connection or the TWI command. The major problem is that function worked very well with other device mpu6050 (0x68 0x77)&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: twi, mpu650 + hmc5883l</title><link>https://devzone.nordicsemi.com/thread/90324?ContentTypeID=1</link><pubDate>Mon, 26 Jun 2017 13:35:44 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:f60792a8-743e-4f8a-965e-f6deda30e014</guid><dc:creator>FormerMember</dc:creator><description>&lt;p&gt;The second parameter of nrf_drv_twi_tx() is address, could you try to replace 0x1E with 0x68 or 0x77?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: twi, mpu650 + hmc5883l</title><link>https://devzone.nordicsemi.com/thread/90322?ContentTypeID=1</link><pubDate>Fri, 23 Jun 2017 14:08:29 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:4cfd85db-da4e-462e-8199-7758611d34fc</guid><dc:creator>omar </dc:creator><description>&lt;p&gt;this is the twi configuration and it wored well&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;const nrf_drv_twi_config_t twi_config = {
   .scl                = ARDUINO_SCL_PIN, //pin27
   .sda                = ARDUINO_SDA_PIN, //pin26
   .frequency          = NRF_TWI_FREQ_100K,
   .interrupt_priority = APP_IRQ_PRIORITY_HIGH,
   .clear_bus_init     = false
};

err_code = nrf_drv_twi_init(&amp;amp;m_twi, &amp;amp;twi_config, NULL, NULL);
APP_ERROR_CHECK(err_code);

nrf_drv_twi_enable(&amp;amp;m_twi);


and this the struc of nrf_drv_twi_config_t : 
 
typedef struct
{
    uint32_t            scl;                 ///&amp;lt; SCL pin number.
    uint32_t            sda;                 ///&amp;lt; SDA pin number.
    nrf_twi_frequency_t frequency;           ///&amp;lt; TWI frequency.
    uint8_t             interrupt_priority;  ///&amp;lt; Interrupt priority.
    bool                clear_bus_init;      ///&amp;lt; Clear bus during init.
    bool                hold_bus_uninit;     ///&amp;lt; Hold pull up state on gpio pins after uninit.
} nrf_drv_twi_config_t;
&lt;/code&gt;&lt;/pre&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: twi, mpu650 + hmc5883l</title><link>https://devzone.nordicsemi.com/thread/90323?ContentTypeID=1</link><pubDate>Fri, 23 Jun 2017 08:45:49 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:b0cc3972-2021-4c2c-95c2-e3df88041eef</guid><dc:creator>FormerMember</dc:creator><description>&lt;p&gt;What are the values/settings for &lt;code&gt;m_twi&lt;/code&gt;?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: twi, mpu650 + hmc5883l</title><link>https://devzone.nordicsemi.com/thread/90321?ContentTypeID=1</link><pubDate>Thu, 22 Jun 2017 08:45:41 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:8ba6aff7-565f-4f3f-b82a-1bf22f7432aa</guid><dc:creator>omar </dc:creator><description>&lt;p&gt;this is the exemple of nordic sdk 13.0 (twi scanner), and it works well with this configuration. and i get the two adress of my mpu6050 and the bmp 180 ( which is 0x68 and 0x77) , but the magnetometer didnt works , what i tri to do it here is to set the bypass of my mpu6050 i2c enable which activate the magnetometer  and then i can get magnetic field components.&lt;/p&gt;
&lt;p&gt;the problme is  that when i use this code i get fatal error via the uart and i didnt understand why because it seems correct.&lt;/p&gt;
&lt;h2&gt;Heading&lt;/h2&gt;
&lt;pre&gt;&lt;code&gt;uint8_t packet[2] = {0x37,2};
ret_code_t err_code;
err_code = nrf_drv_twi_tx(&amp;amp;m_twi,(0x1E),packet,sizeof(packet),false);
APP_ERROR_CHECK(err_code);
&lt;/code&gt;&lt;/pre&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: twi, mpu650 + hmc5883l</title><link>https://devzone.nordicsemi.com/thread/90315?ContentTypeID=1</link><pubDate>Thu, 22 Jun 2017 06:45:19 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:a42be5f9-c1ed-4044-8363-3e636ee9b246</guid><dc:creator>FormerMember</dc:creator><description>&lt;p&gt;Please do not &lt;a href="https://devzone.nordicsemi.com/question/153045/gy-87-reading-from-hmc5883l-using-i2c/"&gt;double post questions&lt;/a&gt;. Since this is the latest question, I will close the old one.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: twi, mpu650 + hmc5883l</title><link>https://devzone.nordicsemi.com/thread/90320?ContentTypeID=1</link><pubDate>Thu, 22 Jun 2017 06:44:03 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:532d621a-da5b-443c-ad40-640a4025b66d</guid><dc:creator>FormerMember</dc:creator><description>&lt;p&gt;Did you configure TWI with the correct pins? I see that TWI is configured with ARDUINO_SCL_PIN and ARDUINO_SDA_PIN.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>