<?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>interrupt based i2c with softdevice</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/9504/interrupt-based-i2c-with-softdevice</link><description>Hello, 
 I am using SDK 9.0 and softdevice 8.0 and testing on Evaluation board.
I referred the i2c example driver suggested by Torbjorn in this link 
 I wrote a simple driver for eeprom and succeeded without the softdevice.
But when I integrate with</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Tue, 27 Oct 2015 09:50:08 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/9504/interrupt-based-i2c-with-softdevice" /><item><title>RE: interrupt based i2c with softdevice</title><link>https://devzone.nordicsemi.com/thread/35087?ContentTypeID=1</link><pubDate>Tue, 27 Oct 2015 09:50:08 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:5b082169-1bb0-4121-804b-78ab2ba836a6</guid><dc:creator>MartinBL</dc:creator><description>&lt;p&gt;@Brian: Let us continue this case here: &lt;a href="https://devzone.nordicsemi.com/question/55186/twi-in-low-power/"&gt;TWI in Low power&lt;/a&gt;.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: interrupt based i2c with softdevice</title><link>https://devzone.nordicsemi.com/thread/35086?ContentTypeID=1</link><pubDate>Tue, 27 Oct 2015 00:30:22 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:9994c197-92a6-4155-9dd6-b8a5e4fa8412</guid><dc:creator>Brian</dc:creator><description>&lt;p&gt;Is this the correct way to be using the driver in non-blocking mode? Trying to achieve the lowest possible power. The event handler gets called, but it doesn&amp;#39;t appear to wake up from WFE or power_manage if running with BLE. Thanks! Brian&lt;/p&gt;
&lt;pre&gt;&lt;code&gt; nrf_drv_twi_init(&amp;amp;p_twi_instance, &amp;amp;p_twi_config, twi_event_handler); 
  nrf_drv_twi_enable(&amp;amp;p_twi_instance); // Enable the TWI instance   

while(1) {

    nrf_drv_twi_rx(&amp;amp;p_twi_instance, 0x55, dummy_data, 7, false);          
    //power_manage()                                      
    __WFE();   
}

