<?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>LIS2DH INT1 Triggers on nRF9160</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/73838/lis2dh-int1-triggers-on-nrf9160</link><description>Has anyone had success getting triggers on motion to work with the LIS2DH? I only have INT1 wired so I modified the drivers to work on INT1 as the spec document says it should. I&amp;#39;ve added the appropriate registers: to list2dh.h: 
 
 #define LIS2DH_REG_INT1_SRC</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Tue, 04 May 2021 03:41:14 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/73838/lis2dh-int1-triggers-on-nrf9160" /><item><title>RE: LIS2DH INT1 Triggers on nRF9160</title><link>https://devzone.nordicsemi.com/thread/308047?ContentTypeID=1</link><pubDate>Tue, 04 May 2021 03:41:14 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:9bef8d66-f346-4ed2-bb1f-7ce4d64c6c68</guid><dc:creator>Jared</dc:creator><description>&lt;p&gt;FYI opened a bug about this:&amp;nbsp;&lt;a href="https://github.com/zephyrproject-rtos/zephyr/issues/34794"&gt;https://github.com/zephyrproject-rtos/zephyr/issues/34794&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;I think previously if INT2 was not defined, it would fail gracefully. Something in the device tree API has changed which causes Zephyr to fault.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: LIS2DH INT1 Triggers on nRF9160</title><link>https://devzone.nordicsemi.com/thread/304829?ContentTypeID=1</link><pubDate>Wed, 14 Apr 2021 12:55:52 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:85300c6e-b2c8-4cc5-98e2-370de26c741f</guid><dc:creator>NautDesigner</dc:creator><description>&lt;p&gt;Yes, I have. I&amp;#39;m modifying the drivers and using the sample. I&amp;#39;ll ask over at Zephyr. Thanks.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: LIS2DH INT1 Triggers on nRF9160</title><link>https://devzone.nordicsemi.com/thread/304828?ContentTypeID=1</link><pubDate>Wed, 14 Apr 2021 12:53:25 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:9d3276d3-bc1b-47c7-b8da-0e31662312a8</guid><dc:creator>&amp;#216;yvind</dc:creator><description>&lt;p&gt;I need to ask, but &lt;a href="https://developer.nordicsemi.com/nRF_Connect_SDK/doc/1.5.0/zephyr/samples/sensor/lis2dh/README.html"&gt;have you looked at the LIS2DH sample?&lt;/a&gt;&amp;nbsp;&lt;br /&gt;&lt;br /&gt;&lt;a href="https://github.com/nrfconnect/sdk-zephyr/blob/v2.4.99-ncs-branch/drivers/sensor/lis2dh/lis2dh.c"&gt;https://github.com/nrfconnect/sdk-zephyr/blob/v2.4.99-ncs-branch/drivers/sensor/lis2dh/lis2dh.c&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;If this does not help, then I would suggest asking the Zephyr forum. See &lt;a href="https://developer.nordicsemi.com/nRF_Connect_SDK/doc/1.5.0/zephyr/guides/getting-help.html#asking-for-help"&gt;Asking for help&lt;/a&gt; in the Zephyr docs&lt;/p&gt;
