<?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>Who and how wakes up CPU when BLE notification is received?</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/10242/who-and-how-wakes-up-cpu-when-ble-notification-is-received</link><description>Ok, so please bear with me as I&amp;#39;m quite a greenhorn both in embedded world as in nRF series chips. My aim is to understand how deep sleep works. I might use wrong terminology too. 
 This is my current understanding: 
 I have one nRF chipset (does not</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Fri, 13 Nov 2015 12:33:52 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/10242/who-and-how-wakes-up-cpu-when-ble-notification-is-received" /><item><title>RE: Who and how wakes up CPU when BLE notification is received?</title><link>https://devzone.nordicsemi.com/thread/38027?ContentTypeID=1</link><pubDate>Fri, 13 Nov 2015 12:33:52 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:f836ddac-8f13-419f-b83e-eac17fba8f2d</guid><dc:creator>Primož Kralj</dc:creator><description>&lt;p&gt;Nevermind, found &lt;a href="https://devzone.nordicsemi.com/question/60/what-is-connection-parameters/?answer=67#post-id-67"&gt;a great answer&lt;/a&gt; explaining whole structure.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Who and how wakes up CPU when BLE notification is received?</title><link>https://devzone.nordicsemi.com/thread/38026?ContentTypeID=1</link><pubDate>Fri, 13 Nov 2015 12:24:50 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:8d69bc01-d84b-43c8-899c-e29731c081a2</guid><dc:creator>Primož Kralj</dc:creator><description>&lt;p&gt;Just to make sure; the interval between packets are determined by &lt;a href="http://infocenter.nordicsemi.com/topic/com.nordic.infocenter.s110.api.v8.0.0/structble__gap__conn__params__t.html?resultof=%22%62%6c%65%5f%67%61%70%5f%63%6f%6e%6e%5f%70%61%72%61%6d%73%5f%74%22%20"&gt;ble_gap_conn_params_t&lt;/a&gt;, with min and min_conn_interval, right?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Who and how wakes up CPU when BLE notification is received?</title><link>https://devzone.nordicsemi.com/thread/38025?ContentTypeID=1</link><pubDate>Fri, 13 Nov 2015 11:34:23 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:a4825c6f-2b1d-4d02-a354-55c28425ad97</guid><dc:creator>Primož Kralj</dc:creator><description>&lt;p&gt;Thanks, this shed even more light on the whole procedure, especially on advertising/connecting phase.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Who and how wakes up CPU when BLE notification is received?</title><link>https://devzone.nordicsemi.com/thread/38024?ContentTypeID=1</link><pubDate>Fri, 13 Nov 2015 11:30:03 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:15b9aaf2-e2ef-4400-b221-0e6ac10e8fed</guid><dc:creator>RK</dc:creator><description>&lt;p&gt;No it&amp;#39;s simpler than that.&lt;/p&gt;
&lt;p&gt;Your question says &amp;#39;bonded&amp;#39; but I don&amp;#39;t know if you mean that or just &amp;#39;connected to&amp;#39;. Dealing with the connected case first.&lt;/p&gt;
&lt;p&gt;When two devices are in a connection they exchange timing information about when each connection event will start (this is all in the bluetooth spec). So all the central has to do is wake up just before that time, send out a packet and listen, then it goes back to sleep until the next event. The peripheral does likewise, except it may be allowed to skip events and only reply occasionally, so it can sleep for longer, just waking up in time to listen for the central. That ability to skip events is &amp;#39;slave latency&amp;#39;.&lt;/p&gt;
&lt;p&gt;So the thing which wakes up the CPU is just a timer. Timer interrupts cause __WFE and __WFI to return and the CPU processes them.&lt;/p&gt;
&lt;p&gt;To complete the picture, if the devices aren&amp;#39;t in a connection then one is advertising and one is listening. Again these are timed. The peripheral sends out some advertising packets, then goes to sleep for a defined time + a bit of randomness, then sends out the next one. Similarly the central wakes up, listens for a while on each of the channels, then sleeps for a time. It requires the central to happen to be listening when the peripheral happens to be sending advertising packets, before the devices discover each other, that&amp;#39;s why discovery can take a long time.&lt;/p&gt;
&lt;p&gt;In all cases however, the softdevice knows when it&amp;#39;s going to wake up and send, or listen, before it goes to sleep, so it just uses a timer to wake it up. Nothing is listening all the time .. this is one of the reasons that BTLE is low energy.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Who and how wakes up CPU when BLE notification is received?</title><link>https://devzone.nordicsemi.com/thread/38023?ContentTypeID=1</link><pubDate>Fri, 13 Nov 2015 11:11:32 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:9b04b1eb-e919-4ad4-9d90-bb951cc563a7</guid><dc:creator>Primož Kralj</dc:creator><description>&lt;p&gt;Excellent, I fully understand now. Thanks Petter.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Who and how wakes up CPU when BLE notification is received?</title><link>https://devzone.nordicsemi.com/thread/38022?ContentTypeID=1</link><pubDate>Fri, 13 Nov 2015 11:08:45 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:4af57f23-bce1-4eea-92b2-cb934746277b</guid><dc:creator>Petter Myhre</dc:creator><description>&lt;p&gt;If you are in a connection it is actually the peripheral/slave that is listening for packets from the central/master. It doesn&amp;#39;t need to listen all the time, because the master have a told the slave what connection interval to use. On every connection interval there is a connection event. RTC0 is used to keep track of when the master should transmit, and when the slave should listen. So every connection interval the master transmits a packet, and the slave listens and receives it. Then the master listens and the slave transmits a packet. One packet will be sent each way on every connection event(if the slave doesn&amp;#39;t use slave latency). If there is no data to send, they will be empty.&lt;/p&gt;
&lt;p&gt;If the slave has a notification to send, it will have to wait for the next connection event, then it receives a packet from the master, and then it sends the notification.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>