<?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>NRF52810 initializing TWI (I2C)</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/53158/nrf52810-initializing-twi-i2c</link><description>Hello, I am having problems getting the TWI to work. The NRF52810 needs the TWI to communicate with a EEPROM module. 
 Thus far ive set: 
 
 Then I try to do the TWI Scanner example but I get no activity (with scope) on the SCL or SDA line. 
 Is there</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Thu, 24 Oct 2019 13:00:55 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/53158/nrf52810-initializing-twi-i2c" /><item><title>RE: NRF52810 initializing TWI (I2C)</title><link>https://devzone.nordicsemi.com/thread/216632?ContentTypeID=1</link><pubDate>Thu, 24 Oct 2019 13:00:55 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:11cfa627-7235-4f55-abc6-d3375ba569bf</guid><dc:creator>trevortjes</dc:creator><description>&lt;p&gt;Turns out it was indeed a hardware error. The ESD protection was influencing the TWI lines. Already succesfully wrote and read data from the EEPROM module.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: NRF52810 initializing TWI (I2C)</title><link>https://devzone.nordicsemi.com/thread/215952?ContentTypeID=1</link><pubDate>Mon, 21 Oct 2019 13:39:53 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:f3c8a3d3-e9cc-4f43-9346-8c7468e5c259</guid><dc:creator>Einar Thorsrud</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;The GPIO&amp;#39;s are configured by the driver with pullups, so there is no need to explicitly configure them before. There were some issues here (missing pull-up configuration) some SDK released back (you can see this from the driver implementation). Which SDK version do you use?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: NRF52810 initializing TWI (I2C)</title><link>https://devzone.nordicsemi.com/thread/215843?ContentTypeID=1</link><pubDate>Mon, 21 Oct 2019 08:37:40 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:a8883ec3-2e32-44fd-9595-f962c95640eb</guid><dc:creator>trevortjes</dc:creator><description>&lt;p&gt;This is everything to the hardware besides some ESD protection. &lt;/p&gt;
&lt;p&gt;&lt;img alt=" " src="https://devzone.nordicsemi.com/resized-image/__size/320x240/__key/communityserver-discussions-components-files/4/hardware2.png" /&gt;&lt;/p&gt;
&lt;p&gt;I only have access to the nRF51822-DK. Is it true that I have to set the GPIO configuration for the SCL and SDA pins myself, or does the TWI library do this when telling it what the SCL and SDA pins are.&lt;/p&gt;
&lt;p&gt;I will try now to remove the ESD protection and see if anything changes. I will also turn on the internal pullups without interference of the TWI related stuff and see if the odd pin levels remain.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: NRF52810 initializing TWI (I2C)</title><link>https://devzone.nordicsemi.com/thread/215270?ContentTypeID=1</link><pubDate>Wed, 16 Oct 2019 11:33:12 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:046ef278-edfc-4658-b880-a6da1f1d739b</guid><dc:creator>Einar Thorsrud</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;This is a bit strange. Is this the whole schematic, or are there some relevant parts missing? Have you tried with an nRF dev kit (instead of your custom HW) and external pullups? If not, can you try that? What happens if you test with another I2C slave device instead?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: NRF52810 initializing TWI (I2C)</title><link>https://devzone.nordicsemi.com/thread/215110?ContentTypeID=1</link><pubDate>Tue, 15 Oct 2019 13:45:20 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:e9c9b8ed-b8f1-4099-97aa-45175e46c298</guid><dc:creator>trevortjes</dc:creator><description>&lt;p&gt;&lt;img alt=" " src="https://devzone.nordicsemi.com/resized-image/__size/320x240/__key/communityserver-discussions-components-files/4/2744.circuit.png" /&gt;&lt;/p&gt;
&lt;p&gt;Important:&lt;/p&gt;
&lt;p&gt;using&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="c_cpp"&gt;  nrf_gpio_pin_toggle(25);
  nrf_gpio_pin_toggle(28);&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;and turning off the InitTWI() results in both pins toggling from 0V to 3.5V.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: NRF52810 initializing TWI (I2C)</title><link>https://devzone.nordicsemi.com/thread/215107?ContentTypeID=1</link><pubDate>Tue, 15 Oct 2019 13:38:45 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:a8b3b499-8f7c-4416-83f7-1c150a7ae1ee</guid><dc:creator>Einar Thorsrud</dc:creator><description>&lt;p&gt;I see. Then I think you need to look more closely at your HW. How exactly are things connected hooked up? Can you show us a schematic?&amp;nbsp;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: NRF52810 initializing TWI (I2C)</title><link>https://devzone.nordicsemi.com/thread/215103?ContentTypeID=1</link><pubDate>Tue, 15 Oct 2019 13:32:02 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:a9760768-4829-4847-84ad-8fe512b462b0</guid><dc:creator>trevortjes</dc:creator><description>&lt;p&gt;My VDD is 3.5V which adds to the confusion.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: NRF52810 initializing TWI (I2C)</title><link>https://devzone.nordicsemi.com/thread/215101?ContentTypeID=1</link><pubDate>Tue, 15 Oct 2019 13:31:00 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:b564d1ed-7eb4-469a-943a-b0f779c36347</guid><dc:creator>Einar Thorsrud</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;Just to check. Since you write that you measure 2V, I assume that is rougly your VDD voltage, right?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: NRF52810 initializing TWI (I2C)</title><link>https://devzone.nordicsemi.com/thread/215096?ContentTypeID=1</link><pubDate>Tue, 15 Oct 2019 13:18:26 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:57cde5bd-4bba-4e1b-b688-1bae528f540b</guid><dc:creator>trevortjes</dc:creator><description>&lt;p&gt;Pin P25 is assigned to SDA and P28 is assigned to SCL. These are routed towards a M24C32-FMN6TP module. I have set the GPIO for these pins as:&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="c_cpp"&gt;	//SDA
	nrf_gpio_cfg(PIN_SDA,	NRF_GPIO_PIN_DIR_OUTPUT,	NRF_GPIO_PIN_INPUT_CONNECT, NRF_GPIO_PIN_PULLUP, NRF_GPIO_PIN_S0S1, NRF_GPIO_PIN_NOSENSE);
	
	//SCL
	nrf_gpio_cfg(PIN_SCL,	NRF_GPIO_PIN_DIR_OUTPUT, NRF_GPIO_PIN_INPUT_CONNECT, NRF_GPIO_PIN_PULLUP, NRF_GPIO_PIN_S0S1, NRF_GPIO_PIN_NOSENSE);&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;As tests I am scoping pin SCL and SDA just to check if anything is happening at all but this is not the case. WITHOUT starting a transaction both pins are pulled high as expected from the pullups. When the scanner is called, P28 gets stuck on 2VDC and P25 falls to a few millivolts but theres no sign of data.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: NRF52810 initializing TWI (I2C)</title><link>https://devzone.nordicsemi.com/thread/214951?ContentTypeID=1</link><pubDate>Tue, 15 Oct 2019 06:32:12 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:f7b93a91-f150-48ea-84f9-4537addcbe71</guid><dc:creator>Einar Thorsrud</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;Can you show your code and describe your HW setup and pin configuration? The hw_timeout should normally never happen (which is why it leads to an&amp;nbsp;NRFX_ERROR_INTERNAL /&amp;nbsp;NRF_ERROR_INTERNAL). What debugging have you done? Have you checked the signal on the&amp;nbsp;SCL or SDA lines with a logic analyzer?&lt;/p&gt;
