<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>LPC Microcontrollers中的主题 Re: wakeup from tilt sensor filter</title>
    <link>https://community.nxp.com/t5/LPC-Microcontrollers/wakeup-from-tilt-sensor-filter/m-p/533383#M10604</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;STRONG&gt;Content originally posted in LPCWare by 1234567890 on Thu Jul 17 09:02:06 MST 2014&lt;/STRONG&gt;&lt;BR /&gt;&lt;SPAN&gt;Well, first of all: Your ISR is called &lt;/SPAN&gt;&lt;STRONG&gt;after&lt;/STRONG&gt;&lt;SPAN&gt; waking up; the device has already left sleep mode at this time. The ISR is the result of the interrupt.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;There are 2 possibilities: &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;1.) After waking up you can monitor your pin and decide with software, if it is real or fake. Keyword 'debounce routine'. That's not so good, especially if you have a battery powered application (current consumption, the time in sleep mode can be much shorter).&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;2.) Debounce your pin with external hardware (e.g. R and C) to filter the noise.&lt;/SPAN&gt;&lt;BR /&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 15 Jun 2016 19:36:01 GMT</pubDate>
    <dc:creator>lpcware</dc:creator>
    <dc:date>2016-06-15T19:36:01Z</dc:date>
    <item>
      <title>wakeup from tilt sensor filter</title>
      <link>https://community.nxp.com/t5/LPC-Microcontrollers/wakeup-from-tilt-sensor-filter/m-p/533382#M10603</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;STRONG&gt;Content originally posted in LPCWare by tbelo on Mon Jul 14 04:24:39 MST 2014&lt;/STRONG&gt;&lt;BR /&gt;&lt;SPAN&gt;Hi,&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;In my scenario I have 2 sources to wakeup from deep-sleep: a timer and a tilt sensor. &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Everything works fine unless the noise from the tilt sensor that causes the system to wakeup too easy.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Can I add a timer and a counter to the WAKEUP_IRQHandler only for the tilt sensor pin to reduce noise ?&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Following is my WAKEUP_IRQHandler code (wakeFromAlarmFlag is a volatile used for alarm purposes) :&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;TABLE border="1"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD bgcolor="#cacaca"&gt; &lt;PRE&gt;
void WAKEUP_IRQHandler(void){
/*CLEAR sleepdeep bit */
SCB-&amp;gt;SCR&amp;amp;=~(1&amp;lt;&amp;lt;2);

/* Clear the match output register value */
LPC_TMR16B0-&amp;gt;EMR&amp;nbsp; &amp;amp;= ~(1&amp;lt;&amp;lt;0);

/* Disable and Reset Timer */
LPC_TMR16B0-&amp;gt;TCR = (1&amp;lt;&amp;lt;1);

uint32_t regVal;
regVal = LPC_SYSCON-&amp;gt;STARTSRP0;
&amp;nbsp; if ((regVal &amp;amp; (1 &amp;lt;&amp;lt; 8)) != 0){
&amp;nbsp; LPC_SYSCON-&amp;gt;STARTRSRP0CLR|=(1&amp;lt;&amp;lt;(8)); //1 = Writing 1 resets the start signal. MISO TIMER16
&amp;nbsp; LPC_SYSCON-&amp;gt;STARTRSRP0CLR|=(1&amp;lt;&amp;lt;(12)); //rst the tilt start signal in case it is buffered from previous alrms

&amp;nbsp; if (wakeFromAlarmFlag&amp;gt;0 &amp;amp;&amp;amp; wakeFromAlarmFlag&amp;lt;ALARMNOTIFIRIER)
&amp;nbsp; wakeFromAlarmFlag++;
&amp;nbsp; else wakeFromAlarmFlag=0;

&amp;nbsp; }
&amp;nbsp; else {
&amp;nbsp; LPC_SYSCON-&amp;gt;STARTRSRP0CLR|=(1&amp;lt;&amp;lt;(12)); //AD1 TILT
&amp;nbsp; wakeFromAlarmFlag++;
&amp;nbsp; }

&amp;nbsp; NVIC_DisableIRQ(WAKEUP8_IRQn);
&amp;nbsp; NVIC_DisableIRQ(WAKEUP12_IRQn);
&amp;nbsp; NVIC_ClearPendingIRQ(WAKEUP12_IRQn);
&amp;nbsp; NVIC_ClearPendingIRQ(WAKEUP8_IRQn);

return;
}
&lt;/PRE&gt; &lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 15 Jun 2016 19:36:00 GMT</pubDate>
      <guid>https://community.nxp.com/t5/LPC-Microcontrollers/wakeup-from-tilt-sensor-filter/m-p/533382#M10603</guid>
      <dc:creator>lpcware</dc:creator>
      <dc:date>2016-06-15T19:36:00Z</dc:date>
    </item>
    <item>
      <title>Re: wakeup from tilt sensor filter</title>
      <link>https://community.nxp.com/t5/LPC-Microcontrollers/wakeup-from-tilt-sensor-filter/m-p/533383#M10604</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;STRONG&gt;Content originally posted in LPCWare by 1234567890 on Thu Jul 17 09:02:06 MST 2014&lt;/STRONG&gt;&lt;BR /&gt;&lt;SPAN&gt;Well, first of all: Your ISR is called &lt;/SPAN&gt;&lt;STRONG&gt;after&lt;/STRONG&gt;&lt;SPAN&gt; waking up; the device has already left sleep mode at this time. The ISR is the result of the interrupt.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;There are 2 possibilities: &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;1.) After waking up you can monitor your pin and decide with software, if it is real or fake. Keyword 'debounce routine'. That's not so good, especially if you have a battery powered application (current consumption, the time in sleep mode can be much shorter).&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;2.) Debounce your pin with external hardware (e.g. R and C) to filter the noise.&lt;/SPAN&gt;&lt;BR /&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 15 Jun 2016 19:36:01 GMT</pubDate>
      <guid>https://community.nxp.com/t5/LPC-Microcontrollers/wakeup-from-tilt-sensor-filter/m-p/533383#M10604</guid>
      <dc:creator>lpcware</dc:creator>
      <dc:date>2016-06-15T19:36:01Z</dc:date>
    </item>
    <item>
      <title>Re: wakeup from tilt sensor filter</title>
      <link>https://community.nxp.com/t5/LPC-Microcontrollers/wakeup-from-tilt-sensor-filter/m-p/533384#M10605</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;STRONG&gt;Content originally posted in LPCWare by tbelo on Sat Jul 19 11:02:41 MST 2014&lt;/STRONG&gt;&lt;BR /&gt;&lt;SPAN&gt;The case is exactly as you mention.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Both possibilities are explained with schematics at sensolute.com.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 15 Jun 2016 19:36:02 GMT</pubDate>
      <guid>https://community.nxp.com/t5/LPC-Microcontrollers/wakeup-from-tilt-sensor-filter/m-p/533384#M10605</guid>
      <dc:creator>lpcware</dc:creator>
      <dc:date>2016-06-15T19:36:02Z</dc:date>
    </item>
  </channel>
</rss>

