<?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>TWIM driver issue with LSM6DS3TC-R</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/92711/twim-driver-issue-with-lsm6ds3tc-r</link><description>Hi, I need to read out the Gyro Data of an LSM6DS3TC-R via I2C/TWI. The xiao nrf board uses an nrf52840 and has the gyro sensor build into it, so I don&amp;#39;t have access to the pins with an oscilloscope. I know the connection as it is drawn in the schematic</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Thu, 26 Jan 2023 14:20:29 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/92711/twim-driver-issue-with-lsm6ds3tc-r" /><item><title>RE: TWIM driver issue with LSM6DS3TC-R</title><link>https://devzone.nordicsemi.com/thread/406686?ContentTypeID=1</link><pubDate>Thu, 26 Jan 2023 14:20:29 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:4dda2fdf-da34-419e-98d7-fb419b0ed2bb</guid><dc:creator>Susheel Nuguru</dc:creator><description>&lt;p&gt;nRFX library is available both in nRF5SDK and nRF Connect SDK. You can use &lt;a href="https://developer.nordicsemi.com/nRF_Connect_SDK/doc/latest/nrfx/drivers/gpio/hal.html"&gt;nrfx_gpio&lt;/a&gt;&amp;nbsp;to configure a pin for its drive strength.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: TWIM driver issue with LSM6DS3TC-R</title><link>https://devzone.nordicsemi.com/thread/406539?ContentTypeID=1</link><pubDate>Wed, 25 Jan 2023 18:39:14 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:8492ee70-b1c4-4ab8-bc00-373220592ba9</guid><dc:creator>captainfips</dc:creator><description>&lt;p&gt;Okay... this code works in the nrf5 sdk, I don&amp;#39;t know how to configure the drive strength in the connect sdk either.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: TWIM driver issue with LSM6DS3TC-R</title><link>https://devzone.nordicsemi.com/thread/406511?ContentTypeID=1</link><pubDate>Wed, 25 Jan 2023 15:24:56 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:a2b58995-74a2-4b37-8446-db66d3d26c77</guid><dc:creator>brian.g</dc:creator><description>&lt;p&gt;Thanks!&lt;/p&gt;
&lt;p&gt;I&amp;#39;m using nrf connect. Total zephyr newbie, still trying to wrap my head around it all.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: TWIM driver issue with LSM6DS3TC-R</title><link>https://devzone.nordicsemi.com/thread/406504?ContentTypeID=1</link><pubDate>Wed, 25 Jan 2023 15:13:46 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:61d82a23-06e6-423c-996e-aba8bec28d3b</guid><dc:creator>captainfips</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;Currently this works for me:&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="c_cpp"&gt;#define GYRO_EN NRF_GPIO_PIN_MAP(1,8) // LSM6DS3_PWR
nrf_gpio_pin_set(GYRO_EN);
nrf_gpio_cfg(GYRO_EN, NRF_GPIO_PIN_DIR_OUTPUT, NRF_GPIO_PIN_INPUT_DISCONNECT, NRF_GPIO_PIN_NOPULL, NRF_GPIO_PIN_D0H1, NRF_GPIO_PIN_NOSENSE);
nrf_delay_ms(35);&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;Are you using nRF SDK or nrf connect?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: TWIM driver issue with LSM6DS3TC-R</title><link>https://devzone.nordicsemi.com/thread/406133?ContentTypeID=1</link><pubDate>Mon, 23 Jan 2023 22:38:11 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:c447f95b-fded-4a1f-bb28-cbecd86c12a5</guid><dc:creator>brian.g</dc:creator><description>&lt;p&gt;Also have an issue getting the sensor communicating. What did you use to change the output drive strength. I tried using&amp;nbsp;&lt;br /&gt;&lt;code&gt;&lt;/code&gt;&lt;/p&gt;
&lt;p&gt;&lt;code&gt;gpio_pin_configure_dt(&amp;amp;enableIMU, GPIO_DS_ALT_HIGH);&lt;/code&gt;&lt;/p&gt;
&lt;p&gt;with no luck. Thanks.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: TWIM driver issue with LSM6DS3TC-R</title><link>https://devzone.nordicsemi.com/thread/392847?ContentTypeID=1</link><pubDate>Thu, 27 Oct 2022 13:20:52 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:100e9f4f-ff5f-486b-ac35-82be88f5435f</guid><dc:creator>captainfips</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;yesterday I found the issue with my configuration after looking at the oscilloscope pictures again. The only possible reason for the I2C lines not to remain at Vcc after enabling the Power pin was simply that there wasn&amp;#39;t enough power. In the nrfx_gpiote driver I found out that the default output drive strength for a gpiote_out_simple config was standard (S0S1). I changed my code to enable the power pin with drive strength S0H1 and it works perfectly now.&lt;br /&gt;&lt;br /&gt;So thanks for your suggestions and I will verify one answer as a solution.&lt;/p&gt;
&lt;p&gt;Best regards!&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: TWIM driver issue with LSM6DS3TC-R</title><link>https://devzone.nordicsemi.com/thread/392481?ContentTypeID=1</link><pubDate>Tue, 25 Oct 2022 21:14:25 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:f96199ee-a44d-4a12-a9c7-6659081b14d8</guid><dc:creator>Nguyen Hoan Hoang</dc:creator><description>&lt;p&gt;Sorry I didn&amp;#39;t see it. &amp;nbsp;There is something else however. &amp;nbsp;The LSM6DS3 is powered by a gpis pin 1.08. &amp;nbsp;Have you enable it ? Configure it as output and set it to high ?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: TWIM driver issue with LSM6DS3TC-R</title><link>https://devzone.nordicsemi.com/thread/392081?ContentTypeID=1</link><pubDate>Mon, 24 Oct 2022 09:38:32 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:76c24360-4751-4bba-a7c6-9582beab8743</guid><dc:creator>captainfips</dc:creator><description>&lt;p&gt;It has two 10k Pulup resistors. They are drawn in the middle of the same page as the gyro sensor in the schematic...&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: TWIM driver issue with LSM6DS3TC-R</title><link>https://devzone.nordicsemi.com/thread/392023?ContentTypeID=1</link><pubDate>Mon, 24 Oct 2022 07:02:26 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:3abcae1a-8bfd-4ace-89c9-a8f11bf884ca</guid><dc:creator>Nguyen Hoan Hoang</dc:creator><description>&lt;p&gt;I2C requires pull-ups on both SDA &amp;amp; SCL. &amp;nbsp;The board does not have those resistors therefore you must enable it in the driver. &amp;nbsp;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: TWIM driver issue with LSM6DS3TC-R</title><link>https://devzone.nordicsemi.com/thread/391995?ContentTypeID=1</link><pubDate>Sun, 23 Oct 2022 18:20:07 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:b1a953ef-7996-4747-8b25-e23ea097b51e</guid><dc:creator>Susheel Nuguru</dc:creator><description>&lt;p&gt;I am not familiar with this sensor but looking at its data sheet it seems like it is possible to configure the sensor to control the pull of the SDA and SCK pins.&lt;/p&gt;
&lt;p&gt;&lt;img style="max-height:62px;max-width:550px;" alt=" " src="https://devzone.nordicsemi.com/resized-image/__size/1100x124/__key/communityserver-discussions-components-files/4/3480.pastedimage1666548668938v1.png" /&gt;&lt;/p&gt;
&lt;p&gt;There are three things&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;Pull configuration from the master side of the actual SDA/SCK pins that are connected to the sensor.&lt;/li&gt;
&lt;li&gt;Pull configuration from the sensor side of the actual SDA/SCK pins that are connected to the sensor.&lt;/li&gt;
&lt;li&gt;pull configuration of the fork pins you are using that are connected to the oscilloscope. Maybe at powerup the ppi/gpiote configuration you made to simulate a fork of the sda/sck pins have a bug?&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;I suspect that what you are seeing might be something else than what is going on the actual pins. I would recommend you to set the gpio state of the forked (SDA/SCK) pins to a known state at startup before connecting those fork pins to the PPI/GPIOTE combo. If you do that then we can atleast exclude point number 3.&amp;nbsp;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: TWIM driver issue with LSM6DS3TC-R</title><link>https://devzone.nordicsemi.com/thread/391988?ContentTypeID=1</link><pubDate>Sun, 23 Oct 2022 12:46:30 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:61bc7e2f-0cfe-46d2-9b2d-474b0112f757</guid><dc:creator>captainfips</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;I just added the config of the ppi peripheral to mirror the i2c lines to accessible pins on the breakout boards, which works as it should: Blue=SCK Red=SDA Green=Power of the LSM6DS3. The next image shows the lines when the sensor is working:&lt;/p&gt;
&lt;p&gt;&lt;img alt="Working I2C lines" height="191" src="https://devzone.nordicsemi.com/resized-image/__size/636x382/__key/communityserver-discussions-components-files/4/NewFile2.png" width="318" /&gt;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;Now if I just unpower and power the board back on, nothing happens on SCK and SDA lines :&lt;/p&gt;
&lt;p&gt;&lt;img style="max-height:240px;max-width:320px;" alt="Power on after TWI init" src="https://devzone.nordicsemi.com/resized-image/__size/640x480/__key/communityserver-discussions-components-files/4/NewFile3.png" /&gt;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;I even tried &amp;quot;power cycling&amp;quot; the gyro sensor by turning the 6D_PWR line in the schematic on and off like this:&lt;/p&gt;
&lt;p&gt;&lt;img style="max-height:240px;max-width:320px;" alt="Power cycling EN line" src="https://devzone.nordicsemi.com/resized-image/__size/640x480/__key/communityserver-discussions-components-files/4/NewFile5.png" /&gt;&lt;/p&gt;
&lt;p&gt;but the data and clock line remain low, as if the sensor would pull them low, even though it isn&amp;#39;t powered...&lt;br /&gt;&lt;br /&gt;&lt;/p&gt;
&lt;p&gt;Regards, Fabian&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: TWIM driver issue with LSM6DS3TC-R</title><link>https://devzone.nordicsemi.com/thread/391052?ContentTypeID=1</link><pubDate>Mon, 17 Oct 2022 17:49:33 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:bca9b704-6064-4a09-b619-1842fa1bc50c</guid><dc:creator>Susheel Nuguru</dc:creator><description>&lt;p&gt;yes, you cannot change the TWIM driver config but to use gpiote api&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: TWIM driver issue with LSM6DS3TC-R</title><link>https://devzone.nordicsemi.com/thread/390994?ContentTypeID=1</link><pubDate>Mon, 17 Oct 2022 12:29:05 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:ec8ae005-14c7-42f7-8f81-3f1d2397f971</guid><dc:creator>captainfips</dc:creator><description>&lt;p&gt;I will try that later, I don&amp;lsquo;t have time at the moment. For the GPIOTE in event config I have to use the RAW config macro to not change the pin config of the twim driver?&lt;/p&gt;
&lt;p&gt;- Fabian&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: TWIM driver issue with LSM6DS3TC-R</title><link>https://devzone.nordicsemi.com/thread/390961?ContentTypeID=1</link><pubDate>Mon, 17 Oct 2022 10:53:04 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:6fcff165-b17e-4777-91dc-6d8649f60da3</guid><dc:creator>Susheel Nuguru</dc:creator><description>&lt;p&gt;Fabian,&lt;/p&gt;
&lt;p&gt;You should e able to configure the GPIOTE in event mode and make it listen to the TWI pins to generate events. You can use these events to route it through PPI fork TEP to change another gpio pin to toggle the same way as the first input pin to GPIOTE.&amp;nbsp;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: TWIM driver issue with LSM6DS3TC-R</title><link>https://devzone.nordicsemi.com/thread/390441?ContentTypeID=1</link><pubDate>Wed, 12 Oct 2022 12:21:16 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:70f62677-58d2-4cf0-9fbd-9bd92ffe7f15</guid><dc:creator>captainfips</dc:creator><description>&lt;p&gt;Hi,&lt;br /&gt;&lt;br /&gt;yes, the problem definitely is that of the three TWIM events that are checked occurs. I already tried it without the no event handler flag, and also in debug vs release mode - no difference in behaviour. I even tried to check the ERRORSRC Register in the twim driver as well, but neither the ANACK nor the DNACK bit is set. Also Logging basically everything shows the same result.&lt;/p&gt;
&lt;p&gt;I am not using the TRACE lines - even checked the nrf.h file for the project in SES, but everything seems to be initialised (deactivated) correctly.&lt;/p&gt;
&lt;p&gt;The problem with oscilloscope data is, that the gyro sensor is not accessible on the xiao board. I thought of routing the gpios to other ones via PPI, to simply mirror the SCL and SDA lines to other pins that are accessible with the oscilloscope. Could that work or does the SDK/hardware not allow such functionality?&lt;/p&gt;
&lt;p&gt;Best regards!&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: TWIM driver issue with LSM6DS3TC-R</title><link>https://devzone.nordicsemi.com/thread/390436?ContentTypeID=1</link><pubDate>Wed, 12 Oct 2022 12:07:56 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:a74781bf-0104-42ca-a5ba-6a7cdfdc5241</guid><dc:creator>Susheel Nuguru</dc:creator><description>&lt;p&gt;It is a bit difficult to say what is wrong, but the loop in which it is stuck seems to say that the transfer was initiated and none of the events occurred in the hardware. Without oscilloscope data we can only guess few things.&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;If you suspect if it has something to do with&amp;nbsp;&lt;span&gt;NRFX_TWIM_FLAG_NO_XFER_EVT_HANDLER&amp;nbsp;enabled, then disable it and give the proper event handler just for testing.&lt;/span&gt;&lt;/li&gt;
&lt;li&gt;Try to debug this with logs/prints and not using&amp;nbsp;&lt;span&gt;TRACECLK if you suspect this could be issue. If the program behaves differently in debug mode and in normal mode, then it is likely that it has to do with shared pins with debug interface.&lt;/span&gt;&lt;span&gt;&lt;/span&gt;&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;&lt;span&gt;&lt;/span&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>