<?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>Simulate an Event</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/91249/simulate-an-event</link><description>Hello dear Nordic. I am wondering if I can simulate a hardware event by the software by writing any value to the event register, or in other words to create artificial interrupt trigger? Or maybe you have a special API for such a thing? 
 
 
 Best regards</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Thu, 25 Aug 2022 11:17:50 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/91249/simulate-an-event" /><item><title>RE: Simulate an Event</title><link>https://devzone.nordicsemi.com/thread/383245?ContentTypeID=1</link><pubDate>Thu, 25 Aug 2022 11:17:50 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:18eba2c1-11fb-49a3-8788-17027ab33c71</guid><dc:creator>GENADI MANOILENKO</dc:creator><description>&lt;p&gt;I have some issue with saving data to flash and NFC processing in the background, but that&amp;#39;s&amp;nbsp;another story. There is another way to check my hypothesis.&amp;nbsp;&lt;br /&gt;Thank you&lt;br /&gt;Best regards, Genadi&lt;/p&gt;
&lt;div id="gtx-trans" style="left:567px;position:absolute;top:22.6335px;"&gt;
&lt;div class="gtx-trans-icon"&gt;&lt;/div&gt;
&lt;/div&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Simulate an Event</title><link>https://devzone.nordicsemi.com/thread/383212?ContentTypeID=1</link><pubDate>Thu, 25 Aug 2022 09:20:52 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:47c979a3-cb98-46aa-a5ad-1639e5c9adef</guid><dc:creator>J&amp;#248;rgen Holmefjord</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;I tested this now as well, but it seems that the event registers won&amp;#39;t accept writing values of 1. I assumed that since the register is defined as read/write, it should be possible to set it to 1, but there might be some internal limitations in the HW that prevent the application from setting the register to anything other than &amp;#39;0&amp;#39;.&lt;/p&gt;
&lt;p&gt;This is not the intended use of the register. What do you want to achieve by setting it to 1? The peripheral will not be in the correct state if you generate a false event, so your application will likely not function properly. If you want to test part of your code that is executed when the event is generated, you may modify the interrupt handler to check another variable than the event register, that you will have full control over.&lt;/p&gt;
&lt;p&gt;Best regards,&lt;br /&gt;Jørgen&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Simulate an Event</title><link>https://devzone.nordicsemi.com/thread/383199?ContentTypeID=1</link><pubDate>Thu, 25 Aug 2022 08:53:28 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:cebfae5e-f092-4d9f-b78e-c73dffe8bb0a</guid><dc:creator>GENADI MANOILENKO</dc:creator><description>&lt;p&gt;Excuse me Jorgen, but I am afraid I closed the ticket too soon.&amp;nbsp;&lt;br /&gt;I implemented this function to my code and it works perfectly, I may see interrupt toggling. However, when I set &amp;quot;1&amp;quot; to the event register its value remains &amp;#39;0&amp;#39;. I corrected the address and added missing digit.&lt;/p&gt;
&lt;p&gt;Should I set it to some &amp;quot;magic&amp;quot; number to make it work?&lt;/p&gt;
&lt;p&gt;Looking forward to hearing from you.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Simulate an Event</title><link>https://devzone.nordicsemi.com/thread/383064?ContentTypeID=1</link><pubDate>Wed, 24 Aug 2022 12:19:04 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:b8935ff2-5bc0-452e-b5d8-6678dd87f0ae</guid><dc:creator>GENADI MANOILENKO</dc:creator><description>&lt;p&gt;Thank you very much, Jorgen, for such a comprehensive answer.&lt;/p&gt;
&lt;p&gt;&lt;br /&gt;Best wishes, Genadi.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Simulate an Event</title><link>https://devzone.nordicsemi.com/thread/383054?ContentTypeID=1</link><pubDate>Wed, 24 Aug 2022 11:46:26 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:4ddb86ca-5705-4fce-914b-e67c97ab6bb1</guid><dc:creator>J&amp;#248;rgen Holmefjord</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;You should be able to write &amp;#39;1&amp;#39; to the EVENT register to set the event, but it will not trigger any interrupt. The interrupt can be triggered using the&amp;nbsp;&lt;a href="https://www.keil.com/pack/doc/CMSIS/Core/html/group__NVIC__gr.html#ga3b885147ef9965ecede49614de8df9d2"&gt;NVIC_SetPendingIRQ&lt;/a&gt;() API. If you have defined an IRQ handler that checks the EVENT register, the event will be handled if you have written the register to &amp;#39;1&amp;#39; before triggering the interrupt.&lt;/p&gt;
&lt;p&gt;Note that there is a typo in your code snippet. The address should be 0x400&lt;strong&gt;0&lt;/strong&gt;5104.&lt;/p&gt;
&lt;p&gt;Best regards,&lt;br /&gt;Jørgen&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>