<?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. Write to registers that are not consecutive</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/58521/twi-write-to-registers-that-are-not-consecutive</link><description>Hello everyone. I&amp;#39;m creating a setup function to configure LSM9DS1 accelerometer and gyroscope by writing to the corresponding registers as shown below 
 
 Although this code works, I was wondering if there is a better way to do this by using the TXTX</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Mon, 02 Mar 2020 17:02:19 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/58521/twi-write-to-registers-that-are-not-consecutive" /><item><title>RE: TWI. Write to registers that are not consecutive</title><link>https://devzone.nordicsemi.com/thread/237539?ContentTypeID=1</link><pubDate>Mon, 02 Mar 2020 17:02:19 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:b44b3bb8-e638-4aa5-a840-f99bf656663e</guid><dc:creator>J&amp;#248;rgen Holmefjord</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;You can use the&amp;nbsp;&lt;span&gt;TXTX&amp;nbsp;macro to setup two consecutive transfers. If you want to do more transfers than this, you could use the &lt;a href="https://infocenter.nordicsemi.com/topic/sdk_nrf5_v16.0.0/hardware_driver_twi.html?cp=7_1_2_0_17_2_1#hardware_driver_twi_repeated"&gt;advanced driver features&lt;/a&gt;, as described in the driver documentation, given that you switch to using the TWIM peripheral/driver. However, if this is a configuration sequence that is not timing-critical and the main point is to remove the for-loop, I think this will only overcomplicate your application. You will need to use PPI to trigger the transfers and a timer in count mode to stop the transfers when they are completed.&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;Best regards,&lt;br /&gt;Jørgen&lt;/span&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>