<?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中的主题 Byte content differs in ISR routine</title>
    <link>https://community.nxp.com/t5/8-bit-Microcontrollers/Byte-content-differs-in-ISR-routine/m-p/163327#M10044</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;DIV&gt;Hi, I'm having some problem with my code&lt;/DIV&gt;&lt;DIV&gt;1.when i 'lda' my TXBUF+1 which is TXBUF,X in my isr routine i keep getting a different value as shown in my memory (not as what i wanted). - (2_isr.jpg)&lt;/DIV&gt;&lt;DIV&gt;2.Therefore, I tried doing it before the isr occurs, I managed to get the correct value as in the memory.&lt;/DIV&gt;&lt;DIV&gt;(1_b4 isr.jpg)&lt;/DIV&gt;&lt;DIV&gt;3.similiarly, the isr occur &amp;amp; i didn't get what i wanted. (2_isr.jpg)&lt;/DIV&gt;&lt;DIV&gt;4.However, after the isr &amp;amp; I trigger the similiar routine in step 1 i dont seem to be able to get the value similiar to the mamory anymore. (3_after isr.jpg)&lt;/DIV&gt;&lt;DIV&gt;Please advise.&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;Regards,&lt;/DIV&gt;&lt;DIV&gt;MY&lt;/DIV&gt;&lt;DIV&gt;&lt;A _jive_internal="true" href="https://community.nxp.com/external-link.jspa?url=http%3A%2F%2Fwww.freescale.com%2Ffiles%2Fcommunity_files%2F8BITCOMM%2F10982_1_3_after_isr.jpg" rel="nofollow" target="_blank"&gt;3_after_isr.jpg&lt;/A&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;A _jive_internal="true" href="https://community.nxp.com/external-link.jspa?url=http%3A%2F%2Fwww.freescale.com%2Ffiles%2Fcommunity_files%2F8BITCOMM%2F10982_2_1_b4_isr.jpg" rel="nofollow" target="_blank"&gt;1_b4_isr.jpg&lt;/A&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;A _jive_internal="true" href="https://community.nxp.com/external-link.jspa?url=http%3A%2F%2Fwww.freescale.com%2Ffiles%2Fcommunity_files%2F8BITCOMM%2F10982_3_2_isr.jpg" rel="nofollow" target="_blank"&gt;2_isr.jpg&lt;/A&gt;&lt;BR /&gt;&lt;/DIV&gt;&lt;DIV class="message-edit-history"&gt;&lt;SPAN class="edit-author"&gt;Message Edited by t.dowe on&lt;/SPAN&gt; &lt;SPAN class="local-date"&gt;2009-10-19&lt;/SPAN&gt; &lt;SPAN class="local-time"&gt;10:39 AM&lt;/SPAN&gt;&lt;/DIV&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 11 Jun 2008 16:37:17 GMT</pubDate>
    <dc:creator>mylim</dc:creator>
    <dc:date>2008-06-11T16:37:17Z</dc:date>
    <item>
      <title>Byte content differs in ISR routine</title>
      <link>https://community.nxp.com/t5/8-bit-Microcontrollers/Byte-content-differs-in-ISR-routine/m-p/163327#M10044</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;DIV&gt;Hi, I'm having some problem with my code&lt;/DIV&gt;&lt;DIV&gt;1.when i 'lda' my TXBUF+1 which is TXBUF,X in my isr routine i keep getting a different value as shown in my memory (not as what i wanted). - (2_isr.jpg)&lt;/DIV&gt;&lt;DIV&gt;2.Therefore, I tried doing it before the isr occurs, I managed to get the correct value as in the memory.&lt;/DIV&gt;&lt;DIV&gt;(1_b4 isr.jpg)&lt;/DIV&gt;&lt;DIV&gt;3.similiarly, the isr occur &amp;amp; i didn't get what i wanted. (2_isr.jpg)&lt;/DIV&gt;&lt;DIV&gt;4.However, after the isr &amp;amp; I trigger the similiar routine in step 1 i dont seem to be able to get the value similiar to the mamory anymore. (3_after isr.jpg)&lt;/DIV&gt;&lt;DIV&gt;Please advise.&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;Regards,&lt;/DIV&gt;&lt;DIV&gt;MY&lt;/DIV&gt;&lt;DIV&gt;&lt;A _jive_internal="true" href="https://community.nxp.com/external-link.jspa?url=http%3A%2F%2Fwww.freescale.com%2Ffiles%2Fcommunity_files%2F8BITCOMM%2F10982_1_3_after_isr.jpg" rel="nofollow" target="_blank"&gt;3_after_isr.jpg&lt;/A&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;A _jive_internal="true" href="https://community.nxp.com/external-link.jspa?url=http%3A%2F%2Fwww.freescale.com%2Ffiles%2Fcommunity_files%2F8BITCOMM%2F10982_2_1_b4_isr.jpg" rel="nofollow" target="_blank"&gt;1_b4_isr.jpg&lt;/A&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;A _jive_internal="true" href="https://community.nxp.com/external-link.jspa?url=http%3A%2F%2Fwww.freescale.com%2Ffiles%2Fcommunity_files%2F8BITCOMM%2F10982_3_2_isr.jpg" rel="nofollow" target="_blank"&gt;2_isr.jpg&lt;/A&gt;&lt;BR /&gt;&lt;/DIV&gt;&lt;DIV class="message-edit-history"&gt;&lt;SPAN class="edit-author"&gt;Message Edited by t.dowe on&lt;/SPAN&gt; &lt;SPAN class="local-date"&gt;2009-10-19&lt;/SPAN&gt; &lt;SPAN class="local-time"&gt;10:39 AM&lt;/SPAN&gt;&lt;/DIV&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 11 Jun 2008 16:37:17 GMT</pubDate>
      <guid>https://community.nxp.com/t5/8-bit-Microcontrollers/Byte-content-differs-in-ISR-routine/m-p/163327#M10044</guid>
      <dc:creator>mylim</dc:creator>
      <dc:date>2008-06-11T16:37:17Z</dc:date>
    </item>
    <item>
      <title>Re: Byte content differs in ISR routine</title>
      <link>https://community.nxp.com/t5/8-bit-Microcontrollers/Byte-content-differs-in-ISR-routine/m-p/163328#M10045</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;I didn't spend much time but it seems the screen shots you provided don't give enough information (the memory window for example is locked at $220 while HX points at different places.)&lt;BR /&gt;&lt;BR /&gt;Anyway, I don't see a PULH before the RTI which implies you either don't initialize H (I don't see it in the code segment) which would make all indexed mode instructions pretty much random, based on the value of H before entering the ISR, or you're destroying it, which again will cause problems.&lt;BR /&gt;&lt;DIV&gt;&lt;/DIV&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 11 Jun 2008 16:58:57 GMT</pubDate>
      <guid>https://community.nxp.com/t5/8-bit-Microcontrollers/Byte-content-differs-in-ISR-routine/m-p/163328#M10045</guid>
      <dc:creator>tonyp</dc:creator>
      <dc:date>2008-06-11T16:58:57Z</dc:date>
    </item>
    <item>
      <title>Re: Byte content differs in ISR routine</title>
      <link>https://community.nxp.com/t5/8-bit-Microcontrollers/Byte-content-differs-in-ISR-routine/m-p/163329#M10046</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;DIV&gt;hi Tony,&lt;/DIV&gt;&lt;DIV&gt;I did psha &amp;amp; pshx when entering the isr &amp;amp; pulx &amp;amp; pula upon exit.&lt;/DIV&gt;&lt;DIV&gt;Are you saying that pshh &amp;amp; pulh is required too?&lt;/DIV&gt;&lt;DIV&gt;Thanks.&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;Regards,&lt;/DIV&gt;&lt;DIV&gt;my&lt;/DIV&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 11 Jun 2008 17:08:01 GMT</pubDate>
      <guid>https://community.nxp.com/t5/8-bit-Microcontrollers/Byte-content-differs-in-ISR-routine/m-p/163329#M10046</guid>
      <dc:creator>mylim</dc:creator>
      <dc:date>2008-06-11T17:08:01Z</dc:date>
    </item>
    <item>
      <title>Re: Byte content differs in ISR routine</title>
      <link>https://community.nxp.com/t5/8-bit-Microcontrollers/Byte-content-differs-in-ISR-routine/m-p/163330#M10047</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;DIV&gt;&lt;/DIV&gt;Not only that.&amp;nbsp; I'm also saying you don't seem to be initializing H which is required for indexed mode addressing.&amp;nbsp; X alone is not enough.&lt;BR /&gt;&lt;DIV&gt;&lt;/DIV&gt;&lt;BR /&gt;By the way, ISRs automatically save all registers, EXCEPT register H.&amp;nbsp; So, you're saving/restoring the wrong set of registers.&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;Message Edited by tonyp on &lt;SPAN class="date_text"&gt;2008-06-11&lt;/SPAN&gt; &lt;SPAN class="time_text"&gt;01:12 PM&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 11 Jun 2008 17:10:49 GMT</pubDate>
      <guid>https://community.nxp.com/t5/8-bit-Microcontrollers/Byte-content-differs-in-ISR-routine/m-p/163330#M10047</guid>
      <dc:creator>tonyp</dc:creator>
      <dc:date>2008-06-11T17:10:49Z</dc:date>
    </item>
    <item>
      <title>Re: Byte content differs in ISR routine</title>
      <link>https://community.nxp.com/t5/8-bit-Microcontrollers/Byte-content-differs-in-ISR-routine/m-p/163331#M10048</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;DIV&gt;Hi Tony,&lt;/DIV&gt;&lt;DIV&gt;I'd tried with pshh &amp;amp; pulh it seems to be the same because i didn't involve HX where i only use X.&lt;/DIV&gt;&lt;DIV&gt;I suppose it wont effect H rite?&lt;/DIV&gt;&lt;DIV&gt;Meanwhile, as you were saying&lt;/DIV&gt;&lt;DIV&gt;&lt;DIV&gt;&lt;BR /&gt;&lt;/DIV&gt;&lt;BLOCKQUOTE&gt;&lt;DIV&gt;&lt;HR /&gt;tonyp wrote:&lt;BR /&gt;&amp;nbsp;(the memory window for example is locked at $220 while HX points at different places.)&lt;BR /&gt;&lt;HR /&gt;&lt;/DIV&gt;&lt;/BLOCKQUOTE&gt;&lt;DIV&gt;the register column HX is showing 200 meaning X=00 where it's refering to TXBUF,0 which means TXBUF+0 am i right?&lt;/DIV&gt;&lt;DIV&gt;Please let me know what other information i should provide in order to assist you to help me understand my problem.&lt;/DIV&gt;&lt;DIV&gt;Thanks.&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;regards,&lt;/DIV&gt;&lt;DIV&gt;MY&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&lt;A href="http://www.freescale.com/files/community_files/8BITCOMM/10986_4_pshh.jpg" rel="nofollow" target="_self"&gt;4_pshh.jpg&lt;/A&gt;&lt;BR /&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;DIV class="message-edit-history"&gt;&lt;SPAN class="edit-author"&gt;Message Edited by t.dowe on&lt;/SPAN&gt; &lt;SPAN class="local-date"&gt;2009-10-27&lt;/SPAN&gt; &lt;SPAN class="local-time"&gt;12:20 PM&lt;/SPAN&gt;&lt;/DIV&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 11 Jun 2008 17:19:08 GMT</pubDate>
      <guid>https://community.nxp.com/t5/8-bit-Microcontrollers/Byte-content-differs-in-ISR-routine/m-p/163331#M10048</guid>
      <dc:creator>mylim</dc:creator>
      <dc:date>2008-06-11T17:19:08Z</dc:date>
    </item>
    <item>
      <title>Re: Byte content differs in ISR routine</title>
      <link>https://community.nxp.com/t5/8-bit-Microcontrollers/Byte-content-differs-in-ISR-routine/m-p/163332#M10049</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;DIV&gt;&lt;/DIV&gt;Indexed instructions use HX, not X alone.&lt;BR /&gt;&lt;BR /&gt;So, lda OFFSET,x&lt;BR /&gt;&lt;BR /&gt;will add OFFSET to HX and use that as an address.&amp;nbsp; You MUST initialize HX to the correct base location.&amp;nbsp; Hope you see the problem now.&lt;BR /&gt;&lt;DIV&gt;&lt;/DIV&gt;&lt;BR /&gt;&lt;BR /&gt;Message Edited by tonyp on &lt;SPAN class="date_text"&gt;2008-06-11&lt;/SPAN&gt; &lt;SPAN class="time_text"&gt;01:23 PM&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 11 Jun 2008 17:22:17 GMT</pubDate>
      <guid>https://community.nxp.com/t5/8-bit-Microcontrollers/Byte-content-differs-in-ISR-routine/m-p/163332#M10049</guid>
      <dc:creator>tonyp</dc:creator>
      <dc:date>2008-06-11T17:22:17Z</dc:date>
    </item>
    <item>
      <title>Re: Byte content differs in ISR routine</title>
      <link>https://community.nxp.com/t5/8-bit-Microcontrollers/Byte-content-differs-in-ISR-routine/m-p/163333#M10050</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;DIV&gt;Hi Tony,&lt;/DIV&gt;&lt;DIV&gt;I finally got it.&lt;/DIV&gt;&lt;DIV&gt;Now that i understands the concept &amp;amp; relation between H &amp;amp; X.&lt;/DIV&gt;&lt;DIV&gt;Thanks man.&lt;/DIV&gt;&lt;DIV&gt;&lt;IMG alt=":smileyvery-happy:" class="emoticon emoticon-smileyvery-happy" id="smileyvery-happy" src="http://freescale.i.lithium.com/i/smilies/16x16_smiley-very-happy.gif" title="Smiley Very Happy" /&gt;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;Regards,&lt;/DIV&gt;&lt;DIV&gt;MY&lt;/DIV&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 11 Jun 2008 17:22:53 GMT</pubDate>
      <guid>https://community.nxp.com/t5/8-bit-Microcontrollers/Byte-content-differs-in-ISR-routine/m-p/163333#M10050</guid>
      <dc:creator>mylim</dc:creator>
      <dc:date>2008-06-11T17:22:53Z</dc:date>
    </item>
    <item>
      <title>Re: Byte content differs in ISR routine</title>
      <link>https://community.nxp.com/t5/8-bit-Microcontrollers/Byte-content-differs-in-ISR-routine/m-p/163334#M10051</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;Hi...&lt;BR /&gt;Tonyp has reason, its a good practice to save context of H register into a interruption (pshh) this needs be the first instruction into our interruption code, and reload his value (pulh) this needs be the last instruction before rti.&lt;BR /&gt;&lt;BR /&gt;The HC08 family not save H register automatically when a interrupt has ocurred in order to maintain compatibility with old code in HC05 family.&lt;BR /&gt;&lt;BR /&gt;But when you write your code in C, the compiler automatically adds this instructions into your handler interrupt function.&lt;BR /&gt;&lt;BR /&gt;&lt;DIV&gt;&lt;/DIV&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 12 Jun 2008 10:40:34 GMT</pubDate>
      <guid>https://community.nxp.com/t5/8-bit-Microcontrollers/Byte-content-differs-in-ISR-routine/m-p/163334#M10051</guid>
      <dc:creator>erooll</dc:creator>
      <dc:date>2008-06-12T10:40:34Z</dc:date>
    </item>
  </channel>
</rss>

