<?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>Read MPU 9250 magnetometer</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/28414/read-mpu-9250-magnetometer</link><description>Hello, 
 I want to read the values from MPU9250 magnetometer i.e. from AK8963 I wrote a function just like accelerometer and gyroscope shown below: 
 uint32_t mpu_read_mag(mag_values_t * mag_values)

 {

 uint32_t err_code;
 uint8_t raw_values</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Thu, 23 Jan 2020 20:18:38 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/28414/read-mpu-9250-magnetometer" /><item><title>RE: Read MPU 9250 magnetometer</title><link>https://devzone.nordicsemi.com/thread/230741?ContentTypeID=1</link><pubDate>Thu, 23 Jan 2020 20:18:38 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:1f67f6f4-c5bd-4e08-a29a-c562ed68d966</guid><dc:creator>jjifa</dc:creator><description>&lt;p&gt;Dear MartinBL,&lt;/p&gt;
&lt;p&gt;I also tried to access the AK8963C embedded in the MPU-9250 but failed to solve the problem.&lt;/p&gt;
&lt;p&gt;I could solve this problem only now after reading your article.&lt;/p&gt;
&lt;p&gt;Thank you so much. realy.&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Read MPU 9250 magnetometer</title><link>https://devzone.nordicsemi.com/thread/112143?ContentTypeID=1</link><pubDate>Sun, 24 Dec 2017 20:13:41 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:bc055eff-63ee-4765-8352-ba30ba087b94</guid><dc:creator>vam5104</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;did your magnetometer give the desired results? If so, can you specify how? I have been trying from a long time without any success.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Read MPU 9250 magnetometer</title><link>https://devzone.nordicsemi.com/thread/112145?ContentTypeID=1</link><pubDate>Tue, 08 Nov 2016 12:25:19 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:12a88ff0-f2f5-4813-a322-9d9fbb2be2a1</guid><dc:creator>MartinBL</dc:creator><description>&lt;p&gt;The AK8975 is actually its own separate TWI device inside the MPU9150. To be able to communicate with it you must enable &amp;quot;bypass mode&amp;quot; by setting the BYPASS_EN bit in register 0x37  &amp;quot;INT Pin / Bypass Enable Configuration&amp;quot;. If you use the MPU library you can do it like this:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;mpu_int_pin_cfg_t bypass_config;
bypass_config.i2c_bypass_en = 1;
ret_code = mpu_int_cfg_pin(&amp;amp;bypass_config); // Set bypass mode
APP_ERROR_CHECK(ret_code); // Check for errors in return value
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;Before you have done this you won&amp;#39;t get any response when you try to read or write to address 0x0C (and frankly I&amp;#39;m a bit surprised that you are not receiving any error codes). This is not very well documented in the MPU datasheets, but relevant chapters are 7.14 and 7.12 in the datasheet and 4.19 in the Register Map. I haven&amp;#39;t tried reading or writing to the magnetometer registers, but at least I could see that the AK8975 was available on the TWI bus by using &lt;a href="https://github.com/Martinsbl/twi-find-devices-on-bus"&gt;this example&lt;/a&gt;.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Read MPU 9250 magnetometer</title><link>https://devzone.nordicsemi.com/thread/112142?ContentTypeID=1</link><pubDate>Tue, 08 Nov 2016 10:45:02 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:0a62f0a6-0d26-45d5-87d6-50d8282a4164</guid><dc:creator>Swapnil</dc:creator><description>&lt;p&gt;The AK8963_ADDR value is 0x0C. I don&amp;#39;t get any error codes. I also configured the control register of AK8963:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;err_code = mpu_write_register(REG_CNTL_1, 0x00);
if(err_code != NRF_SUCCESS) return err_code;
err_code = mpu_write_register(REG_CNTL_1, 0x04);
if(err_code != NRF_SUCCESS) return err_code;
&lt;/code&gt;&lt;/pre&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Read MPU 9250 magnetometer</title><link>https://devzone.nordicsemi.com/thread/112141?ContentTypeID=1</link><pubDate>Tue, 08 Nov 2016 09:00:55 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:537433d9-f1fa-45a8-8907-04274c299b86</guid><dc:creator>MartinBL</dc:creator><description>&lt;p&gt;I have never tried to use the magnetometer. What is the AK8963_ADDR value? Do you get error codes returned from the twi transfer functions? I haven&amp;#39;t had the time to look into the datasheets, but I think you might have to enable the magnetometer in the configuration registers before you can use it.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Read MPU 9250 magnetometer</title><link>https://devzone.nordicsemi.com/thread/112140?ContentTypeID=1</link><pubDate>Mon, 07 Nov 2016 15:41:24 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:8d31041f-f072-4a60-ab53-aed07aa2b011</guid><dc:creator>Swapnil</dc:creator><description>&lt;p&gt;I got the output correctly at CSR board, and I know how this sensor works. I am not getting any output for magnetometer on Nordic Dev. board. I am getting values of accelerometer and gyroscope but when i give the address of AK8963 then i am not able to communicate&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Read MPU 9250 magnetometer</title><link>https://devzone.nordicsemi.com/thread/112139?ContentTypeID=1</link><pubDate>Mon, 07 Nov 2016 15:22:32 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:7225f5a5-3693-4b72-b337-03ffc811d32b</guid><dc:creator>Petter Myhre</dc:creator><description>&lt;p&gt;What doesn&amp;#39;t show any output? Have you tried to debug? Are you able to communicate with the sensor at all? Have you connected a logic analyzer to see what is happening on the lines?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Read MPU 9250 magnetometer</title><link>https://devzone.nordicsemi.com/thread/112144?ContentTypeID=1</link><pubDate>Fri, 04 Nov 2016 18:09:07 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:16de8b5e-7f55-4bad-896b-a3c3c1b26780</guid><dc:creator>robert</dc:creator><description>&lt;p&gt;Think you need to head over to the invensense forums for help on the MPU9250.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>