<?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>Pull down SDA pin i2c</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/93581/pull-down-sda-pin-i2c</link><description>Good day 
 I am developing on the nrf9160dk with a tag reader using i2c and am wanting to know if there is a function to pull down the SDA or SCL pins during operation in order to wake up the slave device. 
 
 Thank you in advance. 
 Kind regards, 
 </description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Thu, 10 Nov 2022 09:45:18 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/93581/pull-down-sda-pin-i2c" /><item><title>RE: Pull down SDA pin i2c</title><link>https://devzone.nordicsemi.com/thread/395061?ContentTypeID=1</link><pubDate>Thu, 10 Nov 2022 09:45:18 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:a1c6034d-e251-4e6b-be73-f300f9ab1501</guid><dc:creator>Vidar Berg</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;Can you turn on logging to see what the error is?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Pull down SDA pin i2c</title><link>https://devzone.nordicsemi.com/thread/394943?ContentTypeID=1</link><pubDate>Wed, 09 Nov 2022 14:18:34 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:3425263e-4d57-4813-8c59-2709f0c05fd7</guid><dc:creator>Hkhan7861</dc:creator><description>&lt;p&gt;HI&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;This has helped!&amp;nbsp; Am now seeing an output when the program starts as well as the drop of output on the SDA line when writing to the i2c2 .&amp;nbsp; However, the write function still returning an error value.&amp;nbsp; Other than the slave address or device function code being incorrect, are there any other reasons for the function to fail?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Pull down SDA pin i2c</title><link>https://devzone.nordicsemi.com/thread/394868?ContentTypeID=1</link><pubDate>Wed, 09 Nov 2022 10:05:41 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:b659adcd-3555-46d7-8502-97074e719f32</guid><dc:creator>Vidar Berg</dc:creator><description>&lt;p&gt;It seems like you don&amp;#39;t have external pull-ups on the SDA and SCL lines as you measure 0 V on both . In that case, you will need to enable the internal pull-up resistors by adding the&amp;nbsp;&lt;a href="https://developer.nordicsemi.com/nRF_Connect_SDK/doc/latest/zephyr/build/dts/api/bindings/pinctrl/nordic,nrf-pinctrl.html"&gt;bias-pull-up&lt;/a&gt; property to your pin assignment in the device tree.&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="c_cpp"&gt; &amp;amp;pinctrl {
	i2c2_default: i2c2_default {
		group1 {
			psels = &amp;lt;NRF_PSEL(TWIM_SDA, 0, 30)&amp;gt;,
				&amp;lt;NRF_PSEL(TWIM_SCL, 0, 31)&amp;gt;;
				bias-pull-up;
		};
	};

	i2c2_sleep: i2c2_sleep {
		group1 {
			psels = &amp;lt;NRF_PSEL(TWIM_SDA, 0, 30)&amp;gt;,
				&amp;lt;NRF_PSEL(TWIM_SCL, 0, 31)&amp;gt;;
			low-power-enable;
		};
	};

};&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Pull down SDA pin i2c</title><link>https://devzone.nordicsemi.com/thread/394852?ContentTypeID=1</link><pubDate>Wed, 09 Nov 2022 09:19:55 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:e31da882-21db-4c0c-979c-1ed2c8c4e83c</guid><dc:creator>Hkhan7861</dc:creator><description>&lt;p&gt;My code is as follows:&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="text"&gt;main.c

#include 	&amp;lt;zephyr/zephyr.h&amp;gt;
#include 	&amp;lt;drivers/i2c.h&amp;gt;
#include	&amp;lt;stdio.h&amp;gt;
#include 	&amp;lt;nrfx_twim.h&amp;gt;
#include 	&amp;lt;C:\nordicsemi\v2.1.1\modules\hal\nordic\nrfx\hal\nrf_gpio.h&amp;gt;
#include 	&amp;lt;hal/nrf_twim.h&amp;gt;





/** I2C address to be used for ST25DV Data accesses. */
#define ST25DV_ADDR_DATA_I2C                 0x53
/** I2C address to be used for ST25DV System accesses. */
#define ST25DV_ADDR_SYST_I2C                 0x57


void Delay(int n)
{
   int c, d;
   
   for (c = 1; c &amp;lt;= n; c++)
       for (d = 1; d &amp;lt;= n; d++)
       {}
       
   return 0;
}