static void twi_event_handler(nrf_drv_twi_evt_t *p_evt){   
    if(p_evt-&amp;gt;type == NRF_DRV_TWI_RX_DONE)
    {

      SEGGER_RTT_printf(0, &amp;quot;\n\nDATA: &amp;quot;, dummy_data);
      for(i=0;i&amp;lt;7;i++) SEGGER_RTT_printf(0, &amp;quot;%02x &amp;quot;, dummy_data[i]);

    } 
}
&lt;/code&gt;&lt;/pre&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: interrupt based i2c with softdevice</title><link>https://devzone.nordicsemi.com/thread/35085?ContentTypeID=1</link><pubDate>Mon, 12 Oct 2015 07:44:51 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:74aca575-a5b1-4d87-8e69-f270cbe3f4b0</guid><dc:creator>sowmya</dc:creator><description>&lt;p&gt;Yes, we can use event_handler for I2C. Thank you for the relpy. I tested the both drivers given with SDK and my custom driver(interrupt based , no event handler). Thank you for the support Martin.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: interrupt based i2c with softdevice</title><link>https://devzone.nordicsemi.com/thread/35084?ContentTypeID=1</link><pubDate>Mon, 12 Oct 2015 07:41:49 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:7f219f98-edc2-4cae-a3b9-cc448391b318</guid><dc:creator>MartinBL</dc:creator><description>&lt;p&gt;The TWI driver in SDK 9.0.0 can actually be used in both blocking and interrupt driven mode. Just pass an event handler to &lt;code&gt;nrf_drv_twi_init(p_instance, p_config , event_handler);&lt;/code&gt;. However, I&amp;#39;m sure you can make a more efficient, interrupt driven TWI driver yourself.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: interrupt based i2c with softdevice</title><link>https://devzone.nordicsemi.com/thread/35083?ContentTypeID=1</link><pubDate>Sat, 10 Oct 2015 05:05:40 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:c8a9db1d-de25-4a66-83f4-1665daf7c69a</guid><dc:creator>sowmya</dc:creator><description>&lt;p&gt;Hi, I tested the eeprom using the i2c driver provided with sdk. But I wanted the interrupt based and not to use state machine based which is using in twi driver. So I wrote my own driver and interrupt based and it is working without PPI or softdevice calls. Thank you for the reply regarding PPI usage in twi driver.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: interrupt based i2c with softdevice</title><link>https://devzone.nordicsemi.com/thread/35082?ContentTypeID=1</link><pubDate>Fri, 09 Oct 2015 12:56:37 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:67fac0e2-5fd4-46ee-bb7c-d8e6a0f80fc9</guid><dc:creator>MartinBL</dc:creator><description>&lt;p&gt;Hi. Sorry for the late response. Torbjørn&amp;#39;s example is based on an old TWI driver. The use of PPI channels is a legacy from revision 2 of the nRF51 which had a product anomaly causing the TWI to malfunction (the anomaly is documented in &lt;a href="http://infocenter.nordicsemi.com/index.jsp"&gt;PAN V2.3&lt;/a&gt;). The workaround was to use PPI channels. To make it even more complicated the TWI and softdevice would sometimes fight over the same PPI channels, and that is why you see specialized softdevice calls in Torbjørn&amp;#39;s TWI driver to handle proper delegation of PPI channels.&lt;/p&gt;
&lt;p&gt;Nowadays, however, if you use the latest 3rd revision nRF51, the PAN is fixed and you don&amp;#39;t need to use the PPI channels at all. I realize it might be a little late to say now, but in SDK 9 there is a brand new TWI driver and I would highly recommend that you use this driver instead of the old one found in your example.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: interrupt based i2c with softdevice</title><link>https://devzone.nordicsemi.com/thread/35081?ContentTypeID=1</link><pubDate>Thu, 01 Oct 2015 06:15:37 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:1e53bc3e-639a-4c4c-b740-d4d59a2f3ea9</guid><dc:creator>sowmya</dc:creator><description>&lt;p&gt;The issue is fixed. We have to first initialise softdevice then initialise I2C.
One more question is , is it mandatory to use PPI or soft device calls in i2c?&lt;/p&gt;
&lt;p&gt;My application is running without PPI or softdevice calls. I am using NVIC to enable interrupts.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: interrupt based i2c with softdevice</title><link>https://devzone.nordicsemi.com/thread/35080?ContentTypeID=1</link><pubDate>Thu, 01 Oct 2015 05:22:47 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:969e35be-284d-4bd6-a83f-87d243411954</guid><dc:creator>sowmya</dc:creator><description>&lt;p&gt;Hello I re-checked and still &lt;strong&gt;I2C is not working&lt;/strong&gt; with softdevice. Anyone can help to fix this?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: interrupt based i2c with softdevice</title><link>https://devzone.nordicsemi.com/thread/35079?ContentTypeID=1</link><pubDate>Wed, 30 Sep 2015 13:01:50 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:3c588d33-b8af-4efa-a33f-b26a26644033</guid><dc:creator>sowmya</dc:creator><description>&lt;p&gt;I have done 2 tests:&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;I2C with template application : I2C working, BT not working.&lt;/li&gt;
&lt;li&gt;I2C with HRS application : I2C and BT not working.&lt;/li&gt;
&lt;/ol&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: interrupt based i2c with softdevice</title><link>https://devzone.nordicsemi.com/thread/35078?ContentTypeID=1</link><pubDate>Wed, 30 Sep 2015 13:00:48 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:d9ff4121-9376-41e5-b51b-c2cc4da5af2b</guid><dc:creator>sowmya</dc:creator><description>&lt;p&gt;I tested heart rate application without I2C and changed the clock source, and it is working. But after integrating i2c driver in main.c of hrs application, code is getting hardfault .&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: interrupt based i2c with softdevice</title><link>https://devzone.nordicsemi.com/thread/35077?ContentTypeID=1</link><pubDate>Wed, 30 Sep 2015 12:54:38 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:f68c7d88-7d61-4228-8f13-99de8c0734c1</guid><dc:creator>MartinBL</dc:creator><description>&lt;p&gt;So you are all good or are you still stuck somewhere?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: interrupt based i2c with softdevice</title><link>https://devzone.nordicsemi.com/thread/35076?ContentTypeID=1</link><pubDate>Wed, 30 Sep 2015 12:39:13 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:b0ea43eb-229f-47f5-b80f-0d06fa452796</guid><dc:creator>sowmya</dc:creator><description>&lt;p&gt;For BLE advertise I am using the same main.c file provided by nordic to initialise stack and SDK but it was not advertising and was hanged in SOFTDEVICE_HANDLER_INIT(NRF_CLOCK_LFCLKSRC_XTAL_20_PPM, NULL);&lt;/p&gt;
&lt;p&gt;Now I changed the source to NRF_CLOCK_LFCLKSRC_RC_250_PPM_8000MS_CALIBRATION, it is working.&lt;/p&gt;
&lt;p&gt;As I am doing some tests on the BT stack, it was working with clock source NRF_CLOCK_LFCLKSRC_XTAL_20_PPM.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: interrupt based i2c with softdevice</title><link>https://devzone.nordicsemi.com/thread/35075?ContentTypeID=1</link><pubDate>Wed, 30 Sep 2015 12:34:51 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:203327b9-6ef3-44e5-9d47-227ad1f52469</guid><dc:creator>MartinBL</dc:creator><description>&lt;p&gt;Do you mind uploading your main.c file and/or other relevant code?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>