&lt;p&gt;Kind regards,&lt;br /&gt;Øyvind&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: LIS2DH INT1 Triggers on nRF9160</title><link>https://devzone.nordicsemi.com/thread/304485?ContentTypeID=1</link><pubDate>Tue, 13 Apr 2021 11:04:04 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:cb61f44d-3452-4b33-9572-0a030715db50</guid><dc:creator>NautDesigner</dc:creator><description>&lt;p&gt;What I am finding is that if I just setup the trigger, nothing happens. However, if I call&amp;nbsp;fetch_and_display(sensor) before going into a wait loop, the trigger does fire. But then it never stops firing.&lt;/p&gt;
&lt;p&gt;&amp;nbsp;This is the output:&lt;/p&gt;
&lt;p&gt;Sampling at 10 Hz&lt;br /&gt;[00:00:00.024,780] [0m&amp;lt;inf&amp;gt; lis2dh: slope_config&lt;br /&gt;[00:00:00.030,334] [0m&amp;lt;inf&amp;gt; lis2dh: int1_ths=0x49 range_g=16 ums2=89999999&lt;br /&gt;[00:00:00.038,146] [0m&amp;lt;inf&amp;gt; lis2dh: slope_config&lt;br /&gt;[00:00:00.043,182] [0m&amp;lt;inf&amp;gt; lis2dh: int1_dur=0x4&lt;br /&gt;[00:00:00.048,614] [0m&amp;lt;inf&amp;gt; lis2dh: trigger_set&lt;br /&gt;[00:00:00.053,558] [0m&amp;lt;inf&amp;gt; lis2dh: trigger_anym_set&lt;br /&gt;[00:00:00.058,959] [0m&amp;lt;inf&amp;gt; lis2dh: setup_int1&lt;br /&gt;[00:00:00.064,697] [0m&amp;lt;inf&amp;gt; lis2dh: start_trigger_int1&lt;br /&gt;[00:00:00.070,281] [0m&amp;lt;inf&amp;gt; lis2dh: setup_int1&lt;br /&gt;Waiting for triggers&lt;br /&gt;#1 @ 78 ms: , x 3.22 , y 99.29 , z 64.36, g 108.6&lt;br /&gt;MOTION - #2 @ 117 ms: , x 0.00 , y 8.27 , z 5.06, g 0.1&lt;br /&gt;MOTION - #3 @ 215 ms: , x 0.00 , y 8.27 , z 5.06, g 0.1&lt;br /&gt;MOTION - #4 @ 312 ms: , x -0.46 , y 7.35 , z 5.52, g 0.6&lt;br /&gt;MOTION - #5 @ 409 ms: , x 0.00 , y 8.27 , z 5.06, g 0.1&lt;br /&gt;MOTION - #6 @ 507 ms: , x -0.46 , y 7.81 , z 5.06, g 0.5&lt;br /&gt;MOTION - #7 @ 604 ms: , x 0.46 , y 7.35 , z 5.52, g 0.6&lt;br /&gt;MOTION - #8 @ 701 ms: , x 0.00 , y 7.35 , z 5.52, g 0.6&lt;br /&gt;MOTION - #9 @ 799 ms: , x 0.00 , y 7.81 , z 4.60, g 0.7&lt;br /&gt;MOTION - #10 @ 896 ms: , x -0.46 , y 8.27 , z 5.52, g 0.2&lt;br /&gt;MOTION - #11 @ 993 ms: , x 0.00 , y 7.81 , z 5.52, g 0.2&lt;/p&gt;
&lt;p&gt;I do have the movement specified:&amp;nbsp;&lt;/p&gt;
&lt;div&gt;
&lt;div&gt;&lt;span&gt;#define&lt;/span&gt;&lt;span&gt;&amp;nbsp;&lt;/span&gt;&lt;span&gt;LIS2DH_ANYM_CFG&lt;/span&gt;&lt;span&gt;&amp;nbsp;(&lt;/span&gt;&lt;span&gt;LIS2DH_INT_CFG_ZHIE_ZUPE&lt;/span&gt;&lt;span&gt;&amp;nbsp;&lt;/span&gt;&lt;span&gt;|&lt;/span&gt;&lt;span&gt;&amp;nbsp;&lt;/span&gt;&lt;span&gt;LIS2DH_INT_CFG_YHIE_YUPE&lt;/span&gt;&lt;span&gt;&amp;nbsp;&lt;/span&gt;&lt;span&gt;|&lt;/span&gt;&lt;span&gt;\&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;span&gt;LIS2DH_INT_CFG_XHIE_XUPE&lt;/span&gt;&lt;span&gt;&amp;nbsp;|&amp;nbsp;LIS2DH_AOI_CFG)&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span&gt;Code is:&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span&gt;struct sensor_value gScale;&lt;br /&gt; sensor_g_to_ms2(16, &amp;amp;gScale);&lt;br /&gt; rc = sensor_attr_set(sensor,SENSOR_CHAN_ACCEL_XYZ,&lt;br /&gt; SENSOR_ATTR_FULL_SCALE,&lt;br /&gt; &amp;amp;gScale);&lt;br /&gt; if (rc != 0) {&lt;br /&gt; printk(&amp;quot;Failed to set g-scale: %d\n&amp;quot;, rc);&lt;br /&gt; return;&lt;br /&gt; }&lt;br /&gt; struct sensor_value threshold = {&lt;br /&gt; .val1 = 90,&lt;br /&gt; .val2 = 0,&lt;br /&gt; };&lt;br /&gt; rc = sensor_attr_set(sensor,SENSOR_CHAN_ACCEL_XYZ,&lt;br /&gt; SENSOR_ATTR_SLOPE_TH,&lt;br /&gt; &amp;amp;threshold);&lt;br /&gt; if (rc != 0) {&lt;br /&gt; printk(&amp;quot;Failed to set threshold: %d\n&amp;quot;, rc);&lt;br /&gt; return;&lt;br /&gt; }&lt;br /&gt; struct sensor_value duration = {&lt;br /&gt; .val1 = 4,&lt;br /&gt; .val2 = 0,&lt;br /&gt; };&lt;br /&gt; rc = sensor_attr_set(sensor,SENSOR_CHAN_ACCEL_XYZ,&lt;br /&gt; SENSOR_ATTR_SLOPE_DUR,&lt;br /&gt; &amp;amp;duration);&lt;br /&gt; if (rc != 0) {&lt;br /&gt; printk(&amp;quot;Failed to set duration: %d\n&amp;quot;, rc);&lt;br /&gt; return;&lt;br /&gt; }&lt;br /&gt; trig.type = SENSOR_TRIG_DELTA;&lt;br /&gt; trig.chan = SENSOR_CHAN_ACCEL_XYZ;&lt;br /&gt; //trig.chan = SENSOR_CHAN_ALL;&lt;br /&gt; rc = sensor_trigger_set(sensor, &amp;amp;trig, trigger_handler);&lt;br /&gt; if (rc != 0) {&lt;br /&gt; printk(&amp;quot;Failed to set trigger: %d\n&amp;quot;, rc);&lt;br /&gt; return;&lt;br /&gt; }&lt;br /&gt;&lt;br /&gt; printk(&amp;quot;Waiting for triggers\n&amp;quot;);&lt;br /&gt; fetch_and_display(sensor);&lt;br /&gt; while (true) {&lt;br /&gt; k_sleep(K_MSEC(2000));&lt;br /&gt; }&lt;/span&gt;&lt;/div&gt;
&lt;/div&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: LIS2DH INT1 Triggers on nRF9160</title><link>https://devzone.nordicsemi.com/thread/304482?ContentTypeID=1</link><pubDate>Tue, 13 Apr 2021 10:50:18 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:9f5b6b0b-3f1f-4e9e-a6f0-35c8dc0d2e66</guid><dc:creator>&amp;#216;yvind</dc:creator><description>[quote user="NautDesigner"]It does trigger for&amp;nbsp;SENSOR_TRIG_DATA_READY and that works fine. Trying to get it to trigger on movement.[/quote]
&lt;p&gt;&amp;nbsp;Have you configured INT1 to movement recognition? As LIS2DH datasheet, page 39, states:&lt;br /&gt;&lt;span style="font-family:&amp;#39;courier new&amp;#39;, courier;"&gt;&amp;quot;AOI-6D = ‘01’ is movement recognition. An interrupt is generate when orientation move from unknown zone to known zone. The interrupt signal stay for a duration ODR.&amp;quot;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;From sensor.h,&amp;nbsp;SENSOR_TRIG_DATA_READY states:&lt;br /&gt;&lt;span style="font-family:&amp;#39;courier new&amp;#39;, courier;"&gt;/**&amp;nbsp;Trigger&amp;nbsp;fires&amp;nbsp;whenever&amp;nbsp;new&amp;nbsp;data&amp;nbsp;is&amp;nbsp;ready.&amp;nbsp;*/&lt;/span&gt;&lt;/p&gt;
&lt;div&gt;
&lt;div&gt;What happens when you read data from device?&lt;/div&gt;
&lt;/div&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: LIS2DH INT1 Triggers on nRF9160</title><link>https://devzone.nordicsemi.com/thread/304246?ContentTypeID=1</link><pubDate>Mon, 12 Apr 2021 11:39:12 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:053f5aa9-aeb1-4ecc-b42e-c804337dc7cf</guid><dc:creator>NautDesigner</dc:creator><description>&lt;p&gt;INT1 is in the overlay:&lt;/p&gt;
&lt;p&gt;lis2dh@18 {&lt;br /&gt; compatible = &amp;quot;st,lis2dh&amp;quot;;&lt;br /&gt; reg = &amp;lt;0x18&amp;gt;;&lt;br /&gt; irq-gpios = &amp;lt;&amp;amp;gpio0 12 0&amp;gt;; // GPIO_ACTIVE_HIGH&amp;gt;;&lt;br /&gt; label = &amp;quot;LIS2DH&amp;quot;;&lt;br /&gt; };&lt;/p&gt;
&lt;p&gt;It does trigger for&amp;nbsp;SENSOR_TRIG_DATA_READY and that works fine. Trying to get it to trigger on movement.&lt;/p&gt;
&lt;p&gt;Also, how do you add the send interrupt to the irq-gpios line?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: LIS2DH INT1 Triggers on nRF9160</title><link>https://devzone.nordicsemi.com/thread/304178?ContentTypeID=1</link><pubDate>Mon, 12 Apr 2021 06:44:23 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:c471458b-5ba8-43c6-8350-6d421d1660df</guid><dc:creator>&amp;#216;yvind</dc:creator><description>&lt;p&gt;Hello,&amp;nbsp;&lt;br /&gt;&lt;br /&gt;Have you also configured these pins in your overlay? Do you get an error message or does it not communicate with the device correctly? Have a look at my colleague &lt;a href="https://devzone.nordicsemi.com/f/nordic-q-a/67067/build-error-for-example-code-of-lis2dh-with-nrf-sdk-v1-3-1"&gt;Simon&amp;#39;s answer here&lt;/a&gt;, note that it was for NCS tag 1.3.1.&lt;/p&gt;
&lt;p&gt;&lt;br /&gt;Kind regards,&lt;br /&gt;Øyvind&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>