<?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>How do I program the nrf9160 to communicate with a peripheral using SPI, I2C, other serial protocol, etc?</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/42091/how-do-i-program-the-nrf9160-to-communicate-with-a-peripheral-using-spi-i2c-other-serial-protocol-etc</link><description>Are there example scripts to take readings or communicate with other devices over serial? Like, if I attach a temperature sensor, distance sensor, etc, I want to read from it and then communicate the reading up using LTE network. Ideally I wouldn&amp;#39;t have</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Wed, 27 Mar 2019 12:47:05 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/42091/how-do-i-program-the-nrf9160-to-communicate-with-a-peripheral-using-spi-i2c-other-serial-protocol-etc" /><item><title>RE: How do I program the nrf9160 to communicate with a peripheral using SPI, I2C, other serial protocol, etc?</title><link>https://devzone.nordicsemi.com/thread/178667?ContentTypeID=1</link><pubDate>Wed, 27 Mar 2019 12:47:05 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:51a7ba66-d988-46ac-88d3-4ce354332444</guid><dc:creator>Yusuke</dc:creator><description>&lt;p&gt;Hi, Martin.&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;I have been trying to use I2C in nRF9160 DK but it doesn&amp;#39;t work. Could you help me?&lt;/p&gt;
&lt;p&gt;my post is here.&lt;/p&gt;
&lt;p&gt;&lt;a href="https://devzone.nordicsemi.com/f/nordic-q-a/45265/trouble-twi-i2c-stops-at-the-function-of-i2c_reg_read_byte-on-nrf9160-dk-why"&gt;https://devzone.nordicsemi.com/f/nordic-q-a/45265/trouble-twi-i2c-stops-at-the-function-of-i2c_reg_read_byte-on-nrf9160-dk-why&lt;/a&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: How do I program the nrf9160 to communicate with a peripheral using SPI, I2C, other serial protocol, etc?</title><link>https://devzone.nordicsemi.com/thread/164005?ContentTypeID=1</link><pubDate>Fri, 04 Jan 2019 15:16:19 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:dba44a05-5346-4f07-b736-d38ee73e43bc</guid><dc:creator>Martin Lesund</dc:creator><description>&lt;p&gt;Hi Duser,&lt;/p&gt;
&lt;p&gt;If you want to add a peripheral to use with your nrf91DK:&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;em&gt;One option is to:&lt;/em&gt;&lt;/p&gt;
&lt;p&gt;You add an&amp;nbsp;&lt;strong&gt;.overlay&amp;nbsp;&lt;/strong&gt;file in the application folder (&lt;em&gt;where the applications CMakeLists.txt is located&lt;/em&gt;)&lt;em&gt;&lt;/em&gt;. And when using the&amp;nbsp;nrf91DK you call this file &amp;quot;&lt;strong&gt;nrf9160_pca10090&lt;/strong&gt;.overlay&amp;quot;.&lt;/p&gt;
&lt;p&gt;In this file you add what pins you would like to use for the peripherals.&lt;/p&gt;
&lt;p&gt;ex.&amp;nbsp;&lt;em&gt;to activate TWI&lt;/em&gt;&lt;/p&gt;
&lt;p&gt;&lt;em&gt;- add this to the .overlay file&lt;/em&gt;&lt;/p&gt;
&lt;p&gt;&lt;em&gt;&lt;pre class="ui-code" data-mode="c_cpp"&gt;&amp;amp;i2c2 {
	status = &amp;quot;ok&amp;quot;;
	sda-pin = &amp;lt;11&amp;gt;;
	scl-pin = &amp;lt;12&amp;gt;;
	clock-frequency = &amp;lt;I2C_BITRATE_STANDARD&amp;gt;; 
};&lt;/pre&gt;&lt;/em&gt;&lt;/p&gt;
&lt;p&gt;&lt;em&gt;- Activate the TWI in the prj.conf file (same as ninja menuconfig or the settings in SES)&lt;/em&gt;&lt;/p&gt;
&lt;p&gt;&lt;em&gt;&lt;pre class="ui-code" data-mode="c_cpp"&gt;# Enable I2C
CONFIG_I2C=y
CONFIG_I2C_NRFX=y
CONFIG_I2C_2=y
CONFIG_I2C_2_NRF_TWIM=y&lt;/pre&gt;&lt;/em&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: How do I program the nrf9160 to communicate with a peripheral using SPI, I2C, other serial protocol, etc?</title><link>https://devzone.nordicsemi.com/thread/163635?ContentTypeID=1</link><pubDate>Thu, 03 Jan 2019 05:40:43 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:e75de940-5bbd-455a-92b5-692c74aaae15</guid><dc:creator>duser</dc:creator><description>&lt;p&gt;Looks like someone is trying to bring in an external sensor here but this looks pretty deep (I.e. not at API level). Still, anybody know about this &lt;a href="https://devzone.nordicsemi.com/members/joakim_5f00_tosteberg"&gt;joakim_tosteberg&lt;/a&gt; ?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>