<?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>Wake on motion in nrf52</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/20159/wake-on-motion-in-nrf52</link><description>Hello, 
 I am trying to implement wake on motion functionality of MPU9250 with nRF52.
I am writing below sequence code for wake on motion configuration: 
 void MPU6500_StartMotionDetection(void)
{
uint8_t val;
uint32_t err_code; 
 // Make sure</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Thu, 09 Mar 2017 10:12:22 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/20159/wake-on-motion-in-nrf52" /><item><title>RE: Wake on motion in nrf52</title><link>https://devzone.nordicsemi.com/thread/78524?ContentTypeID=1</link><pubDate>Thu, 09 Mar 2017 10:12:22 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:7928b194-d3c6-49c6-a6e2-2e472b9fc521</guid><dc:creator>J&amp;#248;rgen Holmefjord</dc:creator><description>&lt;p&gt;Great that you got it working!&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Wake on motion in nrf52</title><link>https://devzone.nordicsemi.com/thread/78523?ContentTypeID=1</link><pubDate>Thu, 09 Mar 2017 09:58:06 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:3fb6f09a-a71a-4b95-972c-3e748761bb53</guid><dc:creator>Swapnil</dc:creator><description>&lt;p&gt;Thank you Jorgen for help, I have solved the problem of wake on motion functionality. Apparently I was doing double configuration for interrupt in MPU initialization and in MPU_wake on motion functionality. when excluded interrupt initialization from MPU_init function, it started to work fine.
But thank you so much for help&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Wake on motion in nrf52</title><link>https://devzone.nordicsemi.com/thread/78521?ContentTypeID=1</link><pubDate>Wed, 08 Mar 2017 12:55:12 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:058a232c-4973-466d-8bfe-a92abf59ee02</guid><dc:creator>Swapnil</dc:creator><description>&lt;p&gt;I tried to change last write&lt;/p&gt;
&lt;p&gt;// Enable Cycle Mode (Accel Low Power Mode)
//In PWR_MGMT_1 (0x6B) make CYCLE =1&lt;/p&gt;
&lt;p&gt;err_code[7] = i2c_write_registers(I2C_MPU9250_ADDR, MPU_REG_PWR_MGMT_1, 0x20);&lt;/p&gt;
&lt;p&gt;but no effect, still no interrupt.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Wake on motion in nrf52</title><link>https://devzone.nordicsemi.com/thread/78520?ContentTypeID=1</link><pubDate>Wed, 08 Mar 2017 12:50:02 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:4429af7f-4592-4310-8b55-388da280508c</guid><dc:creator>J&amp;#248;rgen Holmefjord</dc:creator><description>&lt;p&gt;According to the &lt;a href="https://www.invensense.com/wp-content/uploads/2015/02/RM-MPU-9250A-00-v1.6.pdf#page=9"&gt;MPU-9250 Register Map and Descriptions document&lt;/a&gt;, CYCLE should be bit 5 of PWR_MGMT_1 register. Can you try changing last write to 0x20?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Wake on motion in nrf52</title><link>https://devzone.nordicsemi.com/thread/78518?ContentTypeID=1</link><pubDate>Wed, 08 Mar 2017 12:32:46 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:73d37402-46e0-4d6b-a097-e39883e58302</guid><dc:creator>Swapnil</dc:creator><description>&lt;p&gt;Sorry for confusion but I changed it and I am using below configuration&lt;/p&gt;
&lt;p&gt;uint32_t MPU6500_StartMotionDetection(void)&lt;/p&gt;
&lt;p&gt;{&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;uint32_t err_code[CONFIGURATION_CHECK_LENGTH];


//*********************************************************************************//
// Make sure accelerometer is running
//In PWR_MGMT_1 (0x6B) make CYCLE = 0, SLEEP = 0 and STANDBY = 0
err_code[0] = i2c_write_registers(I2C_MPU9250_ADDR, MPU_REG_PWR_MGMT_1, 0x00);

//Set DIS_XA, DIS_YA, DIS_ZA = 0 and DIS_XG, DIS_YG, DIS_ZG = 1
err_code[1] = i2c_write_registers(I2C_MPU9250_ADDR, MPU_REG_PWR_MGMT_2, 0x07);

// Set Accel LPF setting to 184 Hz Bandwidth
//ACCEL_CONFIG 2 (0x1D) set ACCEL_FCHOICE_B = 1 and A_DLPFCFG[2:]=1(b001)
err_code[2] = i2c_write_registers(I2C_MPU9250_ADDR, MPU_REG_ACCEL_CONFIG_2, 0x05);

// Enable Motion Interrupt
err_code[3] = i2c_write_registers(I2C_MPU9250_ADDR, MPU_REG_INT_ENABLE, 0x40);

// Enable Accel Hardware Intelligence
//In MOT_DETECT_CTRL (0x69), set ACCEL_INTEL_EN = 1 and ACCEL_INTEL_MODE = 1
err_code[4] = i2c_write_registers(I2C_MPU9250_ADDR, MPU_REG_MOT_DETECT_CTRL, 0xC0);

// Set Motion Threshold
//In WOM_THR (0x1F), set the WOM_Threshold[7:0] to 1~255 LSBs (0~1020mg)
err_code[5] = i2c_write_registers(I2C_MPU9250_ADDR, MPU_REG_WOM_THR, 0xFF);

// Set Frequency of Wake-up
//In LP_ACCEL_ODR (0x1E), set Lposc_clksel[3:0] = 0.24Hz ~ 500Hz
err_code[6] = i2c_write_registers(I2C_MPU9250_ADDR, MPU_REG_LP_ACCEL_ODR, 0x03);

// Enable Cycle Mode (Accel Low Power Mode)
//In PWR_MGMT_1 (0x6B) make CYCLE =1
err_code[7] = i2c_write_registers(I2C_MPU9250_ADDR, MPU_REG_PWR_MGMT_1, 0x03);
//*********************************************************************************//
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;}&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Wake on motion in nrf52</title><link>https://devzone.nordicsemi.com/thread/78519?ContentTypeID=1</link><pubDate>Wed, 08 Mar 2017 12:30:54 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:5a324f22-e9f2-4c2c-9c05-2bf02f21f797</guid><dc:creator>J&amp;#248;rgen Holmefjord</dc:creator><description>&lt;p&gt;It does not look like it to me. For instance this line from the link: &lt;code&gt;writeI2C_1Byte(MPU9250_DEFAULT_ADDRESS, MPU9250_ACCEL_CONFIG2, 0b00000101)&lt;/code&gt; does not look like the same as the line &lt;code&gt;i2c_write_registers(I2C_MPU9250_ADDR, MPU_REG_ACCEL_CONFIG_2, 0x01)&lt;/code&gt; from your code (0b00000101 and 0x01 is not the same value).&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Wake on motion in nrf52</title><link>https://devzone.nordicsemi.com/thread/78517?ContentTypeID=1</link><pubDate>Wed, 08 Mar 2017 12:09:44 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:9de9eefd-5178-4dd3-94a9-918d1e258b38</guid><dc:creator>Swapnil</dc:creator><description>&lt;p&gt;No i kept the exact same values&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Wake on motion in nrf52</title><link>https://devzone.nordicsemi.com/thread/78516?ContentTypeID=1</link><pubDate>Wed, 08 Mar 2017 12:08:34 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:e36a526d-0743-4256-b55f-dda8a272d030</guid><dc:creator>J&amp;#248;rgen Holmefjord</dc:creator><description>&lt;p&gt;But you changed the values? Are you doing a different configuration than the link?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Wake on motion in nrf52</title><link>https://devzone.nordicsemi.com/thread/78515?ContentTypeID=1</link><pubDate>Wed, 08 Mar 2017 12:03:13 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:07ed744b-9455-4185-8556-62570195455d</guid><dc:creator>Swapnil</dc:creator><description>&lt;p&gt;Yes I took reference from below link
&lt;a href="https://github.com/ImanolGo/WirelessChargerEK/blob/5a9e8489bef5ade98be2639c737f28be039bf6ec/src/mpu9250.c"&gt;link text&lt;/a&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Wake on motion in nrf52</title><link>https://devzone.nordicsemi.com/thread/78514?ContentTypeID=1</link><pubDate>Wed, 08 Mar 2017 12:01:45 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:baedbf2d-ce13-480d-87d7-84adddc7404d</guid><dc:creator>J&amp;#248;rgen Holmefjord</dc:creator><description>&lt;p&gt;Are you sure that your configuration of the Wake-on-motion is correct?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Wake on motion in nrf52</title><link>https://devzone.nordicsemi.com/thread/78513?ContentTypeID=1</link><pubDate>Wed, 08 Mar 2017 11:19:06 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:ce477ae4-97e6-480a-af2c-9a5e86c69f88</guid><dc:creator>Swapnil</dc:creator><description>&lt;p&gt;Hello Jorgen, Thank you for suggestion. I checked the voltage levels at interrupt pin and i noticed that from the moment I flash the program inside I see the voltage at interrupt pin is 1.1V and then it goes to 1mV and remain constant but if I dont configure the motion detect functionality then I saw the voltage level of 1.1V and remains constant.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Wake on motion in nrf52</title><link>https://devzone.nordicsemi.com/thread/78512?ContentTypeID=1</link><pubDate>Wed, 08 Mar 2017 10:15:35 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:d8abeda2-2df4-4549-8439-5e26b2bdd442</guid><dc:creator>J&amp;#248;rgen Holmefjord</dc:creator><description>&lt;p&gt;Do you have an oscilloscope? You could also try with a multimeter, but it will depend on how long the signal is set and how acurate your meter is if you are able to measure the signal. Alternatively, you can connect the line to another board running the &lt;a href="http://infocenter.nordicsemi.com/topic/com.nordic.infocenter.sdk5.v12.2.0/pin_change_int_example.html?cp=4_0_1_4_5_16"&gt;pin_change_interrupt&lt;/a&gt; example, to see if it detects the pin once the MPU is initialized.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Wake on motion in nrf52</title><link>https://devzone.nordicsemi.com/thread/78511?ContentTypeID=1</link><pubDate>Tue, 07 Mar 2017 13:23:14 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:744243a7-7d86-468e-883e-2998b29fd278</guid><dc:creator>Swapnil</dc:creator><description>&lt;p&gt;I dont have logic analyzer to test it now, hence its not possible to check any interrupt line. Can you suggest some other option for detecting?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Wake on motion in nrf52</title><link>https://devzone.nordicsemi.com/thread/78510?ContentTypeID=1</link><pubDate>Tue, 07 Mar 2017 09:19:38 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:93142d49-05da-4f27-9dc1-d03ef20e3add</guid><dc:creator>J&amp;#248;rgen Holmefjord</dc:creator><description>&lt;p&gt;Have you checked the interrupt line from your MPU9250 with a logic analyzer, to see if it is sending a singal when it detects motion?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Wake on motion in nrf52</title><link>https://devzone.nordicsemi.com/thread/78509?ContentTypeID=1</link><pubDate>Tue, 07 Mar 2017 09:10:27 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:4d2b61ef-1cee-4a34-a845-2ab12297fcd6</guid><dc:creator>Swapnil</dc:creator><description>&lt;p&gt;I was getting getting error code 8, but after connecting interrupt pin from pin no. 38 to pin 22, the error is not there. But I am not getting wake on motion effect.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Wake on motion in nrf52</title><link>https://devzone.nordicsemi.com/thread/78522?ContentTypeID=1</link><pubDate>Mon, 06 Mar 2017 09:35:32 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:ba9fde4a-baef-4fdb-bec0-0a96fc0e0014</guid><dc:creator>J&amp;#248;rgen Holmefjord</dc:creator><description>&lt;p&gt;Your initialization looks similar to the one described in the &lt;a href="http://infocenter.nordicsemi.com/topic/com.nordic.infocenter.sdk5.v12.2.0/hardware_driver_gpiote.html?cp=4_0_1_2_5_4_1#gpiote_in_usage"&gt;GPIOTE driver documentation&lt;/a&gt;. What error code are you getting?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>