<?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のトピックHow to write ISR for MC9S08SH32</title>
    <link>https://community.nxp.com/t5/8-bit-Microcontrollers/How-to-write-ISR-for-MC9S08SH32/m-p/734424#M22509</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi can anyone help me with how to write ISR for&amp;nbsp;MC9S08SH32 controller.&lt;/P&gt;&lt;P&gt;Thanks in&amp;nbsp;advance&amp;nbsp;hcs08&amp;nbsp;&lt;A href="https://community.nxp.com/t5/tag/mc9s08sh32/tg-p"&gt;#mc9s08sh32&lt;/A&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Mon, 26 Mar 2018 12:14:19 GMT</pubDate>
    <dc:creator>raju_</dc:creator>
    <dc:date>2018-03-26T12:14:19Z</dc:date>
    <item>
      <title>How to write ISR for MC9S08SH32</title>
      <link>https://community.nxp.com/t5/8-bit-Microcontrollers/How-to-write-ISR-for-MC9S08SH32/m-p/734424#M22509</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi can anyone help me with how to write ISR for&amp;nbsp;MC9S08SH32 controller.&lt;/P&gt;&lt;P&gt;Thanks in&amp;nbsp;advance&amp;nbsp;hcs08&amp;nbsp;&lt;A href="https://community.nxp.com/t5/tag/mc9s08sh32/tg-p"&gt;#mc9s08sh32&lt;/A&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 26 Mar 2018 12:14:19 GMT</pubDate>
      <guid>https://community.nxp.com/t5/8-bit-Microcontrollers/How-to-write-ISR-for-MC9S08SH32/m-p/734424#M22509</guid>
      <dc:creator>raju_</dc:creator>
      <dc:date>2018-03-26T12:14:19Z</dc:date>
    </item>
    <item>
      <title>Re: How to write ISR for MC9S08SH32</title>
      <link>https://community.nxp.com/t5/8-bit-Microcontrollers/How-to-write-ISR-for-MC9S08SH32/m-p/734425#M22510</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;You don't specify if you want in C or assembly.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Writing an ISR in C uses your compiler's specific syntax which varies somewhat between vendors (e.g., some use the `interrupt` keyword).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;In assembly language, it's more straight forward.&amp;nbsp; You need to write your code as you would a normal subroutine but be sure to do four things:&lt;/P&gt;&lt;P&gt;1. Change the RTS instruction to RTI&lt;/P&gt;&lt;P&gt;2. Explicitly protect the H register (i.e., use PSHH on entry and use PULH, RTI to exit)&lt;/P&gt;&lt;P&gt;3. Make sure you acknowledge the source of the interrupt to avoid re-entering the ISR for the same event.&lt;/P&gt;&lt;P&gt;4. Point the related interrupt vector to the start of your ISR routine.&amp;nbsp; (e.g., ORG $FFxx followed by DW My_ISR)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If you use an MMU capable variant (usually those have 64KB or more of Flash), make sure the ISR is located in non-paged memory (i.e., outside the MMU paging window).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The rest is the same as writing normal subroutines.&amp;nbsp; However, ISRs should be as short as possible in terms of execution time.&amp;nbsp; With a few exceptions that require truly instant attention, the plan is this: Acknowledge the event, save whatever needs to be saved in some data structure (e.g., a queue), and then let the main loop handle the event at a normal pace.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Hope this helps.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 28 Mar 2018 14:08:47 GMT</pubDate>
      <guid>https://community.nxp.com/t5/8-bit-Microcontrollers/How-to-write-ISR-for-MC9S08SH32/m-p/734425#M22510</guid>
      <dc:creator>tonyp</dc:creator>
      <dc:date>2018-03-28T14:08:47Z</dc:date>
    </item>
  </channel>
</rss>

