<?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>AT24C512 + BMI160 + NRF52</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/47060/at24c512-bmi160-nrf52</link><description>Hi, 
 I am using nRF52832 soc to develop my project. with nRF5_SDK_15.3 . SES file 
 I need to connect both BMI160 accelerometer sensor and AT24C512 EEPROM ic in TWI. 
 how to use TWI with this. guide me to use both at a time. 
 BMI160 separately i can</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Fri, 21 Jun 2019 07:37:05 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/47060/at24c512-bmi160-nrf52" /><item><title>RE: AT24C512 + BMI160 + NRF52</title><link>https://devzone.nordicsemi.com/thread/194010?ContentTypeID=1</link><pubDate>Fri, 21 Jun 2019 07:37:05 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:16c25526-ff75-46a7-b2fd-bf7533644530</guid><dc:creator>awneil</dc:creator><description>[quote userid="77062" url="~/f/nordic-q-a/47060/at24c512-bmi160-nrf52/186196"]@awneil, I agree. This is very confusing, even for me[/quote]
&lt;p&gt;It seems to be a general problem throughout the Nordic documentation:&lt;/p&gt;
&lt;p&gt;&lt;a href="https://devzone.nordicsemi.com/f/nordic-q-a/48848/pin-configuration-limitation/194009#194009"&gt;https://devzone.nordicsemi.com/f/nordic-q-a/48848/pin-configuration-limitation/194009#194009&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;&lt;span class="emoticon" data-url="https://devzone.nordicsemi.com/cfs-file/__key/system/emoji/1f61e.svg" title="Disappointed"&gt;&amp;#x1f61e;&lt;/span&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: AT24C512 + BMI160 + NRF52</title><link>https://devzone.nordicsemi.com/thread/187159?ContentTypeID=1</link><pubDate>Wed, 15 May 2019 08:55:56 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:218356a5-d1ad-4c6f-9bde-1aa280ff158a</guid><dc:creator>awneil</dc:creator><description>[quote userid="74103" url="~/f/nordic-q-a/47060/at24c512-bmi160-nrf52/187130"]can you tell me how to save the negative value in eeprom like (-2.05) [/quote]
&lt;p&gt;This is standard &amp;#39;C&amp;#39; - nothing specifically to do with Nordic.&lt;/p&gt;
&lt;p&gt;The EEPROM just stores &lt;em&gt;&lt;strong&gt;bytes&lt;/strong&gt; &lt;/em&gt;- it neither knows not cares what those bytes represent.&lt;/p&gt;
&lt;p&gt;So you need to write functions to take your data, and write it to the EEPROM as a sequence of bytes;&lt;/p&gt;
&lt;p&gt;And, conversely, code to read a sequence of bytes from EEPROM and form it into your data.&lt;/p&gt;
&lt;p&gt;&lt;a href="https://en.wikipedia.org/wiki/Serialization"&gt;https://en.wikipedia.org/wiki/Serialization&lt;/a&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: AT24C512 + BMI160 + NRF52</title><link>https://devzone.nordicsemi.com/thread/187130?ContentTypeID=1</link><pubDate>Wed, 15 May 2019 07:08:15 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:11f07ace-ab67-4bde-946a-e932d3c365b4</guid><dc:creator>Sunil vignesh</dc:creator><description>&lt;p&gt;HI,&lt;/p&gt;
&lt;p&gt;I have combined the code in a same TWI0 as&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="c_cpp"&gt;void E_twi_init (void)
{
    ret_code_t err_code;
const nrf_drv_twi_config_t twi_e_config = {
       .scl                = ARDUINO_SCL_PIN,
       .sda                = ARDUINO_SDA_PIN,
       .frequency          = NRF_DRV_TWI_FREQ_100K,
       .interrupt_priority = APP_IRQ_PRIORITY_HIGH,
       .clear_bus_init     = false
    };

    err_code = nrf_drv_twi_init(&amp;amp;m_twi, &amp;amp;twi_e_config, NULL, NULL);
    
    APP_ERROR_CHECK(err_code);
    if (NRF_SUCCESS == err_code)
	{
		nrf_drv_twi_enable(&amp;amp;m_twi);
		NRF_LOG_INFO(&amp;quot;EEPROM TWI init success...&amp;quot;);	
	}
}&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="c_cpp"&gt;/ &amp;lt;e&amp;gt; TWI0_ENABLED - Enable TWI0 instance
//==========================================================
#ifndef TWI0_ENABLED
#define TWI0_ENABLED 1
#endif
// &amp;lt;q&amp;gt; TWI0_USE_EASY_DMA  - Use EasyDMA (if present)
 

#ifndef TWI0_USE_EASY_DMA
#define TWI0_USE_EASY_DMA 1
#endif

// &amp;lt;/e&amp;gt;

// &amp;lt;e&amp;gt; TWI1_ENABLED - Enable TWI1 instance
//==========================================================
#ifndef TWI1_ENABLED
#define TWI1_ENABLED 0
#endif
// &amp;lt;q&amp;gt; TWI1_USE_EASY_DMA  - Use EasyDMA (if present)&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;can you check my code&lt;/p&gt;
&lt;p&gt;it is reliable ?!&amp;nbsp; (i.e - It work for long real time process)&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="c_cpp"&gt;
#include &amp;lt;stdio.h&amp;gt;
#include &amp;quot;boards.h&amp;quot;
#include &amp;quot;app_util_platform.h&amp;quot;
#include &amp;quot;app_error.h&amp;quot;
#include &amp;quot;nrf_drv_twi.h&amp;quot;
#include &amp;quot;nrf_delay.h&amp;quot;


#include &amp;quot;nrf_log.h&amp;quot;
#include &amp;quot;nrf_log_ctrl.h&amp;quot;
#include &amp;quot;nrf_log_default_backends.h&amp;quot;

#include &amp;quot;bmi160.h&amp;quot;

/* TWI instance ID. */
#define TWI_INSTANCE_ID     0
#define TWI1_INSTANCE_ID     1
#define I2C_24C128_SLAVE_ADDR        (0x50)
#define G_TO_LSB (16384.0f)

#define DPS_TO_LSB (131.072f)

/* Indicates if operation on TWI has ended. */
static volatile bool m_xfer_done = false;

/* TWI instance. */
static const nrf_drv_twi_t m_twi = NRF_DRV_TWI_INSTANCE(TWI_INSTANCE_ID);
//static const nrf_drv_twi_t m_twi_e = NRF_DRV_TWI_INSTANCE(TWI1_INSTANCE_ID);

void eep_WriteByte(uint16_t eep_address, unsigned char val);
unsigned char eep_readByte(uint16_t eep_address);
ret_code_t err_codecpy;

struct bmi160_dev sensor;
struct bmi160_sensor_data accel;
struct bmi160_sensor_data gyro;
struct bmi160_int_settg int_config;

int8_t rslt = BMI160_OK;



void B_twi_init (void)
{
    ret_code_t err_code;

    const nrf_drv_twi_config_t twi_config = {
       .scl                = ARDUINO_SCL_PIN,
       .sda                = ARDUINO_SDA_PIN,
       .frequency          = NRF_DRV_TWI_FREQ_100K,
       .interrupt_priority = APP_IRQ_PRIORITY_HIGH,
       .clear_bus_init     = false
    };

    err_code = nrf_drv_twi_init(&amp;amp;m_twi, &amp;amp;twi_config, NULL, NULL);
    NRF_LOG_INFO(&amp;quot;err_code :%d&amp;quot;, err_code);
    APP_ERROR_CHECK(err_code);
    if (NRF_SUCCESS == err_code)
	{
		nrf_drv_twi_enable(&amp;amp;m_twi);
		NRF_LOG_INFO(&amp;quot;BMI TWI init success...&amp;quot;);	
	}
}

