<?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>nrf52805 sample simple I2C</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/90072/nrf52805-sample-simple-i2c</link><description>Is there any simple sample application utilizing i2c communications for nrf52805? 
 In Visual Studio Code with installed nrf connect SDK 2.0.0 doesn&amp;#39;t show up any code sample. 
 Googling I came up with twi_scanner and a couple more of them, but I can</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Tue, 26 Jul 2022 14:12:19 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/90072/nrf52805-sample-simple-i2c" /><item><title>RE: nrf52805 sample simple I2C</title><link>https://devzone.nordicsemi.com/thread/378749?ContentTypeID=1</link><pubDate>Tue, 26 Jul 2022 14:12:19 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:2c768f38-242d-47e5-9fdb-093f4f349100</guid><dc:creator>Sigurd Hellesvik</dc:creator><description>&lt;p&gt;Hi&lt;/p&gt;
&lt;p&gt;We have documentation on &lt;a href="https://developer.nordicsemi.com/nRF_Connect_SDK/doc/latest/nrf/app_boards.html#custom-boards"&gt;Custom Boards&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;In addition, see this guide on &lt;a href="https://devzone.nordicsemi.com/guides/nrf-connect-sdk-guides/b/getting-started/posts/nrf-connect-sdk-tutorial---part-3-ncs-v1-4-0#h11sk6ks1jkp1figkuq6gxw1m1rctdp0"&gt;Using a custom board with nRF Connect SDK&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;Is this what you were looking for?&lt;/p&gt;
&lt;p&gt;Regards,&lt;br /&gt;Sigurd Hellesvik&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: nrf52805 sample simple I2C</title><link>https://devzone.nordicsemi.com/thread/378415?ContentTypeID=1</link><pubDate>Sun, 24 Jul 2022 07:37:37 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:2af34951-abfb-4367-ac3a-07f389767115</guid><dc:creator>nefen</dc:creator><description>&lt;p&gt;Hi Mr. Hellesvik,&lt;/p&gt;
&lt;p&gt;Is there any update guide for nrf Connect SDK for development on custom board with nrf52805?&lt;/p&gt;
&lt;p&gt;This&amp;nbsp;&amp;nbsp;&lt;a href="https://devzone.nordicsemi.com/f/nordic-q-a/75175/develop-for-custom-board-with-a-nrf52805-module"&gt;Develop for custom board with a nRF52805 module&lt;/a&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;is for nrf SDK 17.0.&lt;/p&gt;
&lt;p&gt;I found that, although I can program bluetooth (I managed with success to use it as a bouetooth beacon), I face difficulties with digital pins.&lt;/p&gt;
&lt;p&gt;I followed the examples in the tutorial, but I cannot read or write the digital pins (like P0.5, P0.20).&lt;/p&gt;
&lt;p&gt;I used as reference devicetree from nrf52DK_52805.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: nrf52805 sample simple I2C</title><link>https://devzone.nordicsemi.com/thread/378414?ContentTypeID=1</link><pubDate>Sun, 24 Jul 2022 05:40:51 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:388238f7-b0cd-4a06-94c3-fa5bfeb27ad7</guid><dc:creator>nefen</dc:creator><description>&lt;p&gt;Forget&amp;nbsp;the last message, I managed out from nrfx_error.h that this is an address NACK, i.e. the slave address is not acknowledged.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: nrf52805 sample simple I2C</title><link>https://devzone.nordicsemi.com/thread/378413?ContentTypeID=1</link><pubDate>Sun, 24 Jul 2022 05:35:41 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:9dd0b3c1-831c-462a-9ba9-406b0abbbb57</guid><dc:creator>nefen</dc:creator><description>&lt;p&gt;Just a question.&lt;/p&gt;
&lt;p&gt;I implemented logging and I saw the following error message:&lt;/p&gt;
&lt;p&gt;[00:00:05.004,547] &amp;lt;err&amp;gt; i2c_nrfx_twi: Error 0x0BAE0001 occurred for message 0&lt;/p&gt;
&lt;p&gt;How can I interpret this error?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: nrf52805 sample simple I2C</title><link>https://devzone.nordicsemi.com/thread/378264?ContentTypeID=1</link><pubDate>Fri, 22 Jul 2022 11:00:52 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:5d4ea7a6-30b7-4c70-b891-c268083f745c</guid><dc:creator>Sigurd Hellesvik</dc:creator><description>&lt;p&gt;Hi&lt;/p&gt;
&lt;p&gt;It is helpful to know if the nRF chip sends data or just tries.&lt;/p&gt;
&lt;p&gt;Try to connect a logic analyzer or oscilloscope to the I2C lines and see if you can detect signals when sending data&lt;/p&gt;
&lt;p&gt;Regards,&lt;br /&gt;Sigurd Hellesvik&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: nrf52805 sample simple I2C</title><link>https://devzone.nordicsemi.com/thread/378175?ContentTypeID=1</link><pubDate>Thu, 21 Jul 2022 16:39:48 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:5d5746e5-f49e-4c42-9b3c-465afca18a41</guid><dc:creator>nefen</dc:creator><description>&lt;p&gt;Dear Mr. Hellesvik,&lt;/p&gt;
&lt;p&gt;I followed your suggestion and studied the tutorial.&lt;/p&gt;
&lt;p&gt;Unfortunately, I can&amp;#39;t still communicate with ADS7142,&lt;/p&gt;
&lt;p&gt;In my board, SDA is on P0.16 and SCL on P0.12.&lt;/p&gt;
&lt;p&gt;I added in the overlay file the following:&lt;/p&gt;
&lt;div&gt;
&lt;div&gt;&lt;span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span&gt;&lt;pre class="ui-code" data-mode="text"&gt;&amp;amp;pinctrl {
	i2c0_default: i2c0_default {
		group1 {
			psels = &amp;lt;NRF_PSEL(TWIM_SDA, 0, 16)&amp;gt;,
				&amp;lt;NRF_PSEL(TWIM_SCL, 0, 12)&amp;gt;;
		};
	};

	i2c0_sleep: i2c0_sleep {
		group1 {
			psels = &amp;lt;NRF_PSEL(TWIM_SDA, 0, 16)&amp;gt;,
				&amp;lt;NRF_PSEL(TWIM_SCL, 0, 12)&amp;gt;;
			low-power-enable;
		};
	};

	spi0_default: spi0_default {
		group1 {
			psels = &amp;lt;NRF_PSEL(SPIM_SCK, 0, 29)&amp;gt;,
				&amp;lt;NRF_PSEL(SPIM_MOSI, 0, 31)&amp;gt;,
				&amp;lt;NRF_PSEL(SPIM_MISO, 0, 30)&amp;gt;;
		};
	};
};
&amp;amp;i2c0 {
    pinctrl-0 = &amp;lt;&amp;amp;i2c0_default&amp;gt;;
    pinctrl-1 = &amp;lt;&amp;amp;i2c0_sleep&amp;gt;;
    pinctrl-names = &amp;quot;default&amp;quot;, &amp;quot;sleep&amp;quot;;
    ads7142: ads7142@18{
        status = &amp;quot;okay&amp;quot;;
        compatible = &amp;quot;i2c-device&amp;quot;;
        reg = &amp;lt; 0x18 &amp;gt;;
        label = &amp;quot;ADS7142&amp;quot;;
    };
 };&lt;/pre&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span&gt;Then I followed the tutorial and have the following in the main.c:&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span&gt;&lt;pre class="ui-code" data-mode="text"&gt;#define ADS7142_CHANNEL_CFG 0x24
