<?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>TIWM and GPIO input</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/54898/tiwm-and-gpio-input</link><description>I&amp;#39;m developing an interface I2C to one sensor including SCL, SDA and open-drain return to know if 
 the sensor is ready to work. After Reset by &amp;quot;Build and Run&amp;quot; form Segger (SDK 16) the TWIM works 
 very well. But after any read form GPIO input (state</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Fri, 29 Nov 2019 11:41:44 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/54898/tiwm-and-gpio-input" /><item><title>RE: TIWM and GPIO input</title><link>https://devzone.nordicsemi.com/thread/222778?ContentTypeID=1</link><pubDate>Fri, 29 Nov 2019 11:41:44 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:bc3a827a-1971-461f-9732-16bb249bba13</guid><dc:creator>&amp;#216;yvind</dc:creator><description>&lt;p&gt;I&amp;#39;m sorry, I am not able to run it. Can you add your main file/project?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: TIWM and GPIO input</title><link>https://devzone.nordicsemi.com/thread/222758?ContentTypeID=1</link><pubDate>Fri, 29 Nov 2019 10:38:36 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:d5967c51-8ced-4dd1-9f3b-7ce7096a556f</guid><dc:creator>lelisele</dc:creator><description>&lt;p&gt;Thanks for your help.&lt;/p&gt;
&lt;p&gt;#define ECG_INTB NRF_GPIO_PIN_MAP(0,19)&lt;br /&gt;#define I2C_SDA2 NRF_GPIO_PIN_MAP(0,21)&lt;/p&gt;
&lt;p&gt;#define GYRO_SCLK2_I2C_SCL1&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;20&lt;/p&gt;
&lt;p&gt;#define &lt;strong&gt;I2C_SCL2&lt;/strong&gt; NRF_GPIO_PIN_MAP(0,23)&lt;/p&gt;
&lt;p&gt;nrf_gpio_cfg(&lt;strong&gt;GYRO_SCLK2_I2C_SCL1&lt;/strong&gt;,NRF_GPIO_PIN_DIR_OUTPUT,NRF_GPIO_PIN_INPUT_CONNECT,&lt;/p&gt;
&lt;p&gt;NRF_GPIO_PIN_PULLUP,NRF_GPIO_PIN_H0H1,NRF_GPIO_PIN_NOSENSE);&lt;/p&gt;
&lt;p&gt;nrf_gpio_cfg(&lt;strong&gt;I2C_SDA2&lt;/strong&gt;,NRF_GPIO_PIN_DIR_INPUT,NRF_GPIO_PIN_INPUT_CONNECT,&lt;br /&gt;NRF_GPIO_PIN_PULLUP,NRF_GPIO_PIN_S0S1,NRF_GPIO_PIN_NOSENSE);&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;State pin:&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;nrf_gpio_cfg_input (&lt;strong&gt;ECG_INTB&lt;/strong&gt;,NRF_GPIO_PIN_PULLUP);&amp;nbsp;&lt;/p&gt;
&lt;p&gt;The pin&amp;nbsp;&lt;span&gt;GYRO_SCLK2_I2C_SCL1&amp;nbsp; is connected also with pins I2C_SCL2 but this one is out of service and never worked (perhaps missing soldering) that is way I&amp;#39;m using&amp;nbsp;&lt;strong&gt;GYRO_SCLK2_I2C_SCL1 &lt;/strong&gt;as clock&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;for TWIM1.&amp;nbsp; The&amp;nbsp;&lt;strong&gt;GYRO_SCLK2_I2C_SCL1 &lt;/strong&gt;is shared with SPI2 for&amp;nbsp; another interface. TWIM1 and SPI2 works well together up to first ECG_INTB lecture as state. I&amp;#39;ve tried different configuration for not working&lt;/p&gt;
&lt;p&gt;&lt;span&gt;2C_SCL2 without any success.&amp;nbsp;&lt;/span&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: TIWM and GPIO input</title><link>https://devzone.nordicsemi.com/thread/222747?ContentTypeID=1</link><pubDate>Fri, 29 Nov 2019 10:06:55 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:8f0c4329-daf6-46e2-baa3-9952dc6c41c9</guid><dc:creator>&amp;#216;yvind</dc:creator><description>&lt;p&gt;Please add all defines as well, as e.g. I2C_SDA2, etc are not in nRF SDK.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: TIWM and GPIO input</title><link>https://devzone.nordicsemi.com/thread/222575?ContentTypeID=1</link><pubDate>Thu, 28 Nov 2019 10:15:05 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:0f7f3ffa-f17f-4a3f-a91f-553e9572d5eb</guid><dc:creator>lelisele</dc:creator><description>&lt;p&gt;Hi, Thanks for your help.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;I2C pins:&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;nrf_gpio_cfg(GYRO_SCLK2_I2C_SCL1,NRF_GPIO_PIN_DIR_OUTPUT,NRF_GPIO_PIN_INPUT_CONNECT,&lt;br /&gt; NRF_GPIO_PIN_PULLUP,NRF_GPIO_PIN_H0H1,NRF_GPIO_PIN_NOSENSE);&lt;/p&gt;
&lt;p&gt;nrf_gpio_cfg(I2C_SDA2,NRF_GPIO_PIN_DIR_INPUT,NRF_GPIO_PIN_INPUT_CONNECT,&lt;br /&gt; NRF_GPIO_PIN_PULLUP,NRF_GPIO_PIN_S0S1,NRF_GPIO_PIN_NOSENSE);&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;State pin:&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;nrf_gpio_cfg_input (ECG_INTB,NRF_GPIO_PIN_PULLUP);&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;I2C initiation:&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;//Pin definition&lt;br /&gt; NRF_TWIM1-&amp;gt;PSEL.SCL = GYRO_SCLK2_I2C_SCL1;&lt;br /&gt; NRF_TWIM1-&amp;gt;PSEL.SDA = I2C_SDA2;&lt;br /&gt; // TWIM initialisation&lt;br /&gt; NRF_TWIM1-&amp;gt;ADDRESS = 94;&lt;br /&gt; NRF_TWIM1-&amp;gt;FREQUENCY = TWIM_FREQUENCY_FREQUENCY_K100 &amp;lt;&amp;lt; TWIM_FREQUENCY_FREQUENCY_Pos;&lt;br /&gt; NRF_TWIM1-&amp;gt;SHORTS = 0;&lt;br /&gt; //TWIN enable&lt;br /&gt; NRF_TWIM1-&amp;gt;ENABLE =TWIM_ENABLE_ENABLE_Enabled &amp;lt;&amp;lt; TWIM_ENABLE_ENABLE_Pos; // enable&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;State pin lecture:&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;ret = nrf_gpio_pin_input_get (ECG_INTB); //read IntB&lt;/p&gt;
&lt;p&gt;I&lt;strong&gt;2C data:&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;static uint8_t LastAddressRead;&lt;br /&gt;static uint8_t tx_buf[2]; /**&amp;lt; TX buffer. */&lt;br /&gt;static uint8_t tx_for_rx_buf[1]; /**&amp;lt; TX buffer. */&lt;br /&gt;static uint8_t rx_buf[1]; /**&amp;lt; RX buffer. */&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;I2C read:&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;rx_buf[0] = 0;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;NRF_TWIM1-&amp;gt;SHORTS = TWIM_SHORTS_LASTTX_STARTRX_Msk | TWIM_SHORTS_LASTRX_STOP_Msk;&lt;/p&gt;
&lt;p&gt;tx_for_rx_buf[0] = LastAddressRead;&lt;br /&gt; NRF_TWIM1-&amp;gt;TXD.MAXCNT = 1;&lt;br /&gt; NRF_TWIM1-&amp;gt;TXD.PTR = (uint32_t)&amp;amp;tx_for_rx_buf[0];&lt;/p&gt;
&lt;p&gt;NRF_TWIM1-&amp;gt;RXD.MAXCNT = 1;&lt;br /&gt; NRF_TWIM1-&amp;gt;RXD.PTR = (uint32_t)&amp;amp;rx_buf[0];&lt;/p&gt;
&lt;p&gt;NRF_TWIM1-&amp;gt;EVENTS_STOPPED = 0;&lt;br /&gt; NRF_TWIM1-&amp;gt;EVENTS_LASTTX = 0;&lt;/p&gt;
&lt;p&gt;NRF_TWIM1-&amp;gt;TASKS_STARTTX = 1;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;while (NRF_TWIM1-&amp;gt;EVENTS_STOPPED == 0);&lt;/p&gt;
&lt;p&gt;nrf_delay_us(50);&lt;/p&gt;
&lt;p&gt;return (rx_buf[0]);&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: TIWM and GPIO input</title><link>https://devzone.nordicsemi.com/thread/222569?ContentTypeID=1</link><pubDate>Thu, 28 Nov 2019 10:04:40 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:77c1fae5-2a68-4387-afb7-f46316cfd80b</guid><dc:creator>&amp;#216;yvind</dc:creator><description>&lt;p&gt;Can you please provide your&amp;nbsp;code? I&amp;#39;m not able to see what the issue is.&lt;br /&gt;&lt;br /&gt;Thanks!&lt;br /&gt;&lt;br /&gt;Kind regards,&lt;br /&gt;Øyvind&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: TIWM and GPIO input</title><link>https://devzone.nordicsemi.com/thread/222266?ContentTypeID=1</link><pubDate>Wed, 27 Nov 2019 09:40:37 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:3fa4ae36-8c5c-4494-b058-c41138f3aede</guid><dc:creator>lelisele</dc:creator><description>&lt;p&gt;Additionally, after reading input the I2C clock becomes Low even strong PoolUp?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: TIWM and GPIO input</title><link>https://devzone.nordicsemi.com/thread/222265?ContentTypeID=1</link><pubDate>Wed, 27 Nov 2019 09:34:50 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:f8afb60b-b70f-40de-b133-3fc54ab4f4cf</guid><dc:creator>lelisele</dc:creator><description>&lt;p&gt;Is blocked on:&amp;nbsp; while (NRF_TWIM1-&amp;gt;EVENTS_STOPPED == 0); I don&amp;#39;t understand what one GPIO input reading can change in TWIM periphery?&amp;nbsp; &amp;nbsp;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: TIWM and GPIO input</title><link>https://devzone.nordicsemi.com/thread/222253?ContentTypeID=1</link><pubDate>Wed, 27 Nov 2019 09:05:21 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:b2ea23c9-b9c2-4c77-8d3a-fc1e44460925</guid><dc:creator>&amp;#216;yvind</dc:creator><description>&lt;p&gt;Have you tried debugging the issue to pinpoint where it fails? Are you getting any error messages?&lt;/p&gt;
&lt;p&gt;Kind regards,&lt;br /&gt;Øyvind&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: TIWM and GPIO input</title><link>https://devzone.nordicsemi.com/thread/222244?ContentTypeID=1</link><pubDate>Wed, 27 Nov 2019 08:41:06 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:24e30237-78d3-4ff7-a473-7d4495b998e4</guid><dc:creator>lelisele</dc:creator><description>&lt;p&gt;Thanks for your quick answer. My TWIM works very well. It is based on the direct access to registers and HAL drivers.&lt;/p&gt;
&lt;p&gt;It takes about twenty lines in SW !!!!!!!! to interface my sensor. The problem is when I read one GPIO input (pin 19) the TWIM (pin 21 and 23) is blocked and I need re-download application That is extremely strange.&amp;nbsp;&amp;nbsp;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: TIWM and GPIO input</title><link>https://devzone.nordicsemi.com/thread/222240?ContentTypeID=1</link><pubDate>Wed, 27 Nov 2019 08:29:36 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:12fd5884-08a1-4952-b160-bdd94743aa1d</guid><dc:creator>&amp;#216;yvind</dc:creator><description>&lt;p&gt;Hello,&amp;nbsp;&lt;br /&gt;&lt;br /&gt;Have you tried using our TWI examples to verify connection/functionality?&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;a href="https://infocenter.nordicsemi.com/topic/sdk_nrf5_v16.0.0/twi_scanner_example.html?cp=6_1_4_6_44"&gt;TWI Scanner Example&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://infocenter.nordicsemi.com/topic/sdk_nrf5_v16.0.0/twi_sensor_example.html?cp=6_1_4_6_45"&gt;TWI Sensor Example&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://infocenter.nordicsemi.com/topic/sdk_nrf5_v16.0.0/twi_transaction_mgr_example.html?cp=6_1_4_6_46"&gt;TWI Transaction Manager Example&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://infocenter.nordicsemi.com/topic/sdk_nrf5_v16.0.0/twi_master_with_twis_slave_example.html?cp=6_1_4_6_47"&gt;TWIS Slave and TWI Master Mode Drivers Example&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;Kind regards,&lt;br /&gt;Øyvind&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>