void E_twi_init (void)
{
    ret_code_t err_code;
const nrf_drv_twi_config_t twi_e_config = {
       .scl                = ARDUINO_SCL_PIN,
       .sda                = ARDUINO_SDA_PIN,
       .frequency          = NRF_DRV_TWI_FREQ_100K,
       .interrupt_priority = APP_IRQ_PRIORITY_HIGH,
       .clear_bus_init     = false
    };

    err_code = nrf_drv_twi_init(&amp;amp;m_twi, &amp;amp;twi_e_config, NULL, NULL);
    
    APP_ERROR_CHECK(err_code);
    if (NRF_SUCCESS == err_code)
	{
		nrf_drv_twi_enable(&amp;amp;m_twi);
		NRF_LOG_INFO(&amp;quot;EEPROM TWI init success...&amp;quot;);	
	}
}
unsigned char eep_readByte(uint16_t eep_address)
{

    unsigned char eep_by_address[2];
    unsigned char reg=0;
    eep_by_address[1]   = eep_address;
    eep_by_address[0] = (unsigned char)(eep_address &amp;lt;&amp;lt; 8);
    // setting the start address
    nrf_drv_twi_tx(&amp;amp;m_twi, I2C_24C128_SLAVE_ADDR, eep_by_address, 2, true);
    // read a byte
    nrf_delay_ms(5);

    nrf_drv_twi_rx(&amp;amp;m_twi, I2C_24C128_SLAVE_ADDR, &amp;amp;reg,1);

    nrf_delay_ms(5);
	return reg;
}
void eep_WriteByte(uint16_t eep_address, unsigned char val)
{

    unsigned char eep_by_address[3];
    eep_by_address[2] = val;
    eep_by_address[1] = eep_address;
    eep_by_address[0] = (unsigned char)(eep_address &amp;lt;&amp;lt; 8);

    err_codecpy = nrf_drv_twi_tx(&amp;amp;m_twi, I2C_24C128_SLAVE_ADDR, eep_by_address, 3, false);
    nrf_delay_ms(5);
    if(err_codecpy == 0)
    {
      NRF_LOG_INFO(&amp;quot;\r\nWritten Sucess&amp;quot;);
    NRF_LOG_FLUSH();
    }

}



int8_t Acc_i2c_Write(uint8_t dev_id, uint8_t reg_addr, uint8_t *reg_data, uint16_t len)
{

    //  NRF_LOG_INFO(&amp;quot;WRITE: dev_id: %x reg_addr: %x reg_data: %x len: %i\n&amp;quot;, dev_id, reg_addr, *reg_data, len);
	int8_t rslt = 0;
	uint8_t data[len + 1];
	data[0] = reg_addr;
	for (uint16_t i = 0; i &amp;lt; len; i++) {
		data[i + 1] = reg_data[i];
	}
	
	rslt = nrf_drv_twi_tx(&amp;amp;m_twi, dev_id, data, len + 1, false);
	APP_ERROR_CHECK(rslt);
        return rslt;
  
}


int8_t Acc_i2c_Read(uint8_t dev_id, uint8_t reg_addr, uint8_t *reg_data, uint16_t len)
{
	int8_t rslt = 0;
   //     NRF_LOG_INFO(&amp;quot;READ: dev_id: %x reg_addr: %x len: %i\n&amp;quot;, dev_id, reg_addr, len);
	rslt = nrf_drv_twi_tx(&amp;amp;m_twi, dev_id, &amp;amp;reg_addr, 1, false);
        APP_ERROR_CHECK(rslt);

	if (rslt == 0)
	{
		rslt = nrf_drv_twi_rx(&amp;amp;m_twi, dev_id, reg_data, len);
	}
    //    NRF_LOG_INFO(&amp;quot;READ: %x&amp;quot;,*reg_data);
	return rslt;
}

void Acc_delay_ms(uint32_t period)
{ 
  nrf_delay_ms( period ) ;
}

void BMI_init (void)
{
    sensor.id = BMI160_I2C_ADDR;         //0x69
    sensor.interface = BMI160_I2C_INTF;  //0x00
    sensor.read = &amp;amp;Acc_i2c_Read;
    sensor.write = &amp;amp;Acc_i2c_Write;
    sensor.delay_ms = &amp;amp;Acc_delay_ms;

    rslt = bmi160_init(&amp;amp;sensor);
    APP_ERROR_CHECK(rslt);

    if(rslt == BMI160_OK){
    NRF_LOG_INFO(&amp;quot;BMI160 Initialized...&amp;quot;);
    } else {
    NRF_LOG_INFO(&amp;quot;BMI160 not Initialized...&amp;quot;);
    }NRF_LOG_FLUSH();

    sensor.accel_cfg.odr = BMI160_ACCEL_ODR_1600HZ;
    sensor.accel_cfg.range = BMI160_ACCEL_RANGE_2G;
    sensor.accel_cfg.bw = BMI160_ACCEL_BW_NORMAL_AVG4;
    sensor.accel_cfg.power = BMI160_ACCEL_NORMAL_MODE;

    sensor.gyro_cfg.odr = BMI160_GYRO_ODR_3200HZ;
    sensor.gyro_cfg.range = BMI160_GYRO_RANGE_2000_DPS;
    sensor.gyro_cfg.bw = BMI160_GYRO_BW_NORMAL_MODE;
    sensor.gyro_cfg.power = BMI160_GYRO_NORMAL_MODE;

    rslt = bmi160_set_sens_conf(&amp;amp;sensor);
    APP_ERROR_CHECK(rslt);

     if(rslt == BMI160_OK){
    NRF_LOG_INFO(&amp;quot;sensor Configured...&amp;quot;);
    } else {
    NRF_LOG_INFO(&amp;quot;sensor not Configured...&amp;quot;);
    }NRF_LOG_FLUSH();
}
/**
 * @brief Function for reading data from temperature sensor.
 */