void main(void)
{   
	// *************START************* //  
	

  const struct device * i2c_dev;
   i2c_dev = DEVICE_DT_GET(DT_NODELABEL(i2c2));
  if (i2c_dev == NULL) {
		printk(&amp;quot;Unable to bind !\n&amp;quot;);
		return;
	 }

	 //************** DEVICE SELECT CODE**************//

	const uint8_t devSelCode[8] = {1, 0, 1, 0, 0, 1, 1, 0};
	 
	int err1 = i2c_write(i2c_dev,devSelCode,8,ST25DV_ADDR_DATA_I2C);
	printk(&amp;quot;Device select msg: %d&amp;quot;, err1);

     
	 
	
}



prj


CONFIG_STDOUT_CONSOLE=y
CONFIG_PRINTK=y

CONFIG_I2C=y

# CONFIG_LOG=y&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;Is there possibly something wrong in my configuration that I am not seeing an output in my specified i2c2 pins?&amp;nbsp; Thank you for your help!&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Pull down SDA pin i2c</title><link>https://devzone.nordicsemi.com/thread/394844?ContentTypeID=1</link><pubDate>Wed, 09 Nov 2022 08:44:38 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:3f837c0c-7b5f-4d34-a80c-440ade7b24f5</guid><dc:creator>Hkhan7861</dc:creator><description>&lt;p&gt;Good day,&lt;/p&gt;
&lt;p&gt;I&amp;#39;ve attempted using these functions and APIs and when I test the board with the multimeter, pin 30 and 31 (my i2c2 pins) get zero voltage output.&amp;nbsp; Do the pins start the output in the prj file or when a write/read sequence is initiated?&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;Kind regards,&lt;/p&gt;
&lt;p&gt;Hassan&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Pull down SDA pin i2c</title><link>https://devzone.nordicsemi.com/thread/394755?ContentTypeID=1</link><pubDate>Tue, 08 Nov 2022 14:56:21 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:14de4fc5-69ff-481f-8fd6-ce2029716cf0</guid><dc:creator>Vidar Berg</dc:creator><description>&lt;p&gt;Yes, this is our function to start a TWI transfer. However, in general, we recommend to use the Zephyr&amp;#39;s driver APIs when possible (&lt;a href="https://developer.nordicsemi.com/nRF_Connect_SDK/doc/latest/zephyr/hardware/peripherals/i2c.html"&gt;https://developer.nordicsemi.com/nRF_Connect_SDK/doc/latest/zephyr/hardware/peripherals/i2c.html&lt;/a&gt;). You can have a look at the i2c_fujitsu_fram driver sample in the Zephyr tree for an example of how this API can be used.&lt;/p&gt;
&lt;p&gt;Kind regards,&lt;/p&gt;
&lt;p&gt;Vidar&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Pull down SDA pin i2c</title><link>https://devzone.nordicsemi.com/thread/394750?ContentTypeID=1</link><pubDate>Tue, 08 Nov 2022 14:42:36 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:67ee3910-82f2-43cf-81ae-795b16c79f35</guid><dc:creator>Hkhan7861</dc:creator><description>&lt;p&gt;Good afternoon&lt;/p&gt;
&lt;p&gt;By driver API&amp;#39;s, do you mean this function.&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;div&gt;
&lt;div&gt;&lt;/div&gt;
&lt;div&gt;&lt;span&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;&lt;/span&gt;&lt;span&gt;struct&lt;/span&gt;&lt;span&gt; &lt;/span&gt;&lt;span&gt;i2c_msg&lt;/span&gt;&lt;span&gt; *&lt;/span&gt;&lt;span&gt;DevFnc&lt;/span&gt;&lt;span&gt; ;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;&lt;/span&gt;&lt;span&gt;DevFnc&lt;/span&gt;&lt;span&gt;-&amp;gt;&lt;/span&gt;&lt;span&gt;buf&lt;/span&gt;&lt;span&gt; = &amp;amp;&lt;/span&gt;&lt;span&gt;devSelCode&lt;/span&gt;&lt;span&gt;;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;&lt;/span&gt;&lt;span&gt;DevFnc&lt;/span&gt;&lt;span&gt;-&amp;gt;&lt;/span&gt;&lt;span&gt;len&lt;/span&gt;&lt;span&gt; = &lt;/span&gt;&lt;span&gt;8&lt;/span&gt;&lt;span&gt;;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;&lt;/span&gt;&lt;span&gt;DevFnc&lt;/span&gt;&lt;span&gt;-&amp;gt;&lt;/span&gt;&lt;span&gt;flags&lt;/span&gt;&lt;span&gt; = &lt;/span&gt;&lt;span&gt;1&lt;/span&gt;&lt;span&gt;;&lt;/span&gt;&lt;/div&gt;
&lt;br /&gt;
&lt;div&gt;&lt;span&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;&lt;/span&gt;&lt;span&gt;i2c_nrfx_twim_transfer&lt;/span&gt;&lt;span&gt;(&lt;/span&gt;&lt;span&gt;i2c_dev&lt;/span&gt;&lt;span&gt;,&lt;/span&gt;&lt;span&gt;DevFnc&lt;/span&gt;&lt;span&gt;,&lt;/span&gt;&lt;span&gt;1&lt;/span&gt;&lt;span&gt;, &lt;/span&gt;&lt;span&gt;0x53&lt;/span&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;If so, are there any samples where I can see the use of this.&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span&gt;Kind regards,&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span&gt;Hassan&lt;/span&gt;&lt;/div&gt;
&lt;/div&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Pull down SDA pin i2c</title><link>https://devzone.nordicsemi.com/thread/394623?ContentTypeID=1</link><pubDate>Tue, 08 Nov 2022 09:49:50 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:f56124b3-f66e-4a17-ae6d-55787623b8a7</guid><dc:creator>Vidar Berg</dc:creator><description>&lt;p&gt;The TWIM peripheral must be configured to transmit data before you can trigger the start task. It is easier to just use the driver APIs to start a transaction as it will take care of the configurations for you.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Pull down SDA pin i2c</title><link>https://devzone.nordicsemi.com/thread/394584?ContentTypeID=1</link><pubDate>Tue, 08 Nov 2022 07:48:18 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:9ecd59d0-3b18-477c-8e54-7f2df213028d</guid><dc:creator>Hkhan7861</dc:creator><description>&lt;p&gt;Oh I see okay thank you ! so would I just need to use&amp;nbsp;&lt;/p&gt;
&lt;div&gt;
&lt;div&gt;&lt;span&gt;nrf_twim_task_trigger&lt;/span&gt;&lt;span&gt;(p_twim, NRF_TWIM_TASK_STARTTX) and the startup condition&amp;nbsp;will be handled?&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span&gt;Thank you .&lt;/span&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;div&gt;
&lt;div&gt;&lt;span&gt;&amp;nbsp;&lt;/span&gt;&lt;/div&gt;
&lt;/div&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Pull down SDA pin i2c</title><link>https://devzone.nordicsemi.com/thread/394449?ContentTypeID=1</link><pubDate>Mon, 07 Nov 2022 13:51:04 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:dffd6075-90b2-46bb-8e02-4bbe4db81f1c</guid><dc:creator>Vidar Berg</dc:creator><description>[quote userid="120623" url="~/f/nordic-q-a/93581/pull-down-sda-pin-i2c/394403"]I am still not able to find this function.&amp;nbsp; I am not sure you understand my question.&amp;nbsp; Please refer me to where the start condition is handled.[/quote]
&lt;p&gt;There is no function for this because it is handled in HW.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Pull down SDA pin i2c</title><link>https://devzone.nordicsemi.com/thread/394403?ContentTypeID=1</link><pubDate>Mon, 07 Nov 2022 12:21:45 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:be192ed8-53b4-4102-a2c6-284ea2f20eb9</guid><dc:creator>Hkhan7861</dc:creator><description>&lt;p&gt;I will post a picture at a later stage thank you.&amp;nbsp; I am still not able to find this function.&amp;nbsp; I am not sure you understand my question.&amp;nbsp; Please refer me to where the start condition is handled.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Pull down SDA pin i2c</title><link>https://devzone.nordicsemi.com/thread/394389?ContentTypeID=1</link><pubDate>Mon, 07 Nov 2022 11:42:57 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:636b32f8-03fd-43fb-874c-10d12378af7f</guid><dc:creator>Vidar Berg</dc:creator><description>&lt;p&gt;The transaction is handled in HW, and not in SW.&amp;nbsp; Please see the &amp;quot;&lt;span class="item"&gt;&lt;a class="" title="Master write sequence" href="https://infocenter.nordicsemi.com/topic/ps_nrf9160/twim.html?cp=2_0_0_5_16_2#concept_bg4_swp_xr"&gt;Master write sequence&lt;/a&gt;&amp;quot; section of the TWIM chapter for more details on how this works.&lt;/span&gt;&lt;/p&gt;
[quote userid="120623" url="~/f/nordic-q-a/93581/pull-down-sda-pin-i2c/394382"]Yes, I have used instruments to test and have found that by using an internal pull-up resister, the pin signal level doesnt drop enough.[/quote]
&lt;p&gt;&lt;span class="item"&gt;.&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;Can you post a picture of this?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Pull down SDA pin i2c</title><link>https://devzone.nordicsemi.com/thread/394382?ContentTypeID=1</link><pubDate>Mon, 07 Nov 2022 11:15:27 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:a7924df4-4329-4d5d-8ed4-029ed66ddcf7</guid><dc:creator>Hkhan7861</dc:creator><description>&lt;p&gt;HI, do you mind sending the name or a link to that function so I may see how it works.&amp;nbsp; I can&amp;#39;t seem to find it&lt;/p&gt;
&lt;p&gt;Yes, I have used instruments to test and have found that by using an internal pull-up resister, the pin signal level doesnt drop enough.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Pull down SDA pin i2c</title><link>https://devzone.nordicsemi.com/thread/394380?ContentTypeID=1</link><pubDate>Mon, 07 Nov 2022 11:06:09 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:79549fee-b21f-4303-accf-0bb88545e8e4</guid><dc:creator>Vidar Berg</dc:creator><description>&lt;p&gt;OK, this is the standard way to start a transaction with i2c. Our TWIM peripheral will also create the start condition when you start a new transfer.&lt;/p&gt;
&lt;p&gt;Have you tried to probe the SDA and SCL line with a logic analyzer to see what the problem is?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Pull down SDA pin i2c</title><link>https://devzone.nordicsemi.com/thread/394375?ContentTypeID=1</link><pubDate>Mon, 07 Nov 2022 10:50:21 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:d0b7ebdd-e2b5-432c-b5ba-4a82b2f81156</guid><dc:creator>Hkhan7861</dc:creator><description>&lt;p&gt;Hi, thank you for the reply. This is the extent of what the documentation states.&amp;nbsp; Thank you !&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;6.1.1 Start condition Start is identified by a falling edge of serial data (SDA) while the serial clock (SCL) is stable in the high state. A Start condition must precede any data transfer command. The device continuously monitors (except during a write cycle) the SDA and the SCL for a Start condition, and does not respond unless one is given.&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;&lt;a href="https://www.st.com/resource/en/datasheet/st25dv04k.pdf"&gt;www.st.com/.../st25dv04k.pdf&lt;/a&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Pull down SDA pin i2c</title><link>https://devzone.nordicsemi.com/thread/394372?ContentTypeID=1</link><pubDate>Mon, 07 Nov 2022 10:39:25 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:e254beca-192c-4f23-93ed-e9eaedc8d04d</guid><dc:creator>Vidar Berg</dc:creator><description>&lt;p&gt;Hello,&lt;/p&gt;
&lt;p&gt;Sorry, I&amp;#39;m not sure if I understand the question correctly. The timing of when the SDA&amp;nbsp; and SCL line are pulled low during transactions is defined by the i2c standard and handled by the HW in our TWIM peripheral (Ref.&amp;nbsp;&lt;span&gt;&lt;a title="Two Wire Interface Master (TWIM) timing specifications" href="https://infocenter.nordicsemi.com/topic/ps_nrf9160/twim.html?cp=2_0_0_5_16_8_1#unique_628826396"&gt;Two Wire Interface Master (TWIM) timing specifications&lt;/a&gt;).&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;Do you mean that your i2c slave device requires a non-standard wake-up sequence? If so, maybe you could provide me a link to the documentation where this sequence is described?&lt;/p&gt;
&lt;p&gt;Best regards,&lt;/p&gt;
&lt;p&gt;Vidar&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>