<?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>Can nRF52 SDK TWI master write a series of registers</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/22974/can-nrf52-sdk-twi-master-write-a-series-of-registers</link><description>I want to save precious CPU cycles by writing 40 i2c (TWI) registers in one shot. Can I somehow set up the TWI master to write 40 registers (each 16-byte address with 8-bit data)? 
 Further, can this be done for two slave devices with two different slave</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Thu, 22 Jun 2017 10:18:32 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/22974/can-nrf52-sdk-twi-master-write-a-series-of-registers" /><item><title>RE: Can nRF52 SDK TWI master write a series of registers</title><link>https://devzone.nordicsemi.com/thread/90393?ContentTypeID=1</link><pubDate>Thu, 22 Jun 2017 10:18:32 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:4fc94d5d-0a85-4765-ab51-e6634f29969b</guid><dc:creator>J&amp;#248;rgen Holmefjord</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;&lt;a href="https://infocenter.nordicsemi.com/topic/com.nordic.infocenter.sdk5.v13.0.0/group__nrf__drv__twi.html?cp=4_0_0_6_8_24_3_28#ga2c5ea8408254dfa9cbff55dbee171a95"&gt;&lt;code&gt;nrf_drv_twi_tx&lt;/code&gt;&lt;/a&gt; take a pointer to the data, &lt;em&gt;p_data&lt;/em&gt;, and a &lt;em&gt;length&lt;/em&gt; parameter indicating the lenght of the data. The transfer function support a length up to 256 bytes. The code snippet in the &lt;a href="https://infocenter.nordicsemi.com/topic/com.nordic.infocenter.sdk5.v13.0.0/hardware_driver_twi.html?cp=4_0_0_2_16_1#hardware_driver_twi_basic"&gt;TWI master documentation&lt;/a&gt; shows how this is done. It is also possible to trigger a transfer directly from RAM using &lt;a href="https://infocenter.nordicsemi.com/topic/com.nordic.infocenter.sdk5.v13.0.0/hardware_driver_twi.html?cp=4_0_0_2_16_2_0#hardware_driver_twi_ppi"&gt;EasyDMA and PPI&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;It is not possible to transfer to multiple devices connected to the same bus simultaneously, but you can initialize &lt;a href="http://infocenter.nordicsemi.com/topic/com.nordic.infocenter.nrf52832.ps.v1.1/twim.html?cp=2_1_0_32_7#unique_1822381857"&gt;both TWI instances&lt;/a&gt; available on the nRF52832, and start one transfer on each instance.&lt;/p&gt;
&lt;p&gt;You will have to check the datasheet of the device you are interfacing, if it support this method of writing.&lt;/p&gt;
&lt;p&gt;Best regards,&lt;/p&gt;
&lt;p&gt;Jørgen&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>