<?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>topic Re: EMI from Cell Phone Triggering IRQs in QG4! in 8-bit Microcontrollers</title>
    <link>https://community.nxp.com/t5/8-bit-Microcontrollers/EMI-from-Cell-Phone-Triggering-IRQs-in-QG4/m-p/218337#M19007</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;BLOCKQUOTE&gt;&lt;HR /&gt;JimDon wrote:&lt;BR /&gt;&lt;P&gt;The fix is to provide adequate EMI shielding/filtering on the board.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;&lt;P&gt;As an alternative, you can have marketing add it on to the list of features . . .&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;A 5cm wire is equal to a half-wave antenna at approximately 250mHz, or a full-wave antenna at 500mHz. You could try lengthening the wire to a non-multiple of 5cm to see how that affects it. If it is the wire, a simple solution might be to use a shielded wire.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 30 Jun 2011 02:23:32 GMT</pubDate>
    <dc:creator>rocco</dc:creator>
    <dc:date>2011-06-30T02:23:32Z</dc:date>
    <item>
      <title>EMI from Cell Phone Triggering IRQs in QG4!</title>
      <link>https://community.nxp.com/t5/8-bit-Microcontrollers/EMI-from-Cell-Phone-Triggering-IRQs-in-QG4/m-p/218332#M19002</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi All,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I am using a QG4 in a new product that we have already produced a few thousand of. &amp;nbsp;The device is a battery-powered LED lamp with three brightness settings. &amp;nbsp;We've already gone through lots of field trials and months of testing. &amp;nbsp;But today I was just brushing my teeth, with one of these lamps sitting in the bathroom (where I had been using it in my own high-humidity "field trial"). &amp;nbsp;The lamp was off, but all of a sudden, it turned on to mode one... then mode two... then mode three... all over the course of 10 seconds! &amp;nbsp;It was acting as if a ghost were pushing the button and turning the lamp on. &amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I about freaked when I saw this as I thought it was a code malfunction that I had just randomly been present for. &amp;nbsp;But then I realized that I had set down my cell phone right next to the lamp. &amp;nbsp;After some investigation, I find that if I put my phone right next to the device, I can occasionally activate the lamp just by calling my phone. &amp;nbsp;Afterwards, even after many tries, the code is still running fine, and I can tell that no reset has occurred.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I use an IRQ with subsequent switch debounce polling to wake the device from sleep and then switch lighting modes. &amp;nbsp;I am really surprised that EMI from a cell phone could even trigger the IRQ to begin with, much less get through the debounce routine. &amp;nbsp;I do not have a cap on the IRQ pin, but it is not like I have a long antenna going into that pin - just a 5 cm wire going to a tactile switch. &amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Can I prevent this IRQ triggering by just adding a 100 nF cap across the IRQ pin?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Beyond fixing the IRQ line itself, I am quite worried because I assume that if a cell phone can trigger the IRQ, it could also screw up the code execution completely. &amp;nbsp; Can anybody point me to comprehensive advice on this? &amp;nbsp;I have used QD4 for years and never experienced anything like this. &amp;nbsp;I have not yet checked whether this is just one device that is susceptible or all of the devices.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;Patrick&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 29 Jun 2011 18:42:02 GMT</pubDate>
      <guid>https://community.nxp.com/t5/8-bit-Microcontrollers/EMI-from-Cell-Phone-Triggering-IRQs-in-QG4/m-p/218332#M19002</guid>
      <dc:creator>PatrickW</dc:creator>
      <dc:date>2011-06-29T18:42:02Z</dc:date>
    </item>
    <item>
      <title>Re: EMI from Cell Phone Triggering IRQs in QG4!</title>
      <link>https://community.nxp.com/t5/8-bit-Microcontrollers/EMI-from-Cell-Phone-Triggering-IRQs-in-QG4/m-p/218333#M19003</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Update: &amp;nbsp;It is indeed a common problem for all of the devices. &amp;nbsp;Basically if I put a phone right up against the board and call somebody, occasionally (like 1/3 times) the lamp will turn on. &amp;nbsp;It seems to be legitimately cycling through the modes without having any detrimental effect like a device reset, but this is still a pretty big problem that I need to fix. &amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I presume I could fix this somewhat in software by just doing more polling of the IRQ pin (currently I poll only once to confirm the IRQ button press, around 10 ms after the ISR is triggered). &amp;nbsp;But I would much prefer a solid hardware fix.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Patrick&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 29 Jun 2011 21:20:35 GMT</pubDate>
      <guid>https://community.nxp.com/t5/8-bit-Microcontrollers/EMI-from-Cell-Phone-Triggering-IRQs-in-QG4/m-p/218333#M19003</guid>
      <dc:creator>PatrickW</dc:creator>
      <dc:date>2011-06-29T21:20:35Z</dc:date>
    </item>
    <item>
      <title>Re: EMI from Cell Phone Triggering IRQs in QG4!</title>
      <link>https://community.nxp.com/t5/8-bit-Microcontrollers/EMI-from-Cell-Phone-Triggering-IRQs-in-QG4/m-p/218334#M19004</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;The fix is to provide adequate EMI shielding/filtering on the board.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 29 Jun 2011 23:14:01 GMT</pubDate>
      <guid>https://community.nxp.com/t5/8-bit-Microcontrollers/EMI-from-Cell-Phone-Triggering-IRQs-in-QG4/m-p/218334#M19004</guid>
      <dc:creator>JimDon</dc:creator>
      <dc:date>2011-06-29T23:14:01Z</dc:date>
    </item>
    <item>
      <title>Re: EMI from Cell Phone Triggering IRQs in QG4!</title>
      <link>https://community.nxp.com/t5/8-bit-Microcontrollers/EMI-from-Cell-Phone-Triggering-IRQs-in-QG4/m-p/218335#M19005</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;What do you have connected to IRQ pin? Any resistor (what value), or just weak internal pullup device?&lt;/P&gt;&lt;P&gt;Connecting just capacitor is not right. You need series resistance between cap and switch to limit&amp;nbsp;capacitor discharge current through closed switch contacts.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 29 Jun 2011 23:37:10 GMT</pubDate>
      <guid>https://community.nxp.com/t5/8-bit-Microcontrollers/EMI-from-Cell-Phone-Triggering-IRQs-in-QG4/m-p/218335#M19005</guid>
      <dc:creator>kef</dc:creator>
      <dc:date>2011-06-29T23:37:10Z</dc:date>
    </item>
    <item>
      <title>Re: EMI from Cell Phone Triggering IRQs in QG4!</title>
      <link>https://community.nxp.com/t5/8-bit-Microcontrollers/EMI-from-Cell-Phone-Triggering-IRQs-in-QG4/m-p/218336#M19006</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;If you have any specific EMI filtering/shielding references/ideas, please let me know - I know that is a huge topic for RF-intensive applications, but it seems like overkill for such a simple device to get into wrapping this in foil or whatever, on account of cell phone interference. &amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I just have the weak internal pullup - it's not that weak though, 25 kOhm or so - I'm kind of amazed that is getting overcome by a nearby cell phone. &amp;nbsp;I could strengthen that pullup. &amp;nbsp;If the capacitor is small, eg. 100 nF, is a resistor in series necessary?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 30 Jun 2011 01:09:08 GMT</pubDate>
      <guid>https://community.nxp.com/t5/8-bit-Microcontrollers/EMI-from-Cell-Phone-Triggering-IRQs-in-QG4/m-p/218336#M19006</guid>
      <dc:creator>PatrickW</dc:creator>
      <dc:date>2011-06-30T01:09:08Z</dc:date>
    </item>
    <item>
      <title>Re: EMI from Cell Phone Triggering IRQs in QG4!</title>
      <link>https://community.nxp.com/t5/8-bit-Microcontrollers/EMI-from-Cell-Phone-Triggering-IRQs-in-QG4/m-p/218337#M19007</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;BLOCKQUOTE&gt;&lt;HR /&gt;JimDon wrote:&lt;BR /&gt;&lt;P&gt;The fix is to provide adequate EMI shielding/filtering on the board.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;&lt;P&gt;As an alternative, you can have marketing add it on to the list of features . . .&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;A 5cm wire is equal to a half-wave antenna at approximately 250mHz, or a full-wave antenna at 500mHz. You could try lengthening the wire to a non-multiple of 5cm to see how that affects it. If it is the wire, a simple solution might be to use a shielded wire.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 30 Jun 2011 02:23:32 GMT</pubDate>
      <guid>https://community.nxp.com/t5/8-bit-Microcontrollers/EMI-from-Cell-Phone-Triggering-IRQs-in-QG4/m-p/218337#M19007</guid>
      <dc:creator>rocco</dc:creator>
      <dc:date>2011-06-30T02:23:32Z</dc:date>
    </item>
    <item>
      <title>Re: EMI from Cell Phone Triggering IRQs in QG4!</title>
      <link>https://community.nxp.com/t5/8-bit-Microcontrollers/EMI-from-Cell-Phone-Triggering-IRQs-in-QG4/m-p/218338#M19008</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I would like to have a flashlight with a built in cell phone ring detector !!!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;If you are susceptible to cell phone rings, you are probably also susceptible to nearby lightning strikes and other EMI - it does not sound like a good feature.&amp;nbsp; If it is not crashing your software, then it is most likely transferring enough charge into your IO pin to make the QG4 see an IO transition.&amp;nbsp; The problem is - you do not know how much charge is being transferred and if it has any chance of IO pin damage from more powerful / different band radios.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;A stiffer external pullup may be part of the answer as it will shunt more of the unwanted current away from the IO pin.&amp;nbsp; An ingress filter in the form of a series R and C to ground would also help.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Good Luck,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Peter&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 30 Jun 2011 07:46:19 GMT</pubDate>
      <guid>https://community.nxp.com/t5/8-bit-Microcontrollers/EMI-from-Cell-Phone-Triggering-IRQs-in-QG4/m-p/218338#M19008</guid>
      <dc:creator>PeterHouse</dc:creator>
      <dc:date>2011-06-30T07:46:19Z</dc:date>
    </item>
    <item>
      <title>Re: EMI from Cell Phone Triggering IRQs in QG4!</title>
      <link>https://community.nxp.com/t5/8-bit-Microcontrollers/EMI-from-Cell-Phone-Triggering-IRQs-in-QG4/m-p/218339#M19009</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello Patrick,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Does your board layout provide an effective low inductance &amp;nbsp;"ground&amp;nbsp;plane"?&amp;nbsp; If using a leaded component for the additional bypass capacitor, I would suggest that a &lt;U&gt;lower&lt;/U&gt; value may be more effective at the frequencies involved, say 100p or 1n.&amp;nbsp; Whatever capacitor type you choose must have a self-resonant frequency that is&amp;nbsp;above the frequency of interest., which is another way of saying that it must have very low self inductance.&amp;nbsp; And this assumes that the leads can be kept very short, and the return path to ground is of low inductance.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Using a smaller value capacitor, it is unlikely that there would be sufficient discharge energy to damage the switch contacts.&amp;nbsp; However, a series resistance (or inductance) may help the RF&amp;nbsp;filtering process.&amp;nbsp; If the switch itself uses a flying lead to connect to the board, maybe a ferrite bead on one or both leads may help to reduce the effectiveness of the "antenna".&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Note that the normal purpose of the&amp;nbsp;debounce code associated with the input, is to lockout any bounce that may occur after the first closure is detected, so would unlikely affect the current problem.&amp;nbsp; What might help depending on the nature of the interference, is to modify the code so that each closure, following a short&amp;nbsp;debounce delay, must remain continuously&amp;nbsp;active for a minimum period&amp;nbsp;for the required action to occur.&amp;nbsp; Maybe a debounce period of 5-20ms, and a minimum closure period of 100-200ms would be appropriate.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Mac&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 30 Jun 2011 08:42:09 GMT</pubDate>
      <guid>https://community.nxp.com/t5/8-bit-Microcontrollers/EMI-from-Cell-Phone-Triggering-IRQs-in-QG4/m-p/218339#M19009</guid>
      <dc:creator>bigmac</dc:creator>
      <dc:date>2011-06-30T08:42:09Z</dc:date>
    </item>
    <item>
      <title>Re: EMI from Cell Phone Triggering IRQs in QG4!</title>
      <link>https://community.nxp.com/t5/8-bit-Microcontrollers/EMI-from-Cell-Phone-Triggering-IRQs-in-QG4/m-p/218340#M19010</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;So I tried monitoring the IRQ pin to see if I could spot the noise on my 100 Mhz scope. &amp;nbsp;I was expecting to see random noise if anything, but low and behold, this is the waveform I get when I place a call on my phone with the antenna right next to the switch wire:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;IMG alt="Waveform" border="0" src="http://patrick.dreamhosters.com/WF1.jpg" width="700" /&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;No wonder this thing is triggering the IRQ... I am getting 1 ms solidly negative pulses.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I was thinking about putting a filter on the line, but main concern now is that no amount of filtering is necessarily going to solve this problem, because if the pulses happen just a little bit more often, then even the filtered DC component of this waveform would trigger the IRQ (active low).&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I am really surprised that I can get this large of a signal out of a switch wire. &amp;nbsp;The signal is managing to pull the IRQ line nearly down to ground through a 25-50 kOhm pullup resistor. &amp;nbsp;So I don't think adding a 5 kOhm pullup is going to do the trick either. &amp;nbsp;I can mitigate this somewhat by twisting the pair of wires together, but not completely. &amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 30 Jun 2011 21:27:39 GMT</pubDate>
      <guid>https://community.nxp.com/t5/8-bit-Microcontrollers/EMI-from-Cell-Phone-Triggering-IRQs-in-QG4/m-p/218340#M19010</guid>
      <dc:creator>PatrickW</dc:creator>
      <dc:date>2011-06-30T21:27:39Z</dc:date>
    </item>
    <item>
      <title>Re: EMI from Cell Phone Triggering IRQs in QG4!</title>
      <link>https://community.nxp.com/t5/8-bit-Microcontrollers/EMI-from-Cell-Phone-Triggering-IRQs-in-QG4/m-p/218341#M19011</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;If you can mitigate this by twisting the wires, try 5K the pullup.&amp;nbsp; You may be surprised.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;What shielding do you have in place for static surpression at the switch?&amp;nbsp; Does the switch have a static shield connected to circuit ground ?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 30 Jun 2011 22:30:02 GMT</pubDate>
      <guid>https://community.nxp.com/t5/8-bit-Microcontrollers/EMI-from-Cell-Phone-Triggering-IRQs-in-QG4/m-p/218341#M19011</guid>
      <dc:creator>PeterHouse</dc:creator>
      <dc:date>2011-06-30T22:30:02Z</dc:date>
    </item>
    <item>
      <title>Re: EMI from Cell Phone Triggering IRQs in QG4!</title>
      <link>https://community.nxp.com/t5/8-bit-Microcontrollers/EMI-from-Cell-Phone-Triggering-IRQs-in-QG4/m-p/218342#M19012</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;The tactile switch that this connects to is behind a hermetically sealed silicone cover - I don't have any ESD protection on it.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I added the 5k pullup - this has some but not enough effect on the resulting signal. &amp;nbsp;As you can see, the interference can pull a 25k pull-up resistor nearly down to about 0.4V. &amp;nbsp;With a 5k pulllup, the line still gets pulled down to 1.2 V. &amp;nbsp;This depends a little on where I put the phone, so there may be no difference at all actually.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I don't want to use a 1k pullup because the 3 mA current draw may confuse other parts of my circuit. &amp;nbsp; Anyway I feel like there has to be a better solution here... some way to dampen the signal? &amp;nbsp;But the problem is that the signal being created is nearly binary DC in nature, rather than the fast noise I was expecting. &amp;nbsp;I don't understand why I'm getting 1 ms long pulses instead of noise. &amp;nbsp;I can filter noise, but how does one filter out a 200 hz full-amplitude square wave?? &amp;nbsp;And how am I getting such a signal from RF interference in the first place? &amp;nbsp;Really weird.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 01 Jul 2011 00:17:39 GMT</pubDate>
      <guid>https://community.nxp.com/t5/8-bit-Microcontrollers/EMI-from-Cell-Phone-Triggering-IRQs-in-QG4/m-p/218342#M19012</guid>
      <dc:creator>PatrickW</dc:creator>
      <dc:date>2011-07-01T00:17:39Z</dc:date>
    </item>
    <item>
      <title>Re: EMI from Cell Phone Triggering IRQs in QG4!</title>
      <link>https://community.nxp.com/t5/8-bit-Microcontrollers/EMI-from-Cell-Phone-Triggering-IRQs-in-QG4/m-p/218343#M19013</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Patrick,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Twisting the wires probably wont help, as the signal is not differential. The input pin has a high impedance, while the ground pin has a very low impedance.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Maybe you can fix this in firmware.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The debounce algorithm that I have been using for 20 years would be immune to a 1 millisecond pulse (I usually set it to 5ms or 10ms, depending on the switch specs). It is not a simple delay, which can be tricked by multiple pulses.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I sample the signal at a fixed rate at some fraction of the debounce period, usually 10 to 50 times. As an example, if I wanted 5 milliseconds, I might sample every 100 microseconds. When I detect a transition, I start a debounce counter counting down from 50 to zero at each sample. If I see any transitions, I reset the counter to 50. I only accept a switch change when the counter hits zero.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;In effect, a switch closure or open is only accepted after it has been solidly high or low for the entire 5 milliseconds. This would filter out your 1 millisecond "noise".&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;BTW: Have you tried lengthening the wire? Probably won't help, but might show if the wire-length happens to be "tuned" to the cellphone's frequency.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 01 Jul 2011 03:09:44 GMT</pubDate>
      <guid>https://community.nxp.com/t5/8-bit-Microcontrollers/EMI-from-Cell-Phone-Triggering-IRQs-in-QG4/m-p/218343#M19013</guid>
      <dc:creator>rocco</dc:creator>
      <dc:date>2011-07-01T03:09:44Z</dc:date>
    </item>
    <item>
      <title>Re: EMI from Cell Phone Triggering IRQs in QG4!</title>
      <link>https://community.nxp.com/t5/8-bit-Microcontrollers/EMI-from-Cell-Phone-Triggering-IRQs-in-QG4/m-p/218344#M19014</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Rocco: &amp;nbsp;I was thinking the same thing: &amp;nbsp;Twisting the wire shouldn't help because this is not a differential signal. &amp;nbsp;Our EE told me to twist the wire and I thought he was nuts... but for some reason it seem to reduce the interference. &amp;nbsp;Difficult to see on the scope but I get far, far fewer switch detections - maybe it's all in my head.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Anyway with twisting and a 5 kOhm pullup, the interference on the scope and in practice is pretty minimal - I can't imagine it would ever be a problem in a normal situation. &amp;nbsp;A 1 kOhm pullup resistor is even better, nearly dampening the signal completely on the scope. &amp;nbsp;But I don't want that much current draw during switch presses, so I am going to stick to 5 kOhm and take your suggestion on modifying the debounce routine. &amp;nbsp;I have used the routine you describe before, but in this software I only implemented one-time polling.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I am concerned that this is not really going to fix the problem though under all conditions. &amp;nbsp;Of course it will be impervious to the cell phone signal I posted a screenshot of, but what if some phone puts out a square wave where the negative pulses last for a full 5 ms or 10 ms?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I can't shorten or lengthen the wire for assembly reasons. &amp;nbsp;My only option might be a coax wire, but that seems like a real pain - if that's really what's required, I'm surprised I haven't heard of this before even for consumer-grade applications (of course I wouldn't be surprised if coax and shielding were used in critical applications).&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;Patrick&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 01 Jul 2011 04:58:06 GMT</pubDate>
      <guid>https://community.nxp.com/t5/8-bit-Microcontrollers/EMI-from-Cell-Phone-Triggering-IRQs-in-QG4/m-p/218344#M19014</guid>
      <dc:creator>PatrickW</dc:creator>
      <dc:date>2011-07-01T04:58:06Z</dc:date>
    </item>
    <item>
      <title>Re: EMI from Cell Phone Triggering IRQs in QG4!</title>
      <link>https://community.nxp.com/t5/8-bit-Microcontrollers/EMI-from-Cell-Phone-Triggering-IRQs-in-QG4/m-p/218345#M19015</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Surprisingly again, I can still get switch-press triggers even with your counter-based debounce routine ( have it polling 35 times!).&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Patrick&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 01 Jul 2011 06:07:47 GMT</pubDate>
      <guid>https://community.nxp.com/t5/8-bit-Microcontrollers/EMI-from-Cell-Phone-Triggering-IRQs-in-QG4/m-p/218345#M19015</guid>
      <dc:creator>PatrickW</dc:creator>
      <dc:date>2011-07-01T06:07:47Z</dc:date>
    </item>
    <item>
      <title>Re: EMI from Cell Phone Triggering IRQs in QG4!</title>
      <link>https://community.nxp.com/t5/8-bit-Microcontrollers/EMI-from-Cell-Phone-Triggering-IRQs-in-QG4/m-p/218346#M19016</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello Patrick,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Here is my best guess of the phenomenon you are observing:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The input pin to the MCU has an intrinsic diode connected between the pin (anode) and Vdd (cathode), and there is also a pullup between these two points.&amp;nbsp; You are coupling the RF signal into the pin, and the diode is &lt;U&gt;rectifying&lt;/U&gt; the RF signal, which produces a negative DC component that is filtered by stray and input capacitance.&amp;nbsp; This is why you are observing a solid negative impulse.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;There are two possibilities - decrease the shunt impedance to RF ground, or increase the series coupling impedance to the input pin, or some of both.&amp;nbsp; Reducing the pullup value&amp;nbsp;and providing a low inductance shunt capacitance at the pin should decrease the shunt&amp;nbsp;impedance.&amp;nbsp; To increase the coupling impedance, the best way would be to use shielded/coaxial cable to the switch, but other series inductance or resistance may help.&amp;nbsp; The twisting of the wires might help to some degree because you are increasing the distributed&amp;nbsp; shunt capacitance.&amp;nbsp; You might also try an additional capacitor (say 100p) between the wires,&amp;nbsp;at the switch end.&amp;nbsp; But be aware that the connection of the oscilloscope probe may also affect the results obtained.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The ease of implementing a solution is likely to depend on the detail of you circuit board layout, and its grounding provisions.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I am not familiar with the details of GSM transmissions, but my presumption is that the phone produces RF bursts of 1 ms duration during ringing, and that these are at maximum power level.&amp;nbsp; When the phone is subsequently answered, I assume that the power level is decreased under most circumstances.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I think that the input monitoring I previously suggested was also quite similar to Rocco's suggestion.&amp;nbsp; However, I would probably suggest to&amp;nbsp;test for an unbroken switch closure over a period of at least 100ms.&amp;nbsp; If you were sampling at 1ms intervals, you would expect to see 100 sequential samples with low state, before a switch event would be registered.&amp;nbsp; If any sample was high state, the count would be restarted.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Mac&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 01 Jul 2011 13:10:27 GMT</pubDate>
      <guid>https://community.nxp.com/t5/8-bit-Microcontrollers/EMI-from-Cell-Phone-Triggering-IRQs-in-QG4/m-p/218346#M19016</guid>
      <dc:creator>bigmac</dc:creator>
      <dc:date>2011-07-01T13:10:27Z</dc:date>
    </item>
    <item>
      <title>Re: EMI from Cell Phone Triggering IRQs in QG4!</title>
      <link>https://community.nxp.com/t5/8-bit-Microcontrollers/EMI-from-Cell-Phone-Triggering-IRQs-in-QG4/m-p/218347#M19017</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;the best solution is double-overkill.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Fix it in software,&amp;nbsp; so that it works 100%,&amp;nbsp; fix it in hardware so that it works 100% (independent of the software fix).&amp;nbsp; Then implement both in production.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Is your power supply pin properly bypassed?&amp;nbsp; Any other long I/O traces or wires?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Single sided board or double?&amp;nbsp;&amp;nbsp; SMT or thru-hole?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Since you have such a clean trace on the scope,&amp;nbsp; a software fix should be do-able,&amp;nbsp; even if you write something that specifically ignores this type of periodic signal.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Bob&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 11 Jul 2011 20:15:58 GMT</pubDate>
      <guid>https://community.nxp.com/t5/8-bit-Microcontrollers/EMI-from-Cell-Phone-Triggering-IRQs-in-QG4/m-p/218347#M19017</guid>
      <dc:creator>TurboBob</dc:creator>
      <dc:date>2011-07-11T20:15:58Z</dc:date>
    </item>
  </channel>
</rss>