static void read_sensor_data()
{
    m_xfer_done = false;
    unsigned char  reg1 = 0;
    bmi160_get_sensor_data((BMI160_ACCEL_SEL | BMI160_GYRO_SEL | BMI160_TIME_SEL), &amp;amp;accel, &amp;amp;gyro, &amp;amp;sensor);
    float accelX = ((((float)accel.x) / G_TO_LSB) * 9.80655); // in m/s^2
      float gyrX = ((((float)gyro.x) / DPS_TO_LSB) * 0.0174532925); // in rad/sec
      NRF_LOG_INFO(&amp;quot;DataX in m/s^2   : &amp;quot; NRF_LOG_FLOAT_MARKER, 
      NRF_LOG_FLOAT( accelX));
      NRF_LOG_INFO(&amp;quot;DataY in rad/sec : &amp;quot; NRF_LOG_FLOAT_MARKER, 
      NRF_LOG_FLOAT(gyrX));
      NRF_LOG_FLUSH();
       nrf_delay_ms(50);
       eep_WriteByte(0x00051,accelX);
        reg1=eep_readByte(0x00051);
	if(reg1!=0){
		NRF_LOG_INFO(&amp;quot;\r\n Read value 51 : %d&amp;quot;,reg1);
                NRF_LOG_FLUSH();
                nrf_delay_ms(5);
	}
	else if(reg1==0){
        NRF_LOG_INFO(&amp;quot;\r\n can&amp;#39;t Read value 51 &amp;quot;);
	 nrf_delay_ms(5);
	}
}

/**
 * @brief Function for main application entry.
 */
int main(void)
{ bsp_board_init(BSP_INIT_LEDS);
    APP_ERROR_CHECK(NRF_LOG_INIT(NULL));
    NRF_LOG_DEFAULT_BACKENDS_INIT();
     NRF_LOG_INFO(&amp;quot;EEPROM get started.\n&amp;quot;);
    NRF_LOG_FLUSH();
    Acc_delay_ms(100);


    E_twi_init();
    Acc_delay_ms(50);
    unsigned char  reg1 = 0;
    
    nrf_delay_ms(1000);
    nrf_delay_ms(5);
	   reg1=eep_readByte(0x0000);
	if(reg1!=0){
		NRF_LOG_INFO(&amp;quot;\r\n Read value 00 : %x&amp;quot;,reg1);
                NRF_LOG_FLUSH();
                nrf_delay_ms(5);
	}

	else if(reg1==0){
	 nrf_delay_ms(5);
	}
        nrf_delay_ms(3000);

     eep_WriteByte(0x0000,&amp;#39;S&amp;#39;);
    nrf_delay_ms(5);
	   reg1=eep_readByte(0x0000);
	if(reg1!=0){
		NRF_LOG_INFO(&amp;quot;\r\n Read value 00 : %x&amp;quot;,reg1);
                NRF_LOG_FLUSH();
                nrf_delay_ms(5);
	}

	else if(reg1==0){
	 nrf_delay_ms(5);
	}

    NRF_LOG_INFO(&amp;quot;BMI160 get started.\n&amp;quot;);
    NRF_LOG_FLUSH();
    Acc_delay_ms(100);
   // nrf_drv_twi_disable(&amp;amp;m_twi_e);


    //B_twi_init();
    Acc_delay_ms(50);

    BMI_init();
    Acc_delay_ms(100);
    uint8_t reg_addr = BMI160_CHIP_ID_ADDR;
    uint8_t data;
    uint16_t len = 1;
    Acc_delay_ms(1000);
    rslt = bmi160_get_regs(reg_addr, &amp;amp;data, len, &amp;amp;sensor);
    NRF_LOG_INFO(&amp;quot;Data:%x&amp;quot;, data);
    NRF_LOG_FLUSH();
    Acc_delay_ms(3000);
    
    while (true)
    {
        nrf_delay_ms(250);
        read_sensor_data();

        NRF_LOG_FLUSH();
    }
}

/** @} */
&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;OUTPUT:&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="text"&gt;&amp;lt;info&amp;gt; app: EEPROM get started.

&amp;lt;info&amp;gt; app: EEPROM TWI init success...
&amp;lt;info&amp;gt; app: 
 Read value 00 : 53
&amp;lt;info&amp;gt; app: 
Written Sucess
&amp;lt;info&amp;gt; app: 
 Read value 00 : 53
&amp;lt;info&amp;gt; app: BMI160 get started.

&amp;lt;info&amp;gt; app: BMI160 Initialized...
&amp;lt;info&amp;gt; app: sensor Configured...
&amp;lt;info&amp;gt; app: Data:D1
&amp;lt;info&amp;gt; app: DataX in m/s^2   : 2.60
&amp;lt;info&amp;gt; app: DataY in rad/sec : -0.00
&amp;lt;info&amp;gt; app: 
Written Sucess
&amp;lt;info&amp;gt; app: 
 Read value 51 : 2
&amp;lt;info&amp;gt; app: DataX in m/s^2   : 2.56
&amp;lt;info&amp;gt; app: DataY in rad/sec : -0.00
&amp;lt;info&amp;gt; app: 
Written Sucess
&amp;lt;info&amp;gt; app: 
 Read value 51 : 2
&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;can you tell me how to save the negative value in eeprom like (-2.05) in an address&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: AT24C512 + BMI160 + NRF52</title><link>https://devzone.nordicsemi.com/thread/186441?ContentTypeID=1</link><pubDate>Fri, 10 May 2019 13:14:07 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:f137f91d-1034-4c2e-b1ca-a1c3ca9cda70</guid><dc:creator>awneil</dc:creator><description>[quote userid="77062" url="~/f/nordic-q-a/47060/at24c512-bmi160-nrf52/186415"]the TWI transaction manager library can schedule transfer requests from different contexts and realize them in the order they were scheduled[/quote]
&lt;p&gt;&lt;a href="https://devzone.nordicsemi.com/members/sunil-vignesh"&gt;Sunil vignesh&lt;/a&gt; obviously, that adds a layer of complexity.&lt;/p&gt;
&lt;p&gt;The alternative is that you have to manage the bus accesses yourself in your own code so that the 2 sensors do not interfere with each other.&lt;/p&gt;
&lt;p&gt;If you have a simple use case, with only the 2 sensors, it may not be&amp;nbsp;(too) difficult to manage this &amp;quot;manually&amp;quot;...&lt;/p&gt;
&lt;p&gt;But only you know the details of your application - so only you can decide what&amp;#39;s appropriate to it.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: AT24C512 + BMI160 + NRF52</title><link>https://devzone.nordicsemi.com/thread/186415?ContentTypeID=1</link><pubDate>Fri, 10 May 2019 12:05:26 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:217d8684-a943-4e27-96af-1fb56ed3eabe</guid><dc:creator>&amp;#216;yvind</dc:creator><description>&lt;p&gt;The application communicates over the two-wire interface (TWI) with two devices:&amp;nbsp;the MMA7660 triple axis accelerometer and the LM75B temperature sensor.&lt;/p&gt;
&lt;p&gt;The example uses the RTC peripheral to generate regular tick events (32 per second). The interrupt handler, executed in reaction to each tick event, schedules data transfers to read the current values from the devices. The obtained values are averaged and printed every 500 milliseconds or when the tilting status reported by the accelerometer changes. Additionally, the user can generate asynchronous data transfer requests (reading all registers available in the devices) by pressing Button 1 or Button 4. Such additional transfer requests show that the TWI transaction manager library can schedule transfer requests from different contexts and realize them in the order they were scheduled.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: AT24C512 + BMI160 + NRF52</title><link>https://devzone.nordicsemi.com/thread/186407?ContentTypeID=1</link><pubDate>Fri, 10 May 2019 11:51:56 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:6dd4aeec-708f-466d-8549-ec50dcbc30bf</guid><dc:creator>awneil</dc:creator><description>[quote userid="74103" url="~/f/nordic-q-a/47060/at24c512-bmi160-nrf52/186388"]my concern is to make multiple slaves for a one master is getting complexes[/quote]
&lt;p&gt;I suggest that you go back to basics:&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;Make sure that you understand the basics of I2C.&lt;br /&gt;&amp;nbsp;&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Start with the TWI Scanner example.&lt;/strong&gt;&lt;br /&gt;This will verify that your hardware connections are correct &amp;amp; working, and confirm that you have the correct Slave Addresses.&lt;br /&gt;&amp;nbsp;&lt;/li&gt;
&lt;li&gt;Spend time studying this example, to understand how it works.&lt;br /&gt;Practice using the debugger to step through your code, examine variables, etc&lt;br /&gt;Practice using an oscilloscope or logic analyser to view what&amp;#39;s happening on the wires.&lt;br /&gt;&amp;nbsp;&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Save the Project&lt;/strong&gt; - so that you can come back to it for reference later.&lt;br /&gt;&amp;nbsp;&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Use the TWI Master example&lt;/strong&gt; with just &lt;em&gt;&lt;strong&gt;one&lt;/strong&gt; &lt;/em&gt;of your slaves.&lt;br /&gt;Get that Slave working &lt;em&gt;&lt;strong&gt;on its own&lt;/strong&gt;&lt;/em&gt;.&lt;br /&gt;Again, practice using the debugger, scope, etc.&lt;br /&gt;&amp;nbsp;&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Save the Project&lt;/strong&gt;&lt;span&gt;&amp;nbsp;- you will need it later.&lt;br /&gt;&amp;nbsp;&lt;/span&gt;&lt;/li&gt;
&lt;li&gt;&lt;span&gt;Start again with the &lt;em&gt;&lt;strong&gt;unmodified&lt;/strong&gt;&lt;/em&gt;&amp;nbsp;&lt;strong&gt;TWI Master example&lt;/strong&gt;&amp;nbsp;with the &lt;em&gt;other&amp;nbsp;&lt;/em&gt;of your slaves.&lt;br /&gt;Get that Slave working&amp;nbsp;&lt;em&gt;&lt;strong&gt;on its own&lt;/strong&gt;&lt;/em&gt;.&lt;br /&gt;&amp;nbsp;&lt;/span&gt;&lt;/li&gt;
&lt;li&gt;&lt;span&gt;&lt;strong&gt;Save the Project&lt;/strong&gt;&amp;nbsp;-&amp;nbsp;so that you can come back to it for reference later&lt;br /&gt;&amp;nbsp;&lt;/span&gt;&lt;/li&gt;
&lt;li&gt;&lt;span&gt;Now merge your two TWI Master projects together&lt;/span&gt;&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;&lt;span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;I suggest that you adopt an approach like this for all your projects:&lt;/span&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Start with working examples;&lt;/li&gt;
&lt;li&gt;Know your tools;&lt;/li&gt;
&lt;li&gt;Take small steps at a time;&lt;/li&gt;
&lt;li&gt;Keep &amp;quot;snapshots&amp;quot; of your work so that you can go back if things go wrong.&lt;/li&gt;
&lt;/ul&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: AT24C512 + BMI160 + NRF52</title><link>https://devzone.nordicsemi.com/thread/186398?ContentTypeID=1</link><pubDate>Fri, 10 May 2019 11:39:24 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:3254d9af-8870-45e8-ab30-951a8eae9f82</guid><dc:creator>Sunil vignesh</dc:creator><description>[quote userid="77062" url="~/f/nordic-q-a/47060/at24c512-bmi160-nrf52/186395"]Not sure what example you mean, as the link points to the start of the SDK documentation.[/quote]
&lt;p&gt;is this TWI Transaction Manager Example&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;code&gt;&amp;lt;InstallFolder&amp;gt;\examples\peripheral\twi_master_using_nrf_twi_mngr&lt;/code&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: AT24C512 + BMI160 + NRF52</title><link>https://devzone.nordicsemi.com/thread/186395?ContentTypeID=1</link><pubDate>Fri, 10 May 2019 11:35:26 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:ebc0b415-46e5-445b-9675-5ad76e4cee3d</guid><dc:creator>&amp;#216;yvind</dc:creator><description>[quote user="Sunil vignesh"]but my concern is to make multiple slaves for a one master is getting complexes.[/quote]
&lt;p&gt;&amp;nbsp;In your case, you should only need to configure one master. As long as the sensor and EEPROM are connected and powered correctly, you should only need to issue their address and then the command (as per the I2C standard).&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
[quote user="Sunil vignesh"]can yu please explain how this example works.[/quote]
&lt;p&gt;&amp;nbsp;Not sure what example you mean, as the link points to the start of the SDK documentation.&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
[quote user="Sunil vignesh"]can you please how these functions are working:[/quote]
&lt;p&gt;&amp;nbsp;These are part of the &lt;a href="https://infocenter.nordicsemi.com/topic/com.nordic.infocenter.sdk5.v15.3.0/group__app__error.html"&gt;Common Application Error Handler&lt;/a&gt;, more information &lt;a href="https://infocenter.nordicsemi.com/topic/com.nordic.infocenter.sdk5.v15.3.0/lib_error.html?resultof=%22%61%70%70%5f%65%72%72%6f%72%22%20"&gt;here&lt;/a&gt;&amp;nbsp;and &lt;a href="https://devzone.nordicsemi.com/b/blog/posts/an-introduction-to-error-handling-in-nrf5-projects"&gt;here&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;Kind regards,&lt;/p&gt;
&lt;p&gt;Øyvind&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: AT24C512 + BMI160 + NRF52</title><link>https://devzone.nordicsemi.com/thread/186388?ContentTypeID=1</link><pubDate>Fri, 10 May 2019 11:19:11 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:d00a5165-f43e-4c74-be6e-0fe7cf084d89</guid><dc:creator>Sunil vignesh</dc:creator><description>&lt;p&gt;Thank you,&lt;/p&gt;
&lt;p&gt;i understand what awneil going to tell. but my concern is to make multiple slaves for a one master is getting complexes.&lt;/p&gt;
&lt;p&gt;can yu please explain how this example works.&lt;/p&gt;
&lt;p&gt;&lt;a href="https://infocenter.nordicsemi.com/index.jsp?topic=%2Fstruct_sdk%2Fstruct%2Fsdk_nrf5_latest.html&amp;amp;cp=5_0"&gt;https://infocenter.nordicsemi.com/index.jsp?topic=%2Fstruct_sdk%2Fstruct%2Fsdk_nrf5_latest.html&amp;amp;cp=5_0&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;can you please how these functions are working:&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="c_cpp"&gt;NRF_TWI_MNGR_DEF(m_nrf_twi_mngr, MAX_PENDING_TRANSACTIONS, TWI_INSTANCE_ID);
APP_TIMER_DEF(m_timer);



 err_code = nrf_twi_mngr_init(&amp;amp;m_nrf_twi_mngr, &amp;amp;config);
    APP_ERROR_CHECK(err_code);
    
    
    
     APP_ERROR_CHECK(nrf_twi_mngr_perform(&amp;amp;m_nrf_twi_mngr, NULL, lm75b_init_transfers,
        LM75B_INIT_TRANSFER_COUNT, NULL));
        
    APP_ERROR_CHECK(nrf_twi_mngr_perform(&amp;amp;m_nrf_twi_mngr, NULL, mma7660_init_transfers,
        MMA7660_INIT_TRANSFER_COUNT, NULL));
&lt;/pre&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: AT24C512 + BMI160 + NRF52</title><link>https://devzone.nordicsemi.com/thread/186293?ContentTypeID=1</link><pubDate>Fri, 10 May 2019 07:45:48 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:f8833df4-ee53-4bf8-9cc4-ced9b9d7b5bb</guid><dc:creator>&amp;#216;yvind</dc:creator><description>&lt;p&gt;I&amp;#39;m sorry, but this is just code from your software. I need you to debug your software.&lt;br /&gt;&lt;br /&gt;Please see &lt;a href="https://infocenter.nordicsemi.com/topic/ug_gsg_ses/UG/gsg/debug.html?resultof=%22%64%65%62%75%67%22%20"&gt;this page&lt;/a&gt;.&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: AT24C512 + BMI160 + NRF52</title><link>https://devzone.nordicsemi.com/thread/186247?ContentTypeID=1</link><pubDate>Thu, 09 May 2019 15:31:19 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:aa48238d-648c-4253-8849-bfe20888ede5</guid><dc:creator>awneil</dc:creator><description>[quote userid="74103" url="~/f/nordic-q-a/47060/at24c512-bmi160-nrf52/186244"]when i changed the different scl sda pins separate then it works[/quote]
&lt;p&gt;That has already been explained to you: &lt;strong&gt;you cannot have two different TWI Masters sharing the same pins!&lt;/strong&gt;&lt;/p&gt;
[quote userid="74103" url="~/f/nordic-q-a/47060/at24c512-bmi160-nrf52/186244"]i need to connect both eeprom and sensor in a same pins[/quote]
&lt;p&gt;Then you must use just &lt;em&gt;&lt;strong&gt;one&lt;/strong&gt;&lt;/em&gt;&amp;nbsp;TWI Master - as&amp;nbsp;&lt;a href="https://devzone.nordicsemi.com/members/oys"&gt;Øyvind&lt;/a&gt;&amp;nbsp;showed you in the diagram he posted earlier:&lt;/p&gt;
&lt;p&gt;&lt;img alt=" " src="https://devzone.nordicsemi.com/resized-image/__size/320x240/__key/communityserver-discussions-components-files/4/pastedimage1557415865724v2.png" /&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: AT24C512 + BMI160 + NRF52</title><link>https://devzone.nordicsemi.com/thread/186244?ContentTypeID=1</link><pubDate>Thu, 09 May 2019 15:08:40 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:98fcacce-65d5-44be-9882-c3bde7de0018</guid><dc:creator>Sunil vignesh</dc:creator><description>&lt;p&gt;The error code &lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="c_cpp"&gt;#define ARDUINO_SCL_PIN             27    // SCL signal pin
#define ARDUINO_SDA_PIN             26    // SDA signal pin
#define ARDUINO1_I2C_SCL_PIN 30
#define ARDUINO1_I2C_SDA_PIN 31

void twi_init (void)
{
    ret_code_t err_code;

    const nrf_drv_twi_config_t twi_mma_EEP_config  = {
       .scl                = ARDUINO_SCL_PIN,
       .sda                = ARDUINO_SDA_PIN,
       .frequency          = NRF_DRV_TWI_FREQ_100K,
       .interrupt_priority = APP_IRQ_PRIORITY_HIGH,
       
    };
    const nrf_drv_twi_config_t twi_config = {
       .scl                = ARDUINO_SCL_PIN,
       .sda                = ARDUINO_SDA_PIN,
       .frequency          = NRF_DRV_TWI_FREQ_100K,
       .interrupt_priority = APP_IRQ_PRIORITY_HIGH,
      // .clear_bus_init     = false
    };

    err_code = nrf_drv_twi_init(&amp;amp;m_twi_mma_EEP, &amp;amp;twi_mma_EEP_config, NULL, NULL); //twi_handler
     APP_ERROR_CHECK(err_code);
    if (NRF_SUCCESS == err_code)
	{
		nrf_drv_twi_enable(&amp;amp;m_twi_mma_EEP);
		NRF_LOG_INFO(&amp;quot;TWI0 init success...&amp;quot;);	
	}
    err_code = nrf_drv_twi_init(&amp;amp;m_twi, &amp;amp;twi_config, NULL, NULL);

       APP_ERROR_CHECK(err_code);
    if (NRF_SUCCESS == err_code)
	{
		nrf_drv_twi_enable(&amp;amp;m_twi);
		NRF_LOG_INFO(&amp;quot;TWI init success...&amp;quot;);	
	}
		
   err_codecpy=err_code;
		nrf_delay_ms(5);
}&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;code changed&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="c_cpp"&gt;#define ARDUINO_SCL_PIN             27    // SCL signal pin
#define ARDUINO_SDA_PIN             26    // SDA signal pin
#define ARDUINO1_I2C_SCL_PIN 30
#define ARDUINO1_I2C_SDA_PIN 31

void twi_init (void)
{
    ret_code_t err_code;

    const nrf_drv_twi_config_t twi_mma_EEP_config  = {
       .scl                = ARDUINO1_I2C_SCL_PIN,
       .sda                = ARDUINO1_I2C_SDA_PIN,
       .frequency          = NRF_DRV_TWI_FREQ_100K,
       .interrupt_priority = APP_IRQ_PRIORITY_HIGH,
       
    };
    const nrf_drv_twi_config_t twi_config = {
       .scl                = ARDUINO_SCL_PIN,
       .sda                = ARDUINO_SDA_PIN,
       .frequency          = NRF_DRV_TWI_FREQ_100K,
       .interrupt_priority = APP_IRQ_PRIORITY_HIGH,
      // .clear_bus_init     = false
    };

    err_code = nrf_drv_twi_init(&amp;amp;m_twi_mma_EEP, &amp;amp;twi_mma_EEP_config, NULL, NULL); //twi_handler
     APP_ERROR_CHECK(err_code);
    if (NRF_SUCCESS == err_code)
	{
		nrf_drv_twi_enable(&amp;amp;m_twi_mma_EEP);
		NRF_LOG_INFO(&amp;quot;TWI0 init success...&amp;quot;);	
	}
    err_code = nrf_drv_twi_init(&amp;amp;m_twi, &amp;amp;twi_config, NULL, NULL);

       APP_ERROR_CHECK(err_code);
    if (NRF_SUCCESS == err_code)
	{
		nrf_drv_twi_enable(&amp;amp;m_twi);
		NRF_LOG_INFO(&amp;quot;TWI init success...&amp;quot;);	
	}
		
   err_codecpy=err_code;
		nrf_delay_ms(5);
}&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;when i changed the different scl sda pins separate then it works&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;but my case i need to connect both eeprom and sensor in a same pins&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: AT24C512 + BMI160 + NRF52</title><link>https://devzone.nordicsemi.com/thread/186222?ContentTypeID=1</link><pubDate>Thu, 09 May 2019 13:33:20 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:419ca899-da3f-40bb-9c9b-9225336b9721</guid><dc:creator>&amp;#216;yvind</dc:creator><description>&lt;p&gt;I&amp;#39;m sorry, I am not able to see what is wrong from your code. Can you please debug the code and give me the error message you receive with the fatal error?&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: AT24C512 + BMI160 + NRF52</title><link>https://devzone.nordicsemi.com/thread/186220?ContentTypeID=1</link><pubDate>Thu, 09 May 2019 13:30:21 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:f345d703-80e6-48af-899e-8f4334ba14cd</guid><dc:creator>&amp;#216;yvind</dc:creator><description>&lt;p&gt;As the device has EasyDMA present, you want to enable this:&lt;br /&gt;&lt;pre class="ui-code" data-mode="text"&gt;TWI0_USE_EASY_DMA 1&lt;/pre&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: AT24C512 + BMI160 + NRF52</title><link>https://devzone.nordicsemi.com/thread/186212?ContentTypeID=1</link><pubDate>Thu, 09 May 2019 13:15:25 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:6c4da55a-cc1b-43c4-8975-87d3ccf4121c</guid><dc:creator>awneil</dc:creator><description>[quote userid="74103" url="~/f/nordic-q-a/47060/at24c512-bmi160-nrf52/186165"]if i give same sda and scl pin to eeprom and bmi. it gives fatal error[/quote]
&lt;p&gt;If you&amp;#39;re going to use two separate TWI Masters, then they need to be &lt;em&gt;&lt;strong&gt;separate&lt;/strong&gt;&lt;/em&gt; - they cannot share the same pins!&lt;/p&gt;
&lt;p&gt;Again, this is clearly stated in the Product Specification:&lt;/p&gt;
&lt;p style="padding-left:30px;"&gt;&lt;em&gt;&amp;quot;Only one peripheral can be assigned to drive a particular GPIO pin at a time. Failing to do so may result in unpredictable behavior.&amp;quot;&lt;/em&gt;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: AT24C512 + BMI160 + NRF52</title><link>https://devzone.nordicsemi.com/thread/186196?ContentTypeID=1</link><pubDate>Thu, 09 May 2019 12:55:52 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:c7b788ce-e151-4672-8b57-63ea9d2206e3</guid><dc:creator>&amp;#216;yvind</dc:creator><description>&lt;p&gt;My mouse pointer is all over the place today, did mean to suggest this as the answer for this case.&amp;nbsp;&lt;/p&gt;
[quote user="awneil"]I find it unclear whether&amp;nbsp;it is a separate module, or if TWIM and/or TWIS are just &amp;quot;operating modes&amp;quot; of the TWI module?[/quote]
&lt;p&gt;@awneil, I agree. This is very confusing, even for me. But the easy explanation is:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;TWI is legacy driver for nRF51&lt;/li&gt;
&lt;li&gt;TWIM and TWIS are new for nRF52 which also uses EasyDMA&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;There is no connection between TWI and TWIM/TWIS.&lt;/p&gt;
[quote user="awneil"]and are there two TWIS modules &lt;em&gt;&lt;strong&gt;plus&lt;/strong&gt;&lt;/em&gt; two TWIM modules - or is it just a &lt;em&gt;&lt;strong&gt;total&lt;/strong&gt;&lt;/em&gt; of two modules, each of which can be either TWIM &lt;em&gt;or&lt;/em&gt; TWIS ?[/quote]
&lt;p&gt;&amp;nbsp;Have a look at the&amp;nbsp;&lt;a href="https://infocenter.nordicsemi.com/topic/com.nordic.infocenter.nrf52832.ps.v1.1/memory.html?cp=3_1_0_7_3#topic"&gt;memory Instantiation&lt;/a&gt;, as long as they do not collide. I.e. Address&amp;nbsp;&lt;span&gt;0x40003000 is shared between SPIM, SPIS, SPI, TWIM, TWIS and TWI. Only one can be instance can be used at one memory location.&amp;nbsp;Address&amp;nbsp;0x40003000 has the same. So you can have an instance of TWIM in each, but then you have filled max instances.&lt;br /&gt;&lt;br /&gt;I hope this helps to clarify &lt;span class="emoticon" data-url="https://devzone.nordicsemi.com/cfs-file/__key/system/emoji/1f642.svg" title="Slight smile"&gt;&amp;#x1f642;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: AT24C512 + BMI160 + NRF52</title><link>https://devzone.nordicsemi.com/thread/186165?ContentTypeID=1</link><pubDate>Thu, 09 May 2019 11:59:11 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:77b7cbe1-0011-4d2f-abce-c479ab974ed2</guid><dc:creator>Sunil vignesh</dc:creator><description>&lt;p&gt;hi,&lt;/p&gt;
&lt;p&gt;please verify the code:&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="c_cpp"&gt;

#include &amp;lt;stdio.h&amp;gt;
#include &amp;quot;boards.h&amp;quot;
#include &amp;quot;app_util_platform.h&amp;quot;
#include &amp;quot;app_error.h&amp;quot;
#include &amp;quot;nrf_drv_twi.h&amp;quot;
#include &amp;quot;nrf_delay.h&amp;quot;
#include &amp;quot;bmi160.h&amp;quot;

#include &amp;quot;nrf_log.h&amp;quot;
#include &amp;quot;nrf_log_ctrl.h&amp;quot;
#include &amp;quot;nrf_log_default_backends.h&amp;quot;


#define G_TO_LSB (16384.0f)

#define DPS_TO_LSB (131.072f)
#define I2C_24C128_SLAVE_ADDR        (0x57)
#define BMI160_I2C_ADDR1                      UINT8_C(0x68)

#define ARDUINO1_I2C_SCL_PIN 30
#define ARDUINO1_I2C_SDA_PIN 31
/* TWI instance ID. */
#define TWI0_INSTANCE_ID     0
#define TWI1_INSTANCE_ID     1

struct bmi160_dev sensor;
struct bmi160_sensor_data accel;
struct bmi160_sensor_data gyro;
struct bmi160_int_settg int_config;

int8_t rslt = BMI160_OK;
/* Indicates if operation on TWI has ended. */
static volatile bool m_xfer_done = false;

/* TWI instance. */
static const nrf_drv_twi_t m_twi_mma_EEP = NRF_DRV_TWI_INSTANCE(TWI0_INSTANCE_ID);
static const nrf_drv_twi_t m_twi = NRF_DRV_TWI_INSTANCE(TWI1_INSTANCE_ID);

void eep_WriteByte(uint16_t eep_address, unsigned char val);
unsigned char eep_readByte(uint16_t eep_address);
ret_code_t err_codecpy;
float accelX;



void twi_init (void)
{
    ret_code_t err_code;

    const nrf_drv_twi_config_t twi_mma_EEP_config  = {
       .scl                = ARDUINO1_I2C_SCL_PIN,
       .sda                = ARDUINO1_I2C_SDA_PIN,
       .frequency          = NRF_DRV_TWI_FREQ_100K,
       .interrupt_priority = APP_IRQ_PRIORITY_HIGH,
       
    };
    const nrf_drv_twi_config_t twi_config = {
       .scl                = ARDUINO_SCL_PIN,
       .sda                = ARDUINO_SDA_PIN,
       .frequency          = NRF_DRV_TWI_FREQ_100K,
       .interrupt_priority = APP_IRQ_PRIORITY_HIGH,
      // .clear_bus_init     = false
    };

    err_code = nrf_drv_twi_init(&amp;amp;m_twi_mma_EEP, &amp;amp;twi_mma_EEP_config, NULL, NULL); //twi_handler
     APP_ERROR_CHECK(err_code);
    if (NRF_SUCCESS == err_code)
	{
		nrf_drv_twi_enable(&amp;amp;m_twi_mma_EEP);
		NRF_LOG_INFO(&amp;quot;TWI0 init success...&amp;quot;);	
	}
    err_code = nrf_drv_twi_init(&amp;amp;m_twi, &amp;amp;twi_config, NULL, NULL);

       APP_ERROR_CHECK(err_code);
    if (NRF_SUCCESS == err_code)
	{
		nrf_drv_twi_enable(&amp;amp;m_twi);
		NRF_LOG_INFO(&amp;quot;TWI init success...&amp;quot;);	
	}
		
   err_codecpy=err_code;
		nrf_delay_ms(5);
}

unsigned char eep_readByte(uint16_t eep_address){

    unsigned char eep_by_address[2];
unsigned char reg=0;
    eep_by_address[1]   = eep_address;
    eep_by_address[0] = (unsigned char)(eep_address &amp;lt;&amp;lt; 8);
    // setting the start address
    nrf_drv_twi_tx(&amp;amp;m_twi_mma_EEP, I2C_24C128_SLAVE_ADDR, eep_by_address, 2, true);
    // read a byte
    nrf_delay_ms(5);

    nrf_drv_twi_rx(&amp;amp;m_twi_mma_EEP, I2C_24C128_SLAVE_ADDR, &amp;amp;reg,1);

    nrf_delay_ms(5);
	return reg;
}
void eep_WriteByte(uint16_t eep_address, unsigned char val){

    unsigned char eep_by_address[3];
    eep_by_address[2] = val;
    eep_by_address[1] = eep_address;
    eep_by_address[0] = (unsigned char)(eep_address &amp;lt;&amp;lt; 8);

    err_codecpy = nrf_drv_twi_tx(&amp;amp;m_twi_mma_EEP, I2C_24C128_SLAVE_ADDR, eep_by_address, 3, false);
    nrf_delay_ms(5);
    if(err_codecpy == 0)
    {
      NRF_LOG_INFO(&amp;quot;\r\nWritten Sucess&amp;quot;);
    NRF_LOG_FLUSH();
    }

}

int8_t Acc_i2c_Write(uint8_t dev_id, uint8_t reg_addr, uint8_t *reg_data, uint16_t len)
{

    //  NRF_LOG_INFO(&amp;quot;WRITE: dev_id: %x reg_addr: %x reg_data: %x len: %i\n&amp;quot;, dev_id, reg_addr, *reg_data, len);
	int8_t rslt = 0;
	uint8_t data[len + 1];
	data[0] = reg_addr;
	for (uint16_t i = 0; i &amp;lt; len; i++) {
		data[i + 1] = reg_data[i];
	}
	
	rslt = nrf_drv_twi_tx(&amp;amp;m_twi, dev_id, data, len + 1, false);
	APP_ERROR_CHECK(rslt);
        return rslt;
  
}


int8_t Acc_i2c_Read(uint8_t dev_id, uint8_t reg_addr, uint8_t *reg_data, uint16_t len)
{
	int8_t rslt = 0;
   //     NRF_LOG_INFO(&amp;quot;READ: dev_id: %x reg_addr: %x len: %i\n&amp;quot;, dev_id, reg_addr, len);
	rslt = nrf_drv_twi_tx(&amp;amp;m_twi, dev_id, &amp;amp;reg_addr, 1, false);
        APP_ERROR_CHECK(rslt);

	if (rslt == 0)
	{
		rslt = nrf_drv_twi_rx(&amp;amp;m_twi, dev_id, reg_data, len);
	}
    //    NRF_LOG_INFO(&amp;quot;READ: %x&amp;quot;,*reg_data);
	return rslt;
}

void Acc_delay_ms(uint32_t period)
{ 
	
/*if (period==NULL){
period = 1;
}// delay time*/
	
  nrf_delay_ms( period ) ;
}

void BMI_init (void)
{
    sensor.id = BMI160_I2C_ADDR;         //0x69
    sensor.interface = BMI160_I2C_INTF;  //0x00
    sensor.read = &amp;amp;Acc_i2c_Read;
    sensor.write = &amp;amp;Acc_i2c_Write;
    sensor.delay_ms = &amp;amp;Acc_delay_ms;

    rslt = bmi160_init(&amp;amp;sensor);
    APP_ERROR_CHECK(rslt);

    if(rslt == BMI160_OK){
    NRF_LOG_INFO(&amp;quot;BMI160 Initialized...&amp;quot;);
    } else {
    NRF_LOG_INFO(&amp;quot;BMI160 not Initialized...&amp;quot;);
    }NRF_LOG_FLUSH();

    sensor.accel_cfg.odr = BMI160_ACCEL_ODR_1600HZ;
    sensor.accel_cfg.range = BMI160_ACCEL_RANGE_2G;
    sensor.accel_cfg.bw = BMI160_ACCEL_BW_NORMAL_AVG4;
    sensor.accel_cfg.power = BMI160_ACCEL_NORMAL_MODE;

    sensor.gyro_cfg.odr = BMI160_GYRO_ODR_3200HZ;
    sensor.gyro_cfg.range = BMI160_GYRO_RANGE_2000_DPS;
    sensor.gyro_cfg.bw = BMI160_GYRO_BW_NORMAL_MODE;
    sensor.gyro_cfg.power = BMI160_GYRO_NORMAL_MODE;

    rslt = bmi160_set_sens_conf(&amp;amp;sensor);
    APP_ERROR_CHECK(rslt);

     if(rslt == BMI160_OK){
    NRF_LOG_INFO(&amp;quot;sensor Configured...&amp;quot;);
    } else {
    NRF_LOG_INFO(&amp;quot;sensor not Configured...&amp;quot;);
    }NRF_LOG_FLUSH();
}

static void read_sensor_data()
{
      m_xfer_done = false;
      bmi160_get_sensor_data((BMI160_ACCEL_SEL | BMI160_GYRO_SEL | BMI160_TIME_SEL), &amp;amp;accel, &amp;amp;gyro, &amp;amp;sensor);
      /*NRF_LOG_INFO(&amp;quot;DataX:%d&amp;quot;, accel.x);
      NRF_LOG_INFO(&amp;quot;DataY:%d&amp;quot;, accel.y);
      NRF_LOG_INFO(&amp;quot;DataZ:%d&amp;quot;, accel.z);
      NRF_LOG_INFO(&amp;quot;GyroX:%d&amp;quot;, gyro.x);
      NRF_LOG_INFO(&amp;quot;GyroY:%d&amp;quot;, gyro.y);
      NRF_LOG_INFO(&amp;quot;GyroZ:%d&amp;quot;, gyro.z);*/

      /* need the calculation to study  */
      accelX = ((((float)accel.x) / G_TO_LSB) * 9.80655); // in m/s^2
      float gyrX = ((((float)gyro.x) / DPS_TO_LSB) * 0.0174532925); // in rad/sec
      NRF_LOG_INFO(&amp;quot;DataX in m/s^2   : &amp;quot; NRF_LOG_FLOAT_MARKER, 
      NRF_LOG_FLOAT( accelX));
      NRF_LOG_INFO(&amp;quot;DataY in rad/sec : &amp;quot; NRF_LOG_FLOAT_MARKER, 
      NRF_LOG_FLOAT(gyrX));
      NRF_LOG_FLUSH();
}


/**
 * @brief Function for main application entry.
 */
int main(void)
{
    APP_ERROR_CHECK(NRF_LOG_INIT(NULL));
    NRF_LOG_DEFAULT_BACKENDS_INIT();
    NRF_LOG_INFO(&amp;quot;\r\nTWI sensor example started.&amp;quot;);
    NRF_LOG_FLUSH();
    twi_init();
    NRF_LOG_FLUSH();

	unsigned char  reg1 = 0;
        Acc_delay_ms(50);

    BMI_init();
    Acc_delay_ms(100);
    uint8_t reg_addr = BMI160_CHIP_ID_ADDR;
    uint8_t data;
    uint16_t len = 1;
    Acc_delay_ms(1000);
    rslt = bmi160_get_regs(reg_addr, &amp;amp;data, len, &amp;amp;sensor);
    NRF_LOG_INFO(&amp;quot;Data:%x&amp;quot;, data);
    eep_WriteByte(0x0000,data);

    while(true)
    {
        nrf_delay_ms(1000);
		//	    eep_WriteByte(0x0000,&amp;#39;w&amp;#39;);
	 nrf_delay_ms(5);
	//eep_WriteByte(0x0001,&amp;#39;B&amp;#39;);
	 nrf_delay_ms(5);
	   reg1=eep_readByte(0x0000);
	if(reg1!=0){
		NRF_LOG_INFO(&amp;quot;\r\n Read value 00 : %x&amp;quot;,reg1);
                NRF_LOG_FLUSH();
                nrf_delay_ms(5);
	}

	else if(reg1==0){
	 nrf_delay_ms(5);
	}
        reg1=eep_readByte(0x00051);
	if(reg1!=0){
		NRF_LOG_INFO(&amp;quot;\r\n Read value 51 : %c&amp;quot;,reg1);
                NRF_LOG_FLUSH();
                nrf_delay_ms(5);
	}
	else if(reg1==0){
	 nrf_delay_ms(5);
	}
        read_sensor_data();
        eep_WriteByte(0x00051,accelX);
        reg1=eep_readByte(0x00051);
	if(reg1!=0){
		NRF_LOG_INFO(&amp;quot;\r\n Read value 51 : %d&amp;quot;,reg1);
                NRF_LOG_FLUSH();
                nrf_delay_ms(5);
	}
	else if(reg1==0){
	 nrf_delay_ms(5);
	}



    }
}

&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;output:&lt;/p&gt;
&lt;p&gt;&lt;img src="https://devzone.nordicsemi.com/resized-image/__size/320x240/__key/communityserver-discussions-components-files/4/pastedimage1557403131061v1.png" alt=" " /&gt;&lt;/p&gt;
&lt;p&gt;it works in two different TWI wire pins&lt;/p&gt;
&lt;p&gt;that is&lt;/p&gt;
&lt;p&gt;eeprom&amp;nbsp; scl in 27&lt;/p&gt;
&lt;p&gt;eeprom sda in 26&lt;/p&gt;
&lt;p&gt;bmi scl in 30&lt;/p&gt;
&lt;p&gt;bmi sda in 31&lt;/p&gt;
&lt;p&gt;.&lt;/p&gt;
&lt;p&gt;if i give same sda and scl pin to eeprom and bmi. it gives fatal error ;&lt;/p&gt;
&lt;p&gt;can you give how to manage this in single TWI wire.&lt;/p&gt;
&lt;p&gt;i have seen TWI mangr&lt;/p&gt;
&lt;p&gt;in that&lt;/p&gt;
&lt;p&gt;i have difficult to interface the eeprom with bmi&lt;/p&gt;
&lt;p&gt;can you give a solution&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: AT24C512 + BMI160 + NRF52</title><link>https://devzone.nordicsemi.com/thread/186131?ContentTypeID=1</link><pubDate>Thu, 09 May 2019 09:46:06 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:673f6aa5-9531-48c3-8ca6-57fc48fb4421</guid><dc:creator>awneil</dc:creator><description>[quote userid="74103" url="~/f/nordic-q-a/47060/at24c512-bmi160-nrf52/186128"]Can you please tell me what is the difference of&amp;nbsp; TWI0 and TWI1[/quote]
&lt;p&gt;Again, look at the &lt;strong&gt;Product Specification&lt;/strong&gt;!&lt;/p&gt;
&lt;p&gt;The Block Diagram clearly shows you that there are &lt;em&gt;&lt;strong&gt;two&lt;/strong&gt;&lt;/em&gt; TWIM modules - called &amp;quot;TWIM&lt;span style="text-decoration:underline;"&gt;&lt;strong&gt;0&lt;/strong&gt;&lt;/span&gt;&amp;quot; and &amp;quot;TWIM&lt;span style="text-decoration:underline;"&gt;&lt;strong&gt;1&lt;/strong&gt;&lt;/span&gt;&amp;quot;:&lt;/p&gt;
&lt;p&gt;&lt;img src="https://devzone.nordicsemi.com/resized-image/__size/320x240/__key/communityserver-discussions-components-files/4/pastedimage1557394922875v1.png" alt=" " /&gt;&lt;/p&gt;
&lt;p&gt;Yes, you &lt;em&gt;could&lt;/em&gt; use both modules - with one slave on each.&lt;/p&gt;
&lt;p&gt;But the whole point of I2C as a &lt;em&gt;&lt;strong&gt;bus&lt;/strong&gt;&lt;/em&gt; is that each one can support &lt;em&gt;multiple&lt;/em&gt; peripherals - as &lt;a href="https://devzone.nordicsemi.com/members/oys"&gt;Øyvind&lt;/a&gt; showed:&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;img src="https://devzone.nordicsemi.com/resized-image/__size/320x240/__key/communityserver-discussions-components-files/4/pastedimage1557395068543v2.png" alt=" " /&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: AT24C512 + BMI160 + NRF52</title><link>https://devzone.nordicsemi.com/thread/186128?ContentTypeID=1</link><pubDate>Thu, 09 May 2019 09:38:18 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:3e3394d1-23c1-49c1-b73a-1ef2c44e2170</guid><dc:creator>Sunil vignesh</dc:creator><description>&lt;p&gt;Hi, Can you please tell me what is the difference of&amp;nbsp; TWI0 and TWI1 &lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="c_cpp"&gt;#ifndef TWI0_ENABLED
#define TWI0_ENABLED 1
#endif
// &amp;lt;q&amp;gt; TWI0_USE_EASY_DMA  - Use EasyDMA (if present)
 

#ifndef TWI0_USE_EASY_DMA
#define TWI0_USE_EASY_DMA 1
#endif

// &amp;lt;/e&amp;gt;

// &amp;lt;e&amp;gt; TWI1_ENABLED - Enable TWI1 instance
//==========================================================
#ifndef TWI1_ENABLED
#define TWI1_ENABLED 0
#endif
// &amp;lt;q&amp;gt; TWI1_USE_EASY_DMA  - Use EasyDMA (if present)
 

#ifndef TWI1_USE_EASY_DMA
#define TWI1_USE_EASY_DMA 0
#endif&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;shall i enable both twi instance.&lt;/p&gt;
&lt;p&gt;what is&lt;/p&gt;
&lt;p&gt;TWI0_USE_EASY_DMA 1&amp;nbsp; - use case?&lt;/p&gt;
&lt;p&gt;#define TWI1_USE_EASY_DMA 0 - use case?&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;if i enable both twi instance&lt;/p&gt;
&lt;p&gt;means&lt;/p&gt;
&lt;p&gt;the EASY_DMA of TWI1 also be &amp;#39;1&amp;#39; or &amp;#39;0&amp;#39;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: AT24C512 + BMI160 + NRF52</title><link>https://devzone.nordicsemi.com/thread/186125?ContentTypeID=1</link><pubDate>Thu, 09 May 2019 09:34:30 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:9c6456e6-59f8-4ab5-b69c-270a8595bb6f</guid><dc:creator>Sunil vignesh</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;can i use&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;#define TWI0_ENABLED 1
#define TWI1_ENABLED 1&lt;br /&gt;&lt;br /&gt;i.e&lt;br /&gt; two TWI Instance. one for EEPROM and another for SENSOR. &lt;br /&gt;it means is it TWIM or TWIS ?&lt;br /&gt;&lt;br /&gt;is it advisable to go with two twi instance at a time &lt;br /&gt;&lt;/code&gt;&lt;/pre&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: AT24C512 + BMI160 + NRF52</title><link>https://devzone.nordicsemi.com/thread/186098?ContentTypeID=1</link><pubDate>Thu, 09 May 2019 08:13:27 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:b65edeb3-ccb7-4a60-acb5-6d303355f362</guid><dc:creator>awneil</dc:creator><description>[quote userid="77062" url="~/f/nordic-q-a/47060/at24c512-bmi160-nrf52/186072"]I recommend reading the &lt;a href="https://infocenter.nordicsemi.com/topic/com.nordic.infocenter.nrf52832.ps.v1.1/twim.html?cp=3_1_0_32#concept_scx_f5p_xr"&gt;TWIM chapter&lt;/a&gt;&amp;nbsp;and the &lt;a href="https://infocenter.nordicsemi.com/topic/com.nordic.infocenter.nrf52832.ps.v1.1/twis.html?cp=3_1_0_33#concept_agw_dtf_wr"&gt;TWIS chapter&lt;/a&gt;&amp;nbsp;in the product specification for nRF52832[/quote]
&lt;p&gt;+1&lt;/p&gt;
&lt;p&gt;But could you clarify the distinction between those and the &amp;quot;&lt;a href="https://infocenter.nordicsemi.com/topic/com.nordic.infocenter.nrf52832.ps.v1.1/twi.html?cp=3_1_0_48#concept_rhy_rzp_sr" rel="noopener noreferrer" target="_blank"&gt;TWI &amp;mdash; I&lt;sup class="ph sup"&gt;2&lt;/sup&gt;C compatible two-wire interface&lt;/a&gt;&amp;quot; - also&amp;nbsp;&lt;span&gt;in the product specification for nRF52832?&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;I find it unclear whether&amp;nbsp;it is a separate module, or if TWIM and/or TWIS are just &amp;quot;operating modes&amp;quot; of the TWI module?&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;Or TWI is an &amp;quot;operating mode&amp;quot; of the TWIM module?&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;Or what??&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;The &lt;a href="https://infocenter.nordicsemi.com/topic/com.nordic.infocenter.nrf52832.ps.v1.1/blockdiagram.html?cp=3_1_0_2#overview" rel="noopener noreferrer" target="_blank"&gt;block diagram&lt;/a&gt; is not helpful as it shows &lt;em&gt;&lt;strong&gt;no&lt;/strong&gt;&lt;/em&gt; &amp;quot;TWI&amp;quot; module.&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;EDIT&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;and are there two TWIS modules &lt;em&gt;&lt;strong&gt;plus&lt;/strong&gt;&lt;/em&gt; two TWIM modules - or is it just a &lt;em&gt;&lt;strong&gt;total&lt;/strong&gt;&lt;/em&gt; of two modules, each of which can be either TWIM &lt;em&gt;or&lt;/em&gt; TWIS ?&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;EDIT 2&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;The block diagram clearly suggests that&amp;nbsp;there two TWIS modules&amp;nbsp;&lt;em&gt;&lt;strong&gt;plus&lt;/strong&gt;&lt;/em&gt;&amp;nbsp;two TWIM modules:&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;&lt;img src="https://devzone.nordicsemi.com/resized-image/__size/320x240/__key/communityserver-discussions-components-files/4/pastedimage1557395783143v1.png" alt=" " /&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;but the &amp;#39;&lt;a href="https://infocenter.nordicsemi.com/topic/struct_nrf52/struct/nrf52832_ps.html" rel="noopener noreferrer" target="_blank"&gt;Key Features&lt;/a&gt;&amp;#39; at the start of the Product Specification says:&lt;/span&gt;&lt;/p&gt;
&lt;ul class="ul" id="nrf52832_ps__ul_klv_1rg_3s"&gt;
&lt;li class="li"&gt;&lt;em&gt;&lt;strong&gt;Up to 2&lt;/strong&gt;&lt;/em&gt;x I2C compatible 2-wire master/slave&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;span&gt;So it looks like the block diagram is misleading?&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;&lt;/span&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: AT24C512 + BMI160 + NRF52</title><link>https://devzone.nordicsemi.com/thread/186091?ContentTypeID=1</link><pubDate>Thu, 09 May 2019 07:58:59 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:6a12a799-6162-4de1-b6a4-cdacc36e8c23</guid><dc:creator>awneil</dc:creator><description>[quote userid="74103" url="~/f/nordic-q-a/47060/at24c512-bmi160-nrf52/186004"]which one i need to act as slave and master[/quote]
&lt;p&gt;Neither - they would &lt;em&gt;&lt;strong&gt;both&lt;/strong&gt; &lt;/em&gt;be slaves!&lt;/p&gt;
&lt;p&gt;The nRF52832 would be the master - as &lt;a href="https://devzone.nordicsemi.com/members/oys"&gt;Øyvind&lt;/a&gt; explains.&lt;/p&gt;
&lt;p&gt;It sounds like you need to do some study on the basics of I2C.&lt;/p&gt;
&lt;p&gt;It is a very well-established and widely-used standard - so there is plenty of material available; eg,&lt;/p&gt;
&lt;p&gt;&lt;a href="https://www.nxp.com/docs/en/user-guide/UM10204.pdf"&gt;https://www.nxp.com/docs/en/user-guide/UM10204.pdf&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;&lt;a href="https://en.wikipedia.org/wiki/I%C2%B2C"&gt;https://en.wikipedia.org/wiki/I%C2%B2C&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;&lt;a href="https://i2c.info/"&gt;https://i2c.info/&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;&lt;a href="https://learn.sparkfun.com/tutorials/i2c/all"&gt;https://learn.sparkfun.com/tutorials/i2c/all&lt;/a&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: AT24C512 + BMI160 + NRF52</title><link>https://devzone.nordicsemi.com/thread/186072?ContentTypeID=1</link><pubDate>Thu, 09 May 2019 07:00:58 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:47c3148c-c948-45ba-8d91-1be0b7e0dd94</guid><dc:creator>&amp;#216;yvind</dc:creator><description>&lt;p&gt;Hi,&amp;nbsp;&lt;br /&gt;&lt;br /&gt;I recommend reading the &lt;a href="https://infocenter.nordicsemi.com/topic/com.nordic.infocenter.nrf52832.ps.v1.1/twim.html?cp=3_1_0_32#concept_scx_f5p_xr"&gt;TWIM chapter&lt;/a&gt;&amp;nbsp;and the &lt;a href="https://infocenter.nordicsemi.com/topic/com.nordic.infocenter.nrf52832.ps.v1.1/twis.html?cp=3_1_0_33#concept_agw_dtf_wr"&gt;TWIS chapter&lt;/a&gt;&amp;nbsp;in the product specification for nRF52832.&lt;br /&gt;&lt;br /&gt;The master device (TWIM) is in your case the nRF58832, while sensor and EEPROM are slaves.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;img src="https://devzone.nordicsemi.com/resized-image/__size/320x240/__key/support-attachments/beef5d1b77644c448dabff31668f3a47-dbd557fb4e014b08b8e8c10e3f90cea0/pastedimage1557384437118v1.png" alt=" " /&gt;&lt;/p&gt;
&lt;p&gt;If your nRF52832 will work as a slave (TWIS), then you need another microcontroller functioning as a master.&lt;/p&gt;
&lt;p&gt;You will find a suitable example to communicate with two devices in the&amp;nbsp;&lt;a href="https://infocenter.nordicsemi.com/topic/com.nordic.infocenter.sdk5.v15.3.0/twi_transaction_mgr_example.html?cp=5_0_4_6_44"&gt;TWI Transaction Manager Example&lt;/a&gt;&amp;nbsp;which I linked to yesterday.&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: AT24C512 + BMI160 + NRF52</title><link>https://devzone.nordicsemi.com/thread/186004?ContentTypeID=1</link><pubDate>Wed, 08 May 2019 14:07:15 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:f39b38fc-bd7a-4e13-a302-df7d43ee516b</guid><dc:creator>Sunil vignesh</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;Thank you for your reply.,&lt;/p&gt;
&lt;p&gt;i have used the twi scanner, and sensor.&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;if i going to use one sensor and one EEPROM.&lt;/p&gt;
&lt;p&gt;which one i need to act as slave and master.&lt;/p&gt;
&lt;p&gt;how to mange the two communications&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: AT24C512 + BMI160 + NRF52</title><link>https://devzone.nordicsemi.com/thread/185979?ContentTypeID=1</link><pubDate>Wed, 08 May 2019 13:00:52 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:057e0b91-51e5-4f66-b738-8760a50ad59f</guid><dc:creator>&amp;#216;yvind</dc:creator><description>&lt;p&gt;Hello,&amp;nbsp;&lt;br /&gt;&lt;br /&gt;The nRF5 SDK includes several examples of how to use the TWI peripheral.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;a href="https://infocenter.nordicsemi.com/topic/com.nordic.infocenter.sdk5.v15.3.0/twi_transaction_mgr_example.html?cp=5_0_4_6_44"&gt;examples\peripheral\twi_master_using_nrf_twi_mngr&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;&lt;a href="https://infocenter.nordicsemi.com/topic/com.nordic.infocenter.sdk5.v15.3.0/twi_master_with_twis_slave_example.html?cp=5_0_4_6_45"&gt;examples\peripheral\twi_master_with_twis_slave&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;&lt;a href="https://infocenter.nordicsemi.com/topic/com.nordic.infocenter.sdk5.v15.3.0/twi_scanner_example.html?cp=5_0_4_6_42"&gt;examples\peripheral\twi_scanner&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;&lt;a href="https://infocenter.nordicsemi.com/topic/com.nordic.infocenter.sdk5.v15.3.0/twi_sensor_example.html?cp=5_0_4_6_43"&gt;examples\peripheral\twi_sensor&lt;br /&gt;&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;A good place to start is with the TWI Scanner to ensure you can find the devices on the bus.&amp;nbsp;&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></channel></rss>