<?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>8-bit Microcontrollers中的主题 Re: 9S08QG inputs won't work in background debug mode only</title>
    <link>https://community.nxp.com/t5/8-bit-Microcontrollers/9S08QG-inputs-won-t-work-in-background-debug-mode-only/m-p/143125#M6494</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;DIV&gt;&lt;BLOCKQUOTE&gt;&lt;HR /&gt;celsoken wrote:&lt;BR /&gt;Just in case, if you are going analog, pullups are disabled by the alternate function, so you'll need external pullups.&lt;BR /&gt;&lt;DIV&gt;&lt;/DIV&gt;&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;&lt;BR /&gt;Nope, no analog in my code.&lt;BR /&gt;&lt;/DIV&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 22 Aug 2007 23:06:55 GMT</pubDate>
    <dc:creator>irob</dc:creator>
    <dc:date>2007-08-22T23:06:55Z</dc:date>
    <item>
      <title>9S08QG inputs won't work in background debug mode only</title>
      <link>https://community.nxp.com/t5/8-bit-Microcontrollers/9S08QG-inputs-won-t-work-in-background-debug-mode-only/m-p/143114#M6483</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;DIV&gt; &lt;/DIV&gt;&lt;SPAN&gt;I have a MC9S08QG4 target with one input switch that doesn't work in background debug mode.&amp;nbsp; I step through the condition and the debugger doesn't see my switch input.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Yet, running normal operation, this same switch on the same target &lt;/SPAN&gt;&lt;I&gt;will&lt;/I&gt;&lt;SPAN&gt; work, and I verify by lighting an LED.&amp;nbsp; So odd.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Any thoughts?&lt;/SPAN&gt;&lt;BR /&gt;&lt;DIV&gt; &lt;/DIV&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 15 Aug 2007 04:53:19 GMT</pubDate>
      <guid>https://community.nxp.com/t5/8-bit-Microcontrollers/9S08QG-inputs-won-t-work-in-background-debug-mode-only/m-p/143114#M6483</guid>
      <dc:creator>irob</dc:creator>
      <dc:date>2007-08-15T04:53:19Z</dc:date>
    </item>
    <item>
      <title>Re: 9S08QG inputs won't work in background debug mode only</title>
      <link>https://community.nxp.com/t5/8-bit-Microcontrollers/9S08QG-inputs-won-t-work-in-background-debug-mode-only/m-p/143115#M6484</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;DIV&gt;&lt;FONT size="2"&gt;Hello iRob,&lt;/FONT&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;FONT size="2"&gt;&lt;/FONT&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&lt;FONT size="2"&gt;Perchance would the switch be connected to PTA4?&lt;/FONT&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;FONT size="2"&gt;&lt;/FONT&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&lt;FONT size="2"&gt;Regards,&lt;/FONT&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;FONT size="2"&gt;Mac&lt;/FONT&gt;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 15 Aug 2007 10:09:19 GMT</pubDate>
      <guid>https://community.nxp.com/t5/8-bit-Microcontrollers/9S08QG-inputs-won-t-work-in-background-debug-mode-only/m-p/143115#M6484</guid>
      <dc:creator>bigmac</dc:creator>
      <dc:date>2007-08-15T10:09:19Z</dc:date>
    </item>
    <item>
      <title>Re: 9S08QG inputs won't work in background debug mode only</title>
      <link>https://community.nxp.com/t5/8-bit-Microcontrollers/9S08QG-inputs-won-t-work-in-background-debug-mode-only/m-p/143116#M6485</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;No, I have three switches connected to PTB0, 1, 2.&amp;nbsp; The if() statement I couldn't get to work in the debugger actually checked for all three switches depressed.&amp;nbsp; I know for a fact that I have no cabling problems as all three of the switches work elsewhere in the code.&lt;BR /&gt;&lt;BR /&gt;To make this work for now, I found that if I shrink that if() statement criteria down to just one of the switches, the debugger then "sees" my switch depress.&lt;BR /&gt;&lt;BR /&gt;One final discovery: if I strip out all of my code except for that triple switch if() statement, and rerun in the debugger, the if() works.&amp;nbsp; It's almost as if this is a space issue?&amp;nbsp; Or stack?&amp;nbsp; I tried growing the stack as high as it would go, but no change.&amp;nbsp; Very bizarre.&lt;BR /&gt;&lt;DIV&gt;&lt;/DIV&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 15 Aug 2007 22:30:22 GMT</pubDate>
      <guid>https://community.nxp.com/t5/8-bit-Microcontrollers/9S08QG-inputs-won-t-work-in-background-debug-mode-only/m-p/143116#M6485</guid>
      <dc:creator>irob</dc:creator>
      <dc:date>2007-08-15T22:30:22Z</dc:date>
    </item>
    <item>
      <title>Re: 9S08QG inputs won't work in background debug mode only</title>
      <link>https://community.nxp.com/t5/8-bit-Microcontrollers/9S08QG-inputs-won-t-work-in-background-debug-mode-only/m-p/143117#M6486</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;Dear Irob,&lt;BR /&gt;&lt;BR /&gt;In order to be sure you are working inside specs, are your resistors PU or PD at wich value? I ask U that because sometimes internal PU can manage your inputs to undefined levels and the uC go nuts, with bizarre behaviour.&lt;BR /&gt;&lt;BR /&gt;I hope it helps.&lt;BR /&gt;&lt;BR /&gt;Cheers,&lt;BR /&gt;&lt;BR /&gt;Celso&lt;BR /&gt;&lt;DIV&gt;&lt;/DIV&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 16 Aug 2007 19:22:56 GMT</pubDate>
      <guid>https://community.nxp.com/t5/8-bit-Microcontrollers/9S08QG-inputs-won-t-work-in-background-debug-mode-only/m-p/143117#M6486</guid>
      <dc:creator>celsoken</dc:creator>
      <dc:date>2007-08-16T19:22:56Z</dc:date>
    </item>
    <item>
      <title>Re: 9S08QG inputs won't work in background debug mode only</title>
      <link>https://community.nxp.com/t5/8-bit-Microcontrollers/9S08QG-inputs-won-t-work-in-background-debug-mode-only/m-p/143118#M6487</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;I'm using the internal pullups on all three.&amp;nbsp; I don't have external pullups on these lines.&lt;BR /&gt;&lt;DIV&gt;&lt;/DIV&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 16 Aug 2007 22:35:52 GMT</pubDate>
      <guid>https://community.nxp.com/t5/8-bit-Microcontrollers/9S08QG-inputs-won-t-work-in-background-debug-mode-only/m-p/143118#M6487</guid>
      <dc:creator>irob</dc:creator>
      <dc:date>2007-08-16T22:35:52Z</dc:date>
    </item>
    <item>
      <title>Re: 9S08QG inputs won't work in background debug mode only</title>
      <link>https://community.nxp.com/t5/8-bit-Microcontrollers/9S08QG-inputs-won-t-work-in-background-debug-mode-only/m-p/143119#M6488</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;I just conducted a few tests.&amp;nbsp; I put some external 10K resistor pullups on each of those three inputs.&amp;nbsp; I change the code to test individually the three inputs one at a time.&amp;nbsp; The first time I tested PTB0 and with the pullup it worked.&amp;nbsp; Without it, it did not.&amp;nbsp; Seemed promising.&lt;BR /&gt;&lt;BR /&gt;Then (you're not going to believe this), I tried the other two switch inputs on PTB1 and 2 and they did not work.&amp;nbsp; I went back to PTB0 and it also does not work now.&amp;nbsp; I don't get it!&lt;BR /&gt;&lt;BR /&gt;Just to check my setup, I tried again stripping out all of the other program code and tested just that simple if function:&lt;BR /&gt;&lt;BR /&gt;&lt;DIV&gt;&lt;DIV class="msg_source_code"&gt;&lt;DIV class="text_smallest"&gt;Code:&lt;/DIV&gt;&lt;PRE&gt;if ((PLUS==CLOSE) &amp;amp; (MINUS==CLOSE) &amp;amp; (MODE==CLOSE)){  TEST = 1;}&lt;/PRE&gt;&lt;/DIV&gt;&lt;BR /&gt;This works with merely the internal pullups by itself (no other program code).&amp;nbsp; The larger my code gets, the debugger can't see those inputs.&lt;BR /&gt;&lt;/DIV&gt;&lt;BR /&gt;&lt;DIV&gt;&lt;/DIV&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 29 Oct 2020 08:43:34 GMT</pubDate>
      <guid>https://community.nxp.com/t5/8-bit-Microcontrollers/9S08QG-inputs-won-t-work-in-background-debug-mode-only/m-p/143119#M6488</guid>
      <dc:creator>irob</dc:creator>
      <dc:date>2020-10-29T08:43:34Z</dc:date>
    </item>
    <item>
      <title>Re: 9S08QG inputs won't work in background debug mode only</title>
      <link>https://community.nxp.com/t5/8-bit-Microcontrollers/9S08QG-inputs-won-t-work-in-background-debug-mode-only/m-p/143120#M6489</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;DIV&gt;&lt;FONT size="2"&gt;Hello iRob,&lt;/FONT&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;FONT size="2"&gt;&lt;/FONT&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&lt;FONT size="2"&gt;With mechanical switches, I am always suspicious of the effects of key bounce causing unpredictable results.&amp;nbsp; For your real code, if you&amp;nbsp;happen to be&amp;nbsp;&lt;U&gt;toggling&lt;/U&gt; a flag for each closure detected, you would need to take de-bounce precautions.&amp;nbsp; This would be particularly so if you happened to be using KBI interrupts, which I assume you are not.&lt;/FONT&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;FONT size="2"&gt;&lt;/FONT&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&lt;FONT size="2"&gt;A simple method for debounce would be, on detection of a&amp;nbsp;closure of one or more of the three switches, to cause a delay of say 50 to 100 ms before re-sampling the state of the switches.&lt;/FONT&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;FONT size="2"&gt;&lt;/FONT&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&lt;FONT size="2"&gt;Regards,&lt;/FONT&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;FONT size="2"&gt;Mac&lt;/FONT&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;FONT size="2"&gt;&lt;/FONT&gt;&amp;nbsp;&lt;/DIV&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 17 Aug 2007 00:29:39 GMT</pubDate>
      <guid>https://community.nxp.com/t5/8-bit-Microcontrollers/9S08QG-inputs-won-t-work-in-background-debug-mode-only/m-p/143120#M6489</guid>
      <dc:creator>bigmac</dc:creator>
      <dc:date>2007-08-17T00:29:39Z</dc:date>
    </item>
    <item>
      <title>Re: 9S08QG inputs won't work in background debug mode only</title>
      <link>https://community.nxp.com/t5/8-bit-Microcontrollers/9S08QG-inputs-won-t-work-in-background-debug-mode-only/m-p/143121#M6490</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;I actually do have other routines which debounce those mechanical switches quite nicely.&amp;nbsp; And it's in the order of milliseconds.&amp;nbsp; But what I don't understand here is that this simple test routine isn't working in the confined environment of the debugger.&lt;BR /&gt;&lt;BR /&gt;I'm simply stepping through that sample code, so there's not much chance of bouncing switch.&amp;nbsp; The switch is long closed by the time I step through the if statement.&amp;nbsp; The if statement will evaluate positively provided my total source code size is very small.&amp;nbsp; As soon as I put back in the full compiled source code, this switch input won't work in the debugger.&lt;BR /&gt;&lt;DIV&gt;&lt;/DIV&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 17 Aug 2007 00:35:24 GMT</pubDate>
      <guid>https://community.nxp.com/t5/8-bit-Microcontrollers/9S08QG-inputs-won-t-work-in-background-debug-mode-only/m-p/143121#M6490</guid>
      <dc:creator>irob</dc:creator>
      <dc:date>2007-08-17T00:35:24Z</dc:date>
    </item>
    <item>
      <title>Re: 9S08QG inputs won't work in background debug mode only</title>
      <link>https://community.nxp.com/t5/8-bit-Microcontrollers/9S08QG-inputs-won-t-work-in-background-debug-mode-only/m-p/143122#M6491</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;DIV&gt;Hi Rob,&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;What do you do to get all these strange problems?&lt;/DIV&gt;&lt;DIV&gt;What I would do is measure the input pins voltage with the switch open and closed. If your getting very close to the rails then adding more pullups won't help. If your not, get a better switch.&lt;/DIV&gt;&lt;DIV&gt;Temporarily put a 100k resistor across the switch and re-measure the input pin voltage. Now you can calculte the effective internal pullup to be sure it is working/OK.&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;Have you taken a look at the code produced? I doubt there is an error here but it may help shed some light. Have you tried to code it a different way like ANDing with 7?&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 17 Aug 2007 05:12:56 GMT</pubDate>
      <guid>https://community.nxp.com/t5/8-bit-Microcontrollers/9S08QG-inputs-won-t-work-in-background-debug-mode-only/m-p/143122#M6491</guid>
      <dc:creator>peg</dc:creator>
      <dc:date>2007-08-17T05:12:56Z</dc:date>
    </item>
    <item>
      <title>Re: 9S08QG inputs won't work in background debug mode only</title>
      <link>https://community.nxp.com/t5/8-bit-Microcontrollers/9S08QG-inputs-won-t-work-in-background-debug-mode-only/m-p/143123#M6492</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;Just in case, if you are going analog, pullups are disabled by the alternate function, so you'll need external pullups.&lt;BR /&gt;&lt;BR /&gt;Cheers,&lt;BR /&gt;&lt;BR /&gt;Celso&lt;BR /&gt;&lt;DIV&gt;&lt;/DIV&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 17 Aug 2007 19:20:28 GMT</pubDate>
      <guid>https://community.nxp.com/t5/8-bit-Microcontrollers/9S08QG-inputs-won-t-work-in-background-debug-mode-only/m-p/143123#M6492</guid>
      <dc:creator>celsoken</dc:creator>
      <dc:date>2007-08-17T19:20:28Z</dc:date>
    </item>
    <item>
      <title>Re: 9S08QG inputs won't work in background debug mode only</title>
      <link>https://community.nxp.com/t5/8-bit-Microcontrollers/9S08QG-inputs-won-t-work-in-background-debug-mode-only/m-p/143124#M6493</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;DIV&gt;Hi,&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;I just noticed one obvious mistake of your simple code, which is arithmetically ANDing all three conditions instead of logical AND.&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;You should use &amp;amp;&amp;amp; instead of &amp;amp;. Let have a look how differently the code compiles (if ever it is correct) in comparison with the right coding witgh &amp;amp;&amp;amp;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&lt;DIV class="msg_source_code"&gt;&lt;DIV class="text_smallest"&gt;Code:&lt;/DIV&gt;&lt;PRE&gt;  391:    if ((SW2 == SW_OFF) &amp;amp; (SW3 == SW_ON) &amp;amp; (SW4 == SW_OFF))  0037 050002   [5]             BRCLR 2,_PTAD,L3C ;abs = 003c  003a 4f       [1]             CLRA    003b 65       [3]             SKIP2 L3E ;abs = 003e  003c          [5]     L3C:      003c a601     [2]             LDA   #1  003e          [5]     L3E:      003e 95       [2]             TSX     003f e701     [3]             STA   1,X  0041 060002   [5]             BRSET 3,_PTAD,L46 ;abs = 0046  0044 5f       [1]             CLRX    0045 65       [3]             SKIP2 L48 ;abs = 0048  0046          [5]     L46:      0046 ae01     [2]             LDX   #1  0048          [5]     L48:      0048 9eef04   [4]             STX   4,SP  004b 95       [2]             TSX     004c e603     [3]             LDA   3,X  004e e401     [3]             AND   1,X  0050 010002   [5]             BRCLR 0,_PTBD,L55 ;abs = 0055  0053 5f       [1]             CLRX    0054 65       [3]             SKIP2 L57 ;abs = 0057  0055          [5]     L55:      0055 ae01     [2]             LDX   #1  0057          [5]     L57:      0057 9eef04   [4]             STX   4,SP  005a 95       [2]             TSX     005b e702     [3]             STA   2,X  005d e603     [3]             LDA   3,X  005f e402     [3]             AND   2,X  0061 2705     [3]             BEQ   L68 ;abs = 0068  392:    {  393:      i = 1;  0063 a601     [2]             LDA   #1  0065 c70000   [4]             STA   i  0068          [5]     L68:      394:    }  395:    396:    if ((SW2 == SW_OFF) &amp;amp;&amp;amp; (SW3 == SW_ON) &amp;amp;&amp;amp; (SW4 == SW_OFF))  0068 04000b   [5]             BRSET 2,_PTAD,L76 ;abs = 0076  006b 070008   [5]             BRCLR 3,_PTAD,L76 ;abs = 0076  006e 000005   [5]             BRSET 0,_PTBD,L76 ;abs = 0076  397:    {  398:      i = 2;  0071 a602     [2]             LDA   #2  0073 c70000   [4]             STA   i  0076          [5]     L76:&lt;/PRE&gt;&lt;/DIV&gt;&lt;BR /&gt;&amp;nbsp;&lt;BR /&gt;Regards, Pavel&lt;/DIV&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 29 Oct 2020 08:43:36 GMT</pubDate>
      <guid>https://community.nxp.com/t5/8-bit-Microcontrollers/9S08QG-inputs-won-t-work-in-background-debug-mode-only/m-p/143124#M6493</guid>
      <dc:creator>ok2ucx</dc:creator>
      <dc:date>2020-10-29T08:43:36Z</dc:date>
    </item>
    <item>
      <title>Re: 9S08QG inputs won't work in background debug mode only</title>
      <link>https://community.nxp.com/t5/8-bit-Microcontrollers/9S08QG-inputs-won-t-work-in-background-debug-mode-only/m-p/143125#M6494</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;DIV&gt;&lt;BLOCKQUOTE&gt;&lt;HR /&gt;celsoken wrote:&lt;BR /&gt;Just in case, if you are going analog, pullups are disabled by the alternate function, so you'll need external pullups.&lt;BR /&gt;&lt;DIV&gt;&lt;/DIV&gt;&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;&lt;BR /&gt;Nope, no analog in my code.&lt;BR /&gt;&lt;/DIV&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 22 Aug 2007 23:06:55 GMT</pubDate>
      <guid>https://community.nxp.com/t5/8-bit-Microcontrollers/9S08QG-inputs-won-t-work-in-background-debug-mode-only/m-p/143125#M6494</guid>
      <dc:creator>irob</dc:creator>
      <dc:date>2007-08-22T23:06:55Z</dc:date>
    </item>
    <item>
      <title>Re: 9S08QG inputs won't work in background debug mode only</title>
      <link>https://community.nxp.com/t5/8-bit-Microcontrollers/9S08QG-inputs-won-t-work-in-background-debug-mode-only/m-p/143126#M6495</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;DIV&gt;&lt;BLOCKQUOTE&gt;&lt;HR /&gt;peg wrote:&lt;BR /&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;What do you do to get all these strange problems?&lt;/DIV&gt;&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;&lt;FONT color="#0000ff"&gt;That's a great question!&amp;nbsp; I seem to be the litmus for weird bugs and such.&lt;/FONT&gt;&lt;FONT color="#0000ff"&gt;&amp;nbsp;&lt;/FONT&gt; &lt;FONT color="#0000ff"&gt;&lt;SPAN&gt;&lt;IMG alt=":smileysad:" class="emoticon emoticon-smileysad" id="smileysad" src="http://freescale.i.lithium.com/i/smilies/16x16_smiley-sad.gif" title="Smiley Sad" /&gt;&lt;/SPAN&gt;&lt;/FONT&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BLOCKQUOTE&gt;&lt;HR /&gt;What I would do is measure the input pins voltage with the switch open and closed. If your getting very close to the rails then adding more pullups won't help. If your not, get a better switch.&lt;DIV&gt;Temporarily put a 100k resistor across the switch and re-measure the input pin voltage. Now you can calculte the effective internal pullup to be sure it is working/OK.&lt;/DIV&gt;&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;&lt;FONT color="#3300FF"&gt;My switches are E-Switch tactile momentaries.&amp;nbsp; After stepping through code past the input pin initialization (when the pullup registers are set), I then measure a full 3.301V on each of these three buttons.&amp;nbsp; When closed, they all go fully to ground, 0.001V.&lt;/FONT&gt;&lt;FONT color="#3300FF"&gt;&lt;BR /&gt;&lt;/FONT&gt;&lt;FONT color="#3300FF"&gt;&lt;BR /&gt;&lt;/FONT&gt;&lt;FONT color="#3300FF"&gt;I did your neat 100K trick and measured 2.686V at the switch unclosed.&amp;nbsp; That gives an effective pullup of 22.8K.&lt;BR /&gt;&lt;/FONT&gt;&lt;FONT color="#3300FF"&gt;&lt;/FONT&gt;&lt;/DIV&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 23 Aug 2007 00:18:42 GMT</pubDate>
      <guid>https://community.nxp.com/t5/8-bit-Microcontrollers/9S08QG-inputs-won-t-work-in-background-debug-mode-only/m-p/143126#M6495</guid>
      <dc:creator>irob</dc:creator>
      <dc:date>2007-08-23T00:18:42Z</dc:date>
    </item>
    <item>
      <title>Re: 9S08QG inputs won't work in background debug mode only</title>
      <link>https://community.nxp.com/t5/8-bit-Microcontrollers/9S08QG-inputs-won-t-work-in-background-debug-mode-only/m-p/143127#M6496</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;Pavel, this is an interesting find.&amp;nbsp; And I'm getting similar compiler results between the two approaches:&lt;BR /&gt;&lt;BR /&gt;&lt;DIV&gt;&lt;DIV class="msg_source_code"&gt;&lt;DIV class="text_smallest"&gt;Code:&lt;/DIV&gt;&lt;PRE&gt;  if ((PLUS==CLOSE) &amp;amp;&amp;amp; (MINUS==CLOSE) &amp;amp;&amp;amp; (MODE==CLOSE))  {    plus_flag = 1;    minus_flag = 1;    mode_flag = 1;   while ((PLUS==CLOSE) &amp;amp;&amp;amp; (MINUS==CLOSE) &amp;amp;&amp;amp; (MODE==CLOSE)) // wait for release   {     __RESET_WATCHDOG();     // feed the dog   }  }  if ((PLUS==CLOSE) &amp;amp; (MINUS==CLOSE) &amp;amp; (MODE==CLOSE))  {    plus_flag = 1;    minus_flag = 1;    mode_flag = 1;   while ((PLUS==CLOSE) &amp;amp; (MINUS==CLOSE) &amp;amp; (MODE==CLOSE)) // wait for release   {     __RESET_WATCHDOG();     // feed the dog   }  }  if (PLUS==CLOSE)  {    plus_flag = 1;    minus_flag = 0;    mode_flag = 0;   while (PLUS==CLOSE)  // wait for release   {     __RESET_WATCHDOG();     // feed the dog   }  }  if (MINUS==CLOSE)  {    plus_flag = 0;    minus_flag = 1;    mode_flag = 0;   while (MINUS==CLOSE)   // wait for release   {     __RESET_WATCHDOG();     // feed the dog   }  }  if (MODE==CLOSE)  {    plus_flag = 0;    minus_flag = 0;    mode_flag = 1;   while (MODE==CLOSE)  // wait for release   {     __RESET_WATCHDOG();     // feed the dog   }  }&lt;/PRE&gt;&lt;/DIV&gt;&lt;BR /&gt;This code was put into a new project, so this is all that is being compiled.&amp;nbsp; I get some very bizarre behavior.&amp;nbsp; With the above, the logical AND if statement does not work.&amp;nbsp; The incorrect arithmetic AND does evaluate true.&amp;nbsp; The next two if's with each separate input don't work either.&amp;nbsp; The Mode button input &lt;I&gt;does&lt;/I&gt; work.&amp;nbsp; I've looked at 0x0002 (the PTB port where my switches are located) and they show as 0x07 when open and low when closed.&lt;BR /&gt;&lt;BR /&gt;Now, if I take out the incorrect arithmetic AND block (the second if statment), then the rest of the if's evaluate true when buttons are pressed!&amp;nbsp; Like magic.&amp;nbsp; And all of this is repeatable.&amp;nbsp; I can comment out that bad block, it all works; uncomment and most everything is broken.&lt;BR /&gt;&lt;BR /&gt;Just the presence of my original loop is causing everything else not to work?&amp;nbsp; That makes &lt;B&gt;no&lt;/B&gt; sense to me at all.&amp;nbsp; Strange ghosts, these are indeed.&lt;BR /&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;/DIV&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 29 Oct 2020 08:43:38 GMT</pubDate>
      <guid>https://community.nxp.com/t5/8-bit-Microcontrollers/9S08QG-inputs-won-t-work-in-background-debug-mode-only/m-p/143127#M6496</guid>
      <dc:creator>irob</dc:creator>
      <dc:date>2020-10-29T08:43:38Z</dc:date>
    </item>
    <item>
      <title>Re: 9S08QG inputs won't work in background debug mode only</title>
      <link>https://community.nxp.com/t5/8-bit-Microcontrollers/9S08QG-inputs-won-t-work-in-background-debug-mode-only/m-p/143128#M6497</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;Another observation -- Though I'm have a heck of a time with the debugger right now, this same code works when running on its own.&lt;BR /&gt;&lt;BR /&gt;I have three different coloed LEDs to set in all the various if statements.&amp;nbsp; And they are all lighting with their corresponding switch closures.&amp;nbsp; So it's something about how my code looks to the debugger which isn't working.&lt;BR /&gt;&lt;DIV&gt;&lt;/DIV&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 23 Aug 2007 00:48:14 GMT</pubDate>
      <guid>https://community.nxp.com/t5/8-bit-Microcontrollers/9S08QG-inputs-won-t-work-in-background-debug-mode-only/m-p/143128#M6497</guid>
      <dc:creator>irob</dc:creator>
      <dc:date>2007-08-23T00:48:14Z</dc:date>
    </item>
    <item>
      <title>Re: 9S08QG inputs won't work in background debug mode only</title>
      <link>https://community.nxp.com/t5/8-bit-Microcontrollers/9S08QG-inputs-won-t-work-in-background-debug-mode-only/m-p/143129#M6498</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;Could you change the code so it gets compilable on its own?&lt;BR /&gt;I mean so that it does not have any unresolved dependencies like PLUS, CLOSE (I guess some macros?) or the plus_flag variable.&lt;BR /&gt;Checking the preprocessor output may also help eventually.&lt;BR /&gt;&lt;BR /&gt;Also which CW version are you using? Which options?&lt;BR /&gt;&lt;BR /&gt;Daniel&lt;BR /&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 23 Aug 2007 01:51:52 GMT</pubDate>
      <guid>https://community.nxp.com/t5/8-bit-Microcontrollers/9S08QG-inputs-won-t-work-in-background-debug-mode-only/m-p/143129#M6498</guid>
      <dc:creator>CompilerGuru</dc:creator>
      <dc:date>2007-08-23T01:51:52Z</dc:date>
    </item>
    <item>
      <title>Re: 9S08QG inputs won't work in background debug mode only</title>
      <link>https://community.nxp.com/t5/8-bit-Microcontrollers/9S08QG-inputs-won-t-work-in-background-debug-mode-only/m-p/143130#M6499</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;DIV&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;FONT size="2"&gt;Hello iRob,&lt;/FONT&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;FONT size="2"&gt;&lt;/FONT&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&lt;FONT size="2"&gt;I do see some inconsistencies in your test code that could possibly account for the ovserved erratic operation.&amp;nbsp; Let's examine the first section -&lt;/FONT&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;FONT face="Courier New" size="2"&gt;&lt;/FONT&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&lt;FONT face="Courier New" size="2"&gt;if ((PLUS==CLOSE) &amp;amp;&amp;amp; (MINUS==CLOSE) &amp;amp;&amp;amp; (MODE==CLOSE)) {&lt;BR /&gt;&amp;nbsp;&amp;nbsp; plus_flag = 1;&lt;BR /&gt;&amp;nbsp;&amp;nbsp; minus_flag = 1;&lt;BR /&gt;&amp;nbsp;&amp;nbsp; mode_flag = 1;&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;while ((PLUS==CLOSE) &amp;amp;&amp;amp; (MINUS==CLOSE) &amp;amp;&amp;amp; (MODE==CLOSE)) { // wait for release&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; __RESET_WATCHDOG();&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;}&lt;BR /&gt;}&lt;BR /&gt;&lt;/FONT&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;FONT face="Courier New" size="2"&gt;&lt;FONT face="Arial"&gt;&lt;/FONT&gt;&lt;/FONT&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&lt;FONT face="Courier New" size="2"&gt;&lt;FONT face="Arial"&gt;Firstly, I am assuming that each of your three tests appropriately generates a logical true&amp;nbsp;result when the associated switch is closed, but otherwise a false condition.&amp;nbsp; This is not evident from the posted code.&amp;nbsp; This would then imply that you require the closure of &lt;U&gt;all three&lt;/U&gt; &amp;nbsp;switches for the following code to execute, but the release of only one of the switches to exit from the wait loop.&amp;nbsp; I might have expected that you would require all three switches to be released before exiting the loop, and would need the following modification.&lt;/FONT&gt;&lt;/FONT&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;FONT face="Courier New" size="2"&gt;&lt;FONT face="Arial"&gt;&lt;/FONT&gt;&lt;/FONT&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&lt;FONT size="2"&gt;&lt;FONT face="Courier New"&gt;&amp;nbsp;&amp;nbsp; /* Wait for release of all switches */&lt;/FONT&gt;&lt;/FONT&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;FONT size="2"&gt;&lt;FONT face="Courier New"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;while ((PLUS==CLOSE)&amp;nbsp;|| (MINUS==CLOSE)&amp;nbsp;|| (MODE==CLOSE))&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; __RESET_WATCHDOG();&lt;BR /&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;FONT size="2"&gt;&lt;/FONT&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&lt;FONT size="2"&gt;Incidently, if you were to do this, the next section of code could&amp;nbsp;rarely execute since it also seems to require that all switches be closed, and it immediately follows a state where all switches are released.&lt;/FONT&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;FONT size="2"&gt;&lt;/FONT&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&lt;FONT size="2"&gt;However, as the code stands, if the last of the three switches to be activated should bounce, the first wait loop will exit, the next section of code will probably be skipped because the bounce period will usually exceed the few cycles for the next test, and the tests for individual switches would then occur.&amp;nbsp; One of the individual switches would register, but&amp;nbsp;because of its associated wait loop,&amp;nbsp;whether or not any other of the switches register a closure during the current passage of the code would depend on the&amp;nbsp;switch&amp;nbsp;release sequence.&lt;/FONT&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;FONT size="2"&gt;&lt;/FONT&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&lt;FONT size="2"&gt;With the existing code it remains doubtful that the second section of code would ever execute.&amp;nbsp; To achieve multiple tests for the &lt;U&gt;same&lt;/U&gt; switch state, I might suggest the following modified test code should achieve more predictable results.&lt;/FONT&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;FONT size="2"&gt;&lt;/FONT&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&lt;FONT face="Courier New" size="2"&gt;if ((PLUS==CLOSE) &amp;amp;&amp;amp; (MINUS==CLOSE) &amp;amp;&amp;amp; (MODE==CLOSE)) {&lt;BR /&gt;&amp;nbsp;&amp;nbsp; plus_flag = 1;&lt;BR /&gt;&amp;nbsp;&amp;nbsp; minus_flag = 1;&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;mode_flag = 1;&lt;BR /&gt;&amp;nbsp;&amp;nbsp; active_flag = 1;&lt;/FONT&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;FONT face="Courier New" size="2"&gt;}&lt;BR /&gt;if ((PLUS==CLOSE) &amp;amp; (MINUS==CLOSE) &amp;amp; (MODE==CLOSE)) {&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;plus_flag = 1;&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;minus_flag = 1;&lt;BR /&gt;&amp;nbsp;&amp;nbsp; mode_flag = 1;&lt;BR /&gt;&amp;nbsp;&amp;nbsp; active_flag = 1;&lt;/FONT&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;FONT face="Courier New" size="2"&gt;}&lt;BR /&gt;if (PLUS==CLOSE) {&lt;BR /&gt;&amp;nbsp;&amp;nbsp; plus_flag = 1;&lt;BR /&gt;&amp;nbsp;&amp;nbsp; minus_flag = 0;&lt;BR /&gt;&amp;nbsp;&amp;nbsp; mode_flag = 0;&lt;BR /&gt;&amp;nbsp;&amp;nbsp; active_flag = 1;&lt;/FONT&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;FONT face="Courier New" size="2"&gt;}&lt;BR /&gt;if (MINUS==CLOSE) {&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;plus_flag = 0;&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;minus_flag = 1;&lt;BR /&gt;&amp;nbsp;&amp;nbsp; mode_flag = 0;&lt;BR /&gt;&amp;nbsp;&amp;nbsp; active_flag = 1;&lt;/FONT&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;FONT face="Courier New" size="2"&gt;}&lt;BR /&gt;if (MODE==CLOSE) {&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;plus_flag = 0;&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;minus_flag = 0;&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;mode_flag = 1;&lt;/FONT&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;FONT face="Courier New" size="2"&gt;&amp;nbsp;&amp;nbsp; active_flag = 1;&lt;/FONT&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;FONT face="Courier New" size="2"&gt;}&lt;BR /&gt;if (active_flag) {&lt;/FONT&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;FONT face="Courier New" size="2"&gt;&lt;/FONT&gt;&lt;DIV&gt;&lt;FONT face="Courier New" size="2"&gt;&amp;nbsp;&amp;nbsp; /* Implement de-bounce delay here */&lt;/FONT&gt;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&lt;FONT size="2"&gt;}&lt;/FONT&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;FONT face="Courier New" size="2"&gt;&lt;/FONT&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&lt;FONT face="Courier New" size="2"&gt;/* Wait for release of all switches */&lt;/FONT&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;FONT face="Courier New" size="2"&gt;while ((PLUS==CLOSE)||(MINUS==CLOSE)||(MODE==CLOSE))&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; __RESET_WATCHDOG();&lt;BR /&gt;&lt;/FONT&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;FONT size="2"&gt;&lt;FONT face="Courier New"&gt;&lt;/FONT&gt;&lt;/FONT&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&lt;FONT size="2"&gt;&lt;FONT face="Courier New"&gt;if (active_flag) {&lt;/FONT&gt;&lt;/FONT&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;FONT size="2"&gt;&lt;/FONT&gt;&lt;DIV&gt;&lt;FONT face="Courier New" size="2"&gt;&amp;nbsp;&amp;nbsp; /* Implement de-bounce delay here */&lt;/FONT&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;FONT face="Courier New"&gt;&lt;/FONT&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&lt;FONT face="Courier New" size="2"&gt;&amp;nbsp;&amp;nbsp; active_flag = 0;&lt;/FONT&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;FONT face="Courier New" size="2"&gt;}&lt;/FONT&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;FONT size="2"&gt;&lt;/FONT&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&lt;FONT size="2"&gt;&lt;/FONT&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&lt;FONT size="2"&gt;Regards,&lt;/FONT&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;FONT size="2"&gt;Mac&lt;/FONT&gt;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;BR /&gt;&lt;BR /&gt;Message Edited by bigmac on &lt;SPAN class="date_text"&gt;2007-08-23&lt;/SPAN&gt; &lt;SPAN class="time_text"&gt;10:43 AM&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 23 Aug 2007 07:19:48 GMT</pubDate>
      <guid>https://community.nxp.com/t5/8-bit-Microcontrollers/9S08QG-inputs-won-t-work-in-background-debug-mode-only/m-p/143130#M6499</guid>
      <dc:creator>bigmac</dc:creator>
      <dc:date>2007-08-23T07:19:48Z</dc:date>
    </item>
    <item>
      <title>Re: 9S08QG inputs won't work in background debug mode only</title>
      <link>https://community.nxp.com/t5/8-bit-Microcontrollers/9S08QG-inputs-won-t-work-in-background-debug-mode-only/m-p/143131#M6500</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;Hey Mac, thanks for the long thoughtful post.&amp;nbsp; I appreciate it, as always!&lt;BR /&gt;&lt;BR /&gt;You make some good observations.&amp;nbsp; Firstly, yes I intended the first if block to trap on &lt;U&gt;all&lt;/U&gt; three buttons pressed.&amp;nbsp; So your suggestion for the negative condition in the while loop is a good one.&lt;BR /&gt;&lt;BR /&gt;However, regarding the debounce, the code I posted is a simplified version of my "real" code which does debounce the switches.&amp;nbsp; As soon as I discovered that the debugger may not be reading switch input correctly, I devoted my time to developing test code rather than actual debounced production code.&lt;BR /&gt;&lt;BR /&gt;The very fact that, for instance, the Freescale debugger is not evaluating the two triple-condition if statements in your revised example code worries me far more than anyting else at the moment.&amp;nbsp; I copied your code verbatim into my project and ran the debugger.&amp;nbsp; Stepping through the first two if's, the two conditions are never taken as true.&amp;nbsp; And I can watch register 0x0002 (the PTB) and see its value start at 0xA7 (PTB0-2 all pulled high) before pressing switches, and then change to 0xA0 when I press all three.&lt;BR /&gt;&lt;BR /&gt;Then I step into those if statements, yet the debugger doesn't enter the true condition. Instead, they are skipped over.&amp;nbsp; Now the individual switch if statements &lt;I&gt;do&lt;/I&gt; evaluate true when their respective switches are pressed.&amp;nbsp; Very, very odd indeed.&lt;BR /&gt;&lt;DIV&gt;&lt;/DIV&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 23 Aug 2007 22:25:40 GMT</pubDate>
      <guid>https://community.nxp.com/t5/8-bit-Microcontrollers/9S08QG-inputs-won-t-work-in-background-debug-mode-only/m-p/143131#M6500</guid>
      <dc:creator>irob</dc:creator>
      <dc:date>2007-08-23T22:25:40Z</dc:date>
    </item>
    <item>
      <title>Re: 9S08QG inputs won't work in background debug mode only</title>
      <link>https://community.nxp.com/t5/8-bit-Microcontrollers/9S08QG-inputs-won-t-work-in-background-debug-mode-only/m-p/143132#M6501</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;DIV&gt;&lt;FONT size="2"&gt;Hello iRob,&lt;/FONT&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;FONT size="2"&gt;&lt;/FONT&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&lt;FONT size="2"&gt;You have not yet clarified the content of your macros, to&amp;nbsp;confirm whether they correctly relate&amp;nbsp;the operation of the switches to the logic you have used.&amp;nbsp; The macros would need to expand to the following, or something logically equivalent,&amp;nbsp;after pre-processing&amp;nbsp;-&lt;/FONT&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;FONT size="2"&gt;&lt;/FONT&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&lt;FONT face="Courier New" size="2"&gt;if ((PTBD_PTBD0 == 0) &amp;amp;&amp;amp; (PTBD_PTBD1 == 0) &amp;amp;&amp;amp; (PTBD_PTBD2 == 0)) {&lt;/FONT&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;FONT size="2"&gt;&lt;/FONT&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&lt;FONT size="2"&gt;As an alternative test, you could try -&lt;/FONT&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;FONT size="2"&gt;&lt;/FONT&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&lt;FONT face="Courier New" size="2"&gt;if ((PTBD &amp;amp; 0x07) == 0) {&lt;/FONT&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;FONT size="2"&gt;&lt;/FONT&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&lt;FONT size="2"&gt;Regards,&lt;/FONT&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;FONT size="2"&gt;Mac&lt;/FONT&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;FONT size="2"&gt;&lt;/FONT&gt;&amp;nbsp;&lt;/DIV&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 24 Aug 2007 01:05:52 GMT</pubDate>
      <guid>https://community.nxp.com/t5/8-bit-Microcontrollers/9S08QG-inputs-won-t-work-in-background-debug-mode-only/m-p/143132#M6501</guid>
      <dc:creator>bigmac</dc:creator>
      <dc:date>2007-08-24T01:05:52Z</dc:date>
    </item>
    <item>
      <title>Re: 9S08QG inputs won't work in background debug mode only</title>
      <link>https://community.nxp.com/t5/8-bit-Microcontrollers/9S08QG-inputs-won-t-work-in-background-debug-mode-only/m-p/143133#M6502</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;DIV&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;DIV&gt;Might I&amp;nbsp;suggest as a SWAG is that there's a lot of logical operations going on before the comparison test? I wonder if reducing the number of operations, while retaining the logic of the code would help, like so:&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;desired_switch_combo = PLUS | MINUS | MODE; // Assumes you're polling uniquely positioned bits&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;if (desired_switch_combo == ALL_SWITCHES_CLOSED_MASK) {&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;// then do your stuff..&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;} // end if&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;/DIV&gt;&lt;BR /&gt;&lt;BR /&gt;Message Edited by J2MEJediMaster on &lt;SPAN class="date_text"&gt;2007-08-24&lt;/SPAN&gt; &lt;SPAN class="time_text"&gt;02:03 PM&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 24 Aug 2007 21:26:17 GMT</pubDate>
      <guid>https://community.nxp.com/t5/8-bit-Microcontrollers/9S08QG-inputs-won-t-work-in-background-debug-mode-only/m-p/143133#M6502</guid>
      <dc:creator>J2MEJediMaster</dc:creator>
      <dc:date>2007-08-24T21:26:17Z</dc:date>
    </item>
  </channel>
</rss>