[quote user="trevortjes"]Also do I need TWI, TWIM or TWIS when interfacing the NRF52810 with an I2C eeprom IC?[/quote]
&lt;p&gt;In TWI /I2C there is always one master and one or more slaves. The communication is always initiated by the master, so an EEPROM will typically be a slave, and the MCU will be a master. So in that case, you should use the TWIM or TWI peripheral, which are both masters. Using the driver there is no significant difference between TWI and TWIM. If you configure that you want to use DMA, then the TWIM peripheral is used by the driver. If not, then TWI is used. Generally, you should use DMA (TWIM) unless you have a good reason for not doing so.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: NRF52810 initializing TWI (I2C)</title><link>https://devzone.nordicsemi.com/thread/214898?ContentTypeID=1</link><pubDate>Mon, 14 Oct 2019 14:45:26 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:a259baba-69ae-4fd0-9788-5c9bc9de2b8b</guid><dc:creator>trevortjes</dc:creator><description>&lt;p&gt;This program is added to my project and when debugging it seems like the program gets stuck in a loop of twi_rx_start_transfer and the &amp;quot;hw_timout&amp;quot; part. Any idea what causes this?&lt;/p&gt;
&lt;p&gt;Also do I need TWI, TWIM or TWIS when interfacing the NRF52810 with an I2C eeprom IC?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: NRF52810 initializing TWI (I2C)</title><link>https://devzone.nordicsemi.com/thread/214788?ContentTypeID=1</link><pubDate>Mon, 14 Oct 2019 10:37:35 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:126ee21a-4f76-4d40-8e83-9572b4566f0d</guid><dc:creator>Einar Thorsrud</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;You only initialize the TWI driver in the code snippet in your question. Since there is no code that actually starts a transaction, it is as expected that you don&amp;#39;t see any activity on the SCL and SDA lines. You mention the TWI Scanner example, and there you can see that it sets up a read transaction for every address. Using that code (after first initializing as you do), you will see activity on the lines:&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="c_cpp"&gt;    for (address = 1; address &amp;lt;= TWI_ADDRESSES; address++)
    {
        err_code = nrf_drv_twi_rx(&amp;amp;m_twi, address, &amp;amp;sample_data, sizeof(sample_data));
        if (err_code == NRF_SUCCESS)
        {
            detected_device = true;
            NRF_LOG_INFO(&amp;quot;TWI device detected at address 0x%x.&amp;quot;, address);
        }
        NRF_LOG_FLUSH();
    }&lt;/pre&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>