<?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>I2C interrupt while softdevice enabled</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/4367/i2c-interrupt-while-softdevice-enabled</link><description>Hello, 
 i&amp;#39;m sorry for asking again, but i read nearly all threads about I2C and didn&amp;#39;t get any answer yet. 
 I want to use the interrupt to control the I2C sequences and safe energy (instead of using while loops) 
 I replaced the NRF_TWI1-&amp;gt;INTENSET</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Mon, 17 Nov 2014 14:24:37 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/4367/i2c-interrupt-while-softdevice-enabled" /><item><title>RE: I2C interrupt while softdevice enabled</title><link>https://devzone.nordicsemi.com/thread/15520?ContentTypeID=1</link><pubDate>Mon, 17 Nov 2014 14:24:37 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:de15d7c3-e2cb-48c1-a697-eabca83b1307</guid><dc:creator>Krzysztof Chruscinski</dc:creator><description>&lt;p&gt;If  NRF_TWI1-&amp;gt;INTENSET=... is removed then you have disabled peripheral interrupt and it will never go to nvic. There are two stages of interrupt control: in the peripheral using INTENSET/INTENCLR you enable particular peripheral events as interrupts and then in NVIC you control general interrupt from this peripheral.&lt;/p&gt;
&lt;p&gt;It is recommended to access nvic using softdevice API. As TWI is not used by softdevice you can access TWI registers directly.&lt;/p&gt;
&lt;p&gt;As mnhs mentioned, it is vital to set proper interrupt priority (1 or 3, you can also use app_irq_priority_t from app_util_platform.h in SDK)&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: I2C interrupt while softdevice enabled</title><link>https://devzone.nordicsemi.com/thread/15519?ContentTypeID=1</link><pubDate>Sat, 15 Nov 2014 15:41:08 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:899978e5-6d4a-46be-8443-43190a6658d7</guid><dc:creator>mnhs</dc:creator><description>&lt;p&gt;Try to use  sd_nvic_enableIRQ(SPI1_TWI1_IRQn); instead of &amp;quot;non-sd&amp;quot; NVIC_EnableIRQ(). By default all the interrupt priorities are set to 0 (highest priority) which is reserved exclusively for SoftDevice. Thus, the SoftDevice may become unstable. Alternatively, you can try to set the priority of SPI1_TWI1_IRQn interrupt to 1 - 3.&lt;/p&gt;
&lt;p&gt;I am also not sure if you can put the sd_app_evt_wait directly into interrupts. It should be in the main cycle. When the handler ends it job, it jumps back to the main cycle and goes to sd_app_evt_wait.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>