#define ADS7142_OPMODE_CFG 0x1C

#define ADS7142_NODE DT_NODELABEL(ads7142)
...
void main(void){
    static  struct i2c_dt_spec dev_i2c = I2C_DT_SPEC_GET(ADS7142_NODE);
    uint8_t i2c_write_reg2[3]={0b00001000,ADS7142_CHANNEL_CFG,0x00};
    ...
    if (!device_is_ready(dev_i2c.bus)) {
		printk(&amp;quot;I2C bus %s is not ready!\n\r&amp;quot;,dev_i2c.bus-&amp;gt;name);
		return;
	}
	...
	ret =i2c_write_dt(&amp;amp;dev_i2c,i2c_write_reg2, sizeof(i2c_write_reg2));
	...
	
	}
&lt;/pre&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span&gt;Off course I had enabled I2C in prj.conf, but I cannot manage to communicate properly.&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span&gt;TI manual for ADS7142 specifies the following sequence of bytes to write to a register:&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span&gt;&lt;img style="max-height:240px;max-width:320px;" src="https://devzone.nordicsemi.com/resized-image/__size/640x480/__key/communityserver-discussions-components-files/4/pastedimage1658421524409v1.png" alt=" " /&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span&gt;I supposed that the first byte is automatically generated by the i2c_write_dt, but I had also tried to send all 4 bytes, again with no success.&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span&gt;&amp;nbsp;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span&gt;Any idea?&lt;/span&gt;&lt;/div&gt;
&lt;/div&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: nrf52805 sample simple I2C</title><link>https://devzone.nordicsemi.com/thread/377388?ContentTypeID=1</link><pubDate>Mon, 18 Jul 2022 11:08:40 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:286f021a-ce8a-456c-bbf9-0657743e3c7d</guid><dc:creator>Sigurd Hellesvik</dc:creator><description>&lt;p&gt;Hi&lt;/p&gt;
&lt;p&gt;We actually have two different SDK-s, one new and one old. See the &lt;a href="https://devzone.nordicsemi.com/nordic/nordic-blog/b/blog/posts/nrf-connect-sdk-and-nrf5-sdk-statement"&gt; nRF Connect SDK and nRF5 SDK statement&lt;/a&gt; for more information on this.&lt;/p&gt;
&lt;p&gt;For nRF Connect SDK, I recommend that you have a look at &lt;a href="https://academy.nordicsemi.com/"&gt;https://academy.nordicsemi.com/&lt;/a&gt;, where we have tutorials on getting started and some protocols, such as I2C.&lt;/p&gt;
&lt;p&gt;Regards,&lt;br /&gt;Sigurd Hellesvik&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>