<?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: Interrupt Latency and Bus Clk frequency relationHC8/HCS08/HC12/HCS12 etc in 8-bit Microcontrollers</title>
    <link>https://community.nxp.com/t5/8-bit-Microcontrollers/Interrupt-Latency-and-Bus-Clk-frequency-relationHC8-HCS08-HC12/m-p/216937#M18875</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;DIV&gt;&lt;/DIV&gt;&lt;DIV&gt;Hi Peg!&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;I said "SWI&amp;nbsp; (swi&amp;nbsp;&amp;nbsp;ISR has no instructions) ",&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;Well&amp;nbsp;I forgot to say I use Cosmic C Compiler which itself inserts Push H on begining and Pull H and RTI at the end on its on.Programmers need not worry! Actual ISR contains those stuffs as it should be there.&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;And hence the statement.I never tried codewarrior.&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;One SWI costs 20 cycles.A block of SWI costs me much ! Its unacceptable.&lt;IMG alt=":robotsurprised:" class="emoticon emoticon-robotsurprised" id="robotsurprised" src="http://freescale.i.lithium.com/i/smilies/16x16_robot-surprised.gif" title="Robot surprised" /&gt;&lt;/DIV&gt;&lt;DIV&gt;I need a SW code which is independent of System clock, provide me a required &amp;nbsp;delay irrespective of clock freq.&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;Wanna give a try.Super contributer&amp;nbsp;&lt;IMG alt=":robotwink:" class="emoticon emoticon-robotwink" id="robotwink" src="http://freescale.i.lithium.com/i/smilies/16x16_robot-wink.gif" title="Robot wink" /&gt;&amp;nbsp;??!!???&lt;/DIV&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Fri, 16 Jan 2009 19:28:54 GMT</pubDate>
    <dc:creator>denny_george</dc:creator>
    <dc:date>2009-01-16T19:28:54Z</dc:date>
    <item>
      <title>Interrupt Latency and Bus Clk frequency relationHC8/HCS08/HC12/HCS12 etc</title>
      <link>https://community.nxp.com/t5/8-bit-Microcontrollers/Interrupt-Latency-and-Bus-Clk-frequency-relationHC8-HCS08-HC12/m-p/216931#M18869</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;DIV&gt;Hello All,&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;Is there any relationship between Interrupt Latency and Bus Clk frequency .&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;That is higher the Bus Clk, lesser is the latency.Something like this.Or it is fixed across the freq?&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;a) I'm asking you this because latency involves= interrupt identification+ Context saving(Pushing of CPU registers) +Jump to the interrupt vector+time just before first instr of ISR is executed.&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;b)Is Context saving(Pushing of CPU registers)&amp;nbsp; similar to normal push operation which has definite machine cycles.Or some HW logic sends to the stack on the reception of a trigger ?&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;From Instruction set I could see some machine cycles allocated for SWI.&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 16 Jan 2009 14:06:21 GMT</pubDate>
      <guid>https://community.nxp.com/t5/8-bit-Microcontrollers/Interrupt-Latency-and-Bus-Clk-frequency-relationHC8-HCS08-HC12/m-p/216931#M18869</guid>
      <dc:creator>denny_george</dc:creator>
      <dc:date>2009-01-16T14:06:21Z</dc:date>
    </item>
    <item>
      <title>Re: Interrupt Latency and Bus Clk frequency relationHC8/HCS08/HC12/HCS12 etc</title>
      <link>https://community.nxp.com/t5/8-bit-Microcontrollers/Interrupt-Latency-and-Bus-Clk-frequency-relationHC8-HCS08-HC12/m-p/216932#M18870</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;DIV&gt;Hello All,&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;I forgot to add some more thing.&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;1) It is assumed &lt;U&gt;background task is executing&lt;/U&gt; without any particular Interrupt disable.&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp; Simply means, at the end of the current instruction&amp;nbsp;in the background task, interrupt is detected.&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;2)Only one interrupt has come. (No higher priority interrupt&amp;nbsp;has accompained this interrupt of interest.)&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 16 Jan 2009 14:57:31 GMT</pubDate>
      <guid>https://community.nxp.com/t5/8-bit-Microcontrollers/Interrupt-Latency-and-Bus-Clk-frequency-relationHC8-HCS08-HC12/m-p/216932#M18870</guid>
      <dc:creator>denny_george</dc:creator>
      <dc:date>2009-01-16T14:57:31Z</dc:date>
    </item>
    <item>
      <title>Re: Interrupt Latency and Bus Clk frequency relationHC8/HCS08/HC12/HCS12 etc</title>
      <link>https://community.nxp.com/t5/8-bit-Microcontrollers/Interrupt-Latency-and-Bus-Clk-frequency-relationHC8-HCS08-HC12/m-p/216933#M18871</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;DIV&gt;Faster clock helps reducing interrupt latency.&lt;/DIV&gt;&lt;DIV&gt;&lt;BR /&gt;&lt;/DIV&gt;&lt;BLOCKQUOTE&gt;&lt;DIV&gt;&lt;HR /&gt;Geo*** wrote:&lt;BR /&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;a) I'm asking you this because latency involves= interrupt identification+ Context saving(Pushing of CPU registers) +Jump to the interrupt vector+time just before first instr of ISR is executed.&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/BLOCKQUOTE&gt;&lt;DIV&gt;Yes, but interrupt latency also depends on other interrupts. If you have more simultaneous interrupts, then interrupt latency is&amp;nbsp;what you said plus roughly the sum of execution times of all simultaneous interrupts. For example you have&amp;nbsp;3 interrupts (that may happen at the same time), and each ISR takes 50us. Then the worst case latency is about 50+50us or (3-1)*50us. Of course faster bus clock helps reducing this delay, because usually code executes faster with faster clocks.&lt;/DIV&gt;&lt;BLOCKQUOTE&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;b)Is Context saving(Pushing of CPU registers)&amp;nbsp; similar to normal push operation which has definite machine cycles.Or some HW logic sends to the stack on the reception of a trigger ?&lt;/DIV&gt;&lt;/BLOCKQUOTE&gt;&lt;DIV&gt;It depends. Some&amp;nbsp;MCUs&amp;nbsp;save/restore on the stack almost everything and you don't have to save/restore single byte. Others&amp;nbsp;may require&amp;nbsp;save/restore everything&amp;nbsp;by hand. Speaking about S12, all CPU registers are saved/restored on interrupt, and in the most of applications you don't need to save/restore more than that. But if you need for example to do&amp;nbsp;in ISR some manipulations to PPAGE register, then you need to save/restore&amp;nbsp;PPAGE manually.&amp;nbsp;Context saving is bit wider than just CPU registers.&lt;/DIV&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 16 Jan 2009 15:18:24 GMT</pubDate>
      <guid>https://community.nxp.com/t5/8-bit-Microcontrollers/Interrupt-Latency-and-Bus-Clk-frequency-relationHC8-HCS08-HC12/m-p/216933#M18871</guid>
      <dc:creator>kef</dc:creator>
      <dc:date>2009-01-16T15:18:24Z</dc:date>
    </item>
    <item>
      <title>Re: Interrupt Latency and Bus Clk frequency relationHC8/HCS08/HC12/HCS12 etc</title>
      <link>https://community.nxp.com/t5/8-bit-Microcontrollers/Interrupt-Latency-and-Bus-Clk-frequency-relationHC8-HCS08-HC12/m-p/216934#M18872</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;DIV&gt;Kef,&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;I was wondering whether I could write a small section of code which is frequency independent and hence the question.I'm considering only one interrupt,exit from iSR, then next interrupt something like this.&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;SWI&amp;nbsp; (swi&amp;nbsp;&amp;nbsp;ISR has no instructions)&lt;/DIV&gt;&lt;DIV&gt;SWI&lt;/DIV&gt;&lt;DIV&gt;SWI&lt;/DIV&gt;&lt;DIV&gt;&lt;DIV&gt;SWI&lt;/DIV&gt;&lt;DIV&gt;SWI&lt;/DIV&gt;&lt;DIV&gt;SWI&lt;/DIV&gt;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;Data Sheet gives some machine cycle time for SWI.&amp;nbsp;In such a scenario bus clock affects the code execution period.I don't know whether its true or not.&lt;/DIV&gt;&lt;DIV&gt;&lt;DIV&gt;&lt;BR /&gt;&lt;BLOCKQUOTE&gt;&lt;DIV&gt;&lt;HR /&gt;kef wrote:&lt;BR /&gt;&lt;BLOCKQUOTE&gt;&lt;DIV&gt;Some&amp;nbsp;MCUs&amp;nbsp;save/restore on the stack almost everything and you don't have to save/restore single byte. Others&amp;nbsp;may require&amp;nbsp;save/restore everything&amp;nbsp;by hand. Speaking about S12, all CPU registers are saved/restored on interrupt, and in the most of applications you don't need to save/restore more than that. But if you need for example to do&amp;nbsp;in ISR some manipulations to PPAGE register, then you need to save/restore&amp;nbsp;PPAGE manually.&amp;nbsp;Context saving is bit wider than just CPU registers.&lt;/DIV&gt;&lt;/BLOCKQUOTE&gt;&lt;BR /&gt;&lt;HR /&gt;&lt;/DIV&gt;&lt;/BLOCKQUOTE&gt;My question in mind was whether any harware internal logic (super fast ??!!???) would &lt;STRONG&gt;put/place&lt;/STRONG&gt; ( I would like to call this way rather than push, coz it might confuse one with executing PUSH instruction which executes with a definite machine cycle &amp;nbsp;time and hence dependent on frequency clock.) these CPU registers (like in HC/HCS) on stack.&lt;BR /&gt;&lt;DIV&gt;If we have "harware internal logic " that&amp;nbsp;would &lt;STRONG&gt;put/place&lt;/STRONG&gt;&amp;nbsp; definite number of CPU registers on stack then this latency would be independent of any frequency , i.e. execute in a exact period of time.&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&lt;IMG alt=":robotsurprised:" class="emoticon emoticon-robotsurprised" id="robotsurprised" src="http://freescale.i.lithium.com/i/smilies/16x16_robot-surprised.gif" title="Robot surprised" /&gt;Here again input clock frequency to the "harware internal logic "&amp;nbsp; should be independent of bus clock frequency.Isn't it.&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;And if context saving is happening with PUSH intructions, surely frequency inflences the time latency.&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 16 Jan 2009 15:54:34 GMT</pubDate>
      <guid>https://community.nxp.com/t5/8-bit-Microcontrollers/Interrupt-Latency-and-Bus-Clk-frequency-relationHC8-HCS08-HC12/m-p/216934#M18872</guid>
      <dc:creator>denny_george</dc:creator>
      <dc:date>2009-01-16T15:54:34Z</dc:date>
    </item>
    <item>
      <title>Re: Interrupt Latency and Bus Clk frequency relationHC8/HCS08/HC12/HCS12 etc</title>
      <link>https://community.nxp.com/t5/8-bit-Microcontrollers/Interrupt-Latency-and-Bus-Clk-frequency-relationHC8-HCS08-HC12/m-p/216935#M18873</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;DIV&gt;&lt;/DIV&gt;&lt;DIV&gt;Execution time of SWI instruction is also bus clock dependent. It takes fixed amount of bus cycles. You can't write bus clock independent, fixed execution time code without some timing hardware.&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;BR /&gt;&lt;BR /&gt;Message Edited by kef on &lt;SPAN class="date_text"&gt;2009-01-16&lt;/SPAN&gt; &lt;SPAN class="time_text"&gt;12:08 PM&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 16 Jan 2009 18:07:28 GMT</pubDate>
      <guid>https://community.nxp.com/t5/8-bit-Microcontrollers/Interrupt-Latency-and-Bus-Clk-frequency-relationHC8-HCS08-HC12/m-p/216935#M18873</guid>
      <dc:creator>kef</dc:creator>
      <dc:date>2009-01-16T18:07:28Z</dc:date>
    </item>
    <item>
      <title>Re: Interrupt Latency and Bus Clk frequency relationHC8/HCS08/HC12/HCS12 etc</title>
      <link>https://community.nxp.com/t5/8-bit-Microcontrollers/Interrupt-Latency-and-Bus-Clk-frequency-relationHC8-HCS08-HC12/m-p/216936#M18874</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;Hi Geo,&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BLOCKQUOTE&gt;&lt;HR /&gt;Geo*** wrote:&lt;BR /&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;SWI&amp;nbsp; (swi&amp;nbsp;&amp;nbsp;ISR has no instructions)&lt;/DIV&gt;&lt;BR /&gt;&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;Firstly a SWI ISR with no instructions is going to give you a lot of grief. You need at least a RTI there.&lt;BR /&gt;&lt;BR /&gt;On a S08 you have got 11 cycles for the SWI and 9 for the RTI. Umm thats 20 cycles, hardly nothing.&lt;BR /&gt;Yes, there is efficiencies over doing all the operations manually but it hardly vapourises to nothing.&lt;BR /&gt;&lt;BR /&gt;Giving may well be the soul of love, but here it costs 20 cycles.&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BLOCKQUOTE&gt;&lt;/BLOCKQUOTE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 16 Jan 2009 19:03:56 GMT</pubDate>
      <guid>https://community.nxp.com/t5/8-bit-Microcontrollers/Interrupt-Latency-and-Bus-Clk-frequency-relationHC8-HCS08-HC12/m-p/216936#M18874</guid>
      <dc:creator>peg</dc:creator>
      <dc:date>2009-01-16T19:03:56Z</dc:date>
    </item>
    <item>
      <title>Re: Interrupt Latency and Bus Clk frequency relationHC8/HCS08/HC12/HCS12 etc</title>
      <link>https://community.nxp.com/t5/8-bit-Microcontrollers/Interrupt-Latency-and-Bus-Clk-frequency-relationHC8-HCS08-HC12/m-p/216937#M18875</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;DIV&gt;&lt;/DIV&gt;&lt;DIV&gt;Hi Peg!&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;I said "SWI&amp;nbsp; (swi&amp;nbsp;&amp;nbsp;ISR has no instructions) ",&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;Well&amp;nbsp;I forgot to say I use Cosmic C Compiler which itself inserts Push H on begining and Pull H and RTI at the end on its on.Programmers need not worry! Actual ISR contains those stuffs as it should be there.&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;And hence the statement.I never tried codewarrior.&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;One SWI costs 20 cycles.A block of SWI costs me much ! Its unacceptable.&lt;IMG alt=":robotsurprised:" class="emoticon emoticon-robotsurprised" id="robotsurprised" src="http://freescale.i.lithium.com/i/smilies/16x16_robot-surprised.gif" title="Robot surprised" /&gt;&lt;/DIV&gt;&lt;DIV&gt;I need a SW code which is independent of System clock, provide me a required &amp;nbsp;delay irrespective of clock freq.&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;Wanna give a try.Super contributer&amp;nbsp;&lt;IMG alt=":robotwink:" class="emoticon emoticon-robotwink" id="robotwink" src="http://freescale.i.lithium.com/i/smilies/16x16_robot-wink.gif" title="Robot wink" /&gt;&amp;nbsp;??!!???&lt;/DIV&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 16 Jan 2009 19:28:54 GMT</pubDate>
      <guid>https://community.nxp.com/t5/8-bit-Microcontrollers/Interrupt-Latency-and-Bus-Clk-frequency-relationHC8-HCS08-HC12/m-p/216937#M18875</guid>
      <dc:creator>denny_george</dc:creator>
      <dc:date>2009-01-16T19:28:54Z</dc:date>
    </item>
    <item>
      <title>Re: Interrupt Latency and Bus Clk frequency relationHC8/HCS08/HC12/HCS12 etc</title>
      <link>https://community.nxp.com/t5/8-bit-Microcontrollers/Interrupt-Latency-and-Bus-Clk-frequency-relationHC8-HCS08-HC12/m-p/216938#M18876</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;Hi,&lt;BR /&gt;&lt;BR /&gt;You seem to be confusing what you input to your compiler with what your CPU actually executes.&lt;BR /&gt;When considering execution time what you input to your compiler or which one you use is fairly irrelevant.&lt;BR /&gt;&lt;BR /&gt;What you consider unacceptable or what you need is not going to effect the way your MPU operates.&lt;BR /&gt;&lt;BR /&gt;All instructions take a finite amount of cycles to execute, thus they will take an amount of time proportional to the clock speed.&lt;BR /&gt;&lt;BR /&gt;Unless you use the timer with an independent clock source, then you are never going to achieve this on these MPU's. Even then this is not your answer as you said software.&lt;BR /&gt;&lt;DIV&gt;&lt;/DIV&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 16 Jan 2009 19:56:39 GMT</pubDate>
      <guid>https://community.nxp.com/t5/8-bit-Microcontrollers/Interrupt-Latency-and-Bus-Clk-frequency-relationHC8-HCS08-HC12/m-p/216938#M18876</guid>
      <dc:creator>peg</dc:creator>
      <dc:date>2009-01-16T19:56:39Z</dc:date>
    </item>
    <item>
      <title>Re: Interrupt Latency and Bus Clk frequency relationHC8/HCS08/HC12/HCS12 etc</title>
      <link>https://community.nxp.com/t5/8-bit-Microcontrollers/Interrupt-Latency-and-Bus-Clk-frequency-relationHC8-HCS08-HC12/m-p/216939#M18877</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;Hi Peg&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;You have confused a lot. Try to understand that my compiler will automatically insert (on seeing @interrupt keyword) PSHH,(user code here)PULH,RTI. Programmer only needs to write his ISR code.Ok.Understood till here?&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;Now I'll remove PSHH and PULH.Now ISR contains only RTI.Now you might be thinking why i'm explaining this.This is because you said without RTI it would be a problem is retreiving the context of th epreviously executing task.&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&lt;DIV&gt;Remember you said " Firstly a SWI ISR with no instructions is going to give you a lot of grief. You need at least a RTI there."&lt;BR /&gt;&lt;BLOCKQUOTE&gt;&lt;DIV&gt;&lt;HR /&gt;peg wrote:&lt;BR /&gt;&lt;BR /&gt;All instructions take a finite amount of cycles to execute, thus they will take an amount of time proportional to the clock speed.&lt;BR /&gt;&lt;BR /&gt;Unless you use the timer with an independent clock source, then you are never going to achieve this on these MPU's. Even then this is not your answer as you said software.&lt;BR /&gt;&lt;DIV&gt;&lt;/DIV&gt;&lt;BR /&gt;&lt;HR /&gt;&lt;/DIV&gt;&lt;/BLOCKQUOTE&gt;Hmmm I'm speaking unnecessarily !!! &lt;IMG alt=":robotsad:" class="emoticon emoticon-robotsad" id="robotsad" src="http://freescale.i.lithium.com/i/smilies/16x16_robot-sad.gif" title="Robot Sad" /&gt; First paragraph: I completely agree with you.But SWI is a special instruction. See my above reply for its working. There could be two options of saving/retreiving context from the stack.CPU individually executing Push instructions on register L,H,X,A&amp;nbsp;; Setting I flag&amp;nbsp;&lt;BR /&gt;&lt;DIV&gt;loading PC.Second option could be hard wired logic which automatically does these sequentially one by one .Only HARDWARE delay involved and its fixed !!!!&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;I only wanted to confirm is it the second option.If it is, my task would be easy.continuosly call SWI till I get the required delay; Independent of clock frequency applied to MCU.One doesn't need a hardware timer for this!&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;"Unless you use the timer with an independent clock source, then you are never going to achieve this on these MPU's. "&lt;/DIV&gt;&lt;DIV&gt;This could be ideal thing to have in our MCUs: Accurate independent clock source.&lt;/DIV&gt;&lt;DIV&gt;Independent clock source( 1kHz)&amp;nbsp;varies upto 30% in some HCS08 MCUs.And no trimming feature!!! I cannot use this.&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;If SWI behaves as I wished I could have got an easy SW solution.But alas, as you pointed out 20 machine cycles ; which is dependent on clock frequency.&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;There could be some SW solution,somewhere....One has to just find it out.&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;BR /&gt;&lt;BR /&gt;Message Edited by Geo*** on &lt;SPAN class="date_text"&gt;2009-01-16&lt;/SPAN&gt; &lt;SPAN class="time_text"&gt;01:33 PM&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 16 Jan 2009 21:28:20 GMT</pubDate>
      <guid>https://community.nxp.com/t5/8-bit-Microcontrollers/Interrupt-Latency-and-Bus-Clk-frequency-relationHC8-HCS08-HC12/m-p/216939#M18877</guid>
      <dc:creator>denny_george</dc:creator>
      <dc:date>2009-01-16T21:28:20Z</dc:date>
    </item>
    <item>
      <title>Re: Interrupt Latency and Bus Clk frequency relationHC8/HCS08/HC12/HCS12 etc</title>
      <link>https://community.nxp.com/t5/8-bit-Microcontrollers/Interrupt-Latency-and-Bus-Clk-frequency-relationHC8-HCS08-HC12/m-p/216940#M18878</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;DIV&gt;Can someone take up this challenge ???!!!???&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;Giving is the soul of LOVE;unfortunately SWI takes 20 cycles.....&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;IMG alt=":robothappy:" class="emoticon emoticon-robothappy" id="robothappy" src="http://freescale.i.lithium.com/i/smilies/16x16_robot-happy.gif" title="Robot Happy" /&gt;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;Ake,&lt;/DIV&gt;&lt;DIV&gt;Where are you.&lt;/DIV&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 16 Jan 2009 21:30:36 GMT</pubDate>
      <guid>https://community.nxp.com/t5/8-bit-Microcontrollers/Interrupt-Latency-and-Bus-Clk-frequency-relationHC8-HCS08-HC12/m-p/216940#M18878</guid>
      <dc:creator>denny_george</dc:creator>
      <dc:date>2009-01-16T21:30:36Z</dc:date>
    </item>
    <item>
      <title>Re: Interrupt Latency and Bus Clk frequency relationHC8/HCS08/HC12/HCS12 etc</title>
      <link>https://community.nxp.com/t5/8-bit-Microcontrollers/Interrupt-Latency-and-Bus-Clk-frequency-relationHC8-HCS08-HC12/m-p/216941#M18879</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;DIV&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;BR /&gt;&lt;BLOCKQUOTE&gt;&lt;DIV&gt;&lt;HR /&gt;Geo*** wrote:&lt;BR /&gt;&lt;DIV&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&lt;DIV&gt;&lt;DIV&gt;...Second option could be hard wired logic which automatically does these sequentially one by one .Only HARDWARE delay involved and its fixed !!!!&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;HR /&gt;&lt;/DIV&gt;&lt;/BLOCKQUOTE&gt;&lt;BR /&gt;&lt;DIV&gt;It's not clear what option you are talking about. It is not possible to write bus clock independent fixed time code without some special hardware. SWI won't halp you in any way.&lt;/DIV&gt;&lt;/DIV&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 16 Jan 2009 21:47:55 GMT</pubDate>
      <guid>https://community.nxp.com/t5/8-bit-Microcontrollers/Interrupt-Latency-and-Bus-Clk-frequency-relationHC8-HCS08-HC12/m-p/216941#M18879</guid>
      <dc:creator>kef</dc:creator>
      <dc:date>2009-01-16T21:47:55Z</dc:date>
    </item>
    <item>
      <title>Re: Interrupt Latency and Bus Clk frequency relationHC8/HCS08/HC12/HCS12 etc</title>
      <link>https://community.nxp.com/t5/8-bit-Microcontrollers/Interrupt-Latency-and-Bus-Clk-frequency-relationHC8-HCS08-HC12/m-p/216942#M18880</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;DIV&gt;Kef,&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;Yes.&lt;/DIV&gt;&lt;DIV&gt;We are not sure if this special hardware is present inside the MCU.&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;See SWI takes 11 Bus Cycles.&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;Manual push of all registers will take you well above 11 Bus Cycles.&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;PC ← (PC) + $0001 // 1 cycle&lt;BR /&gt;Push (PCL); SP ← (SP) – $0001 // 2 cycles since all available push took 2.its an assumption made&lt;BR /&gt;Push (PCH); SP ← (SP) – $0001// 2 cycles since all available push took 2.its an assumption made&lt;BR /&gt;Push (X); SP ← (SP) – $0001 // // 2 cycles&lt;BR /&gt;Push (A); SP ← (SP) – $0001&amp;nbsp; // 2 cycles&lt;BR /&gt;Push (CCR); SP ← (SP) – $0001 // 2 cycles since all available push took 2.its an assumption made&lt;BR /&gt;I ← 1; // Assumption made is bitset instr used = 5 cycles&lt;BR /&gt;PCH ← Interrupt Vector High Byte // ?? average 3 or 4&lt;BR /&gt;PCL ← Interrupt Vector Low Byte&amp;nbsp; // ?? average 3 or 4&lt;BR /&gt;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;Already&amp;nbsp; 18.&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;What about initial interrupt detection,recognition.It will add to this . Surely there is a special hardware which does in 11 cycles.( I doubt FSL regarding this i.e. 11 cycles.It should be some finite time like say some xxx nano seconds)&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;May be this method could be immpossible.What about some hidden things that is yet to be seen/found.&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 16 Jan 2009 22:02:43 GMT</pubDate>
      <guid>https://community.nxp.com/t5/8-bit-Microcontrollers/Interrupt-Latency-and-Bus-Clk-frequency-relationHC8-HCS08-HC12/m-p/216942#M18880</guid>
      <dc:creator>denny_george</dc:creator>
      <dc:date>2009-01-16T22:02:43Z</dc:date>
    </item>
    <item>
      <title>Re: Interrupt Latency and Bus Clk frequency relationHC8/HCS08/HC12/HCS12 etc</title>
      <link>https://community.nxp.com/t5/8-bit-Microcontrollers/Interrupt-Latency-and-Bus-Clk-frequency-relationHC8-HCS08-HC12/m-p/216943#M18881</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;DIV&gt;Again.&amp;nbsp;All HC08-HCS12X instructions including SWI, also the time needed to jump to ISR, take&amp;nbsp;FIXED number of bus clocks. Execution time depends only on bus clock frequency and on response of MCU internal and external peripherals.&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;It is still not clear what you are trying to achieve. Do you want to determine the speed of external crystal? Then you have to use some other clock reference, for example internal RC clock.&lt;/DIV&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 16 Jan 2009 22:17:24 GMT</pubDate>
      <guid>https://community.nxp.com/t5/8-bit-Microcontrollers/Interrupt-Latency-and-Bus-Clk-frequency-relationHC8-HCS08-HC12/m-p/216943#M18881</guid>
      <dc:creator>kef</dc:creator>
      <dc:date>2009-01-16T22:17:24Z</dc:date>
    </item>
    <item>
      <title>Re: Interrupt Latency and Bus Clk frequency relationHC8/HCS08/HC12/HCS12 etc</title>
      <link>https://community.nxp.com/t5/8-bit-Microcontrollers/Interrupt-Latency-and-Bus-Clk-frequency-relationHC8-HCS08-HC12/m-p/216944#M18882</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;DIV&gt;&lt;/DIV&gt;&lt;DIV&gt;Kef,&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;I would say "HC08-HCS12X&amp;nbsp; SWI takes time needed to jump to ISR, take&amp;nbsp;FIXED time &lt;U&gt;&lt;STRONG&gt;measured in number of bus clocks.&lt;/STRONG&gt;&lt;/U&gt; Bus clocks is used only as a reference for measuring time.&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;You say to a Amazon tribal your shirt cost xx USD.For him,&amp;nbsp;difficult to understand also to remember.&lt;/DIV&gt;&lt;DIV&gt;You say it costs price of yyyyy SPEARS he is holding.Easy right.&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;Just like Hex Opcode and Mnemonic.&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&lt;DIV&gt;&lt;BR /&gt;&lt;BLOCKQUOTE&gt;&lt;DIV&gt;&lt;HR /&gt;&lt;/DIV&gt;&lt;DIV&gt;kef wrote:&lt;/DIV&gt;&lt;DIV&gt;&lt;BR /&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;It is still not clear what you are trying to achieve. Do you want to determine the speed of external crystal? Then you have to use some other clock reference, for example internal RC clock.&lt;/DIV&gt;&lt;DIV&gt;&lt;BR /&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;HR /&gt;&lt;/DIV&gt;&lt;/BLOCKQUOTE&gt;&lt;DIV&gt;With only code, I want constant time duration code block.&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&lt;DIV&gt;&lt;BR /&gt;&lt;BLOCKQUOTE&gt;&lt;DIV&gt;&lt;HR /&gt;kef wrote:&lt;BR /&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;It is still not clear what you are trying to achieve. Do you want to determine the speed of external crystal? Then you have to use some other clock reference, for example internal RC clock.&lt;/DIV&gt;&lt;BR /&gt;&lt;HR /&gt;&lt;/DIV&gt;&lt;/BLOCKQUOTE&gt;Anyway since you asked,&amp;nbsp;Internal RC clock has a deviation of +/- 2% after factory trim. Accuracy calculation of your crystal is compromised .And moreover RC oscillators' accuracy is dependent&amp;nbsp;on &amp;nbsp;Vdd, Temperature applied to MCU .&lt;IMG alt=":robothappy:" class="emoticon emoticon-robothappy" id="robothappy" src="http://freescale.i.lithium.com/i/smilies/16x16_robot-happy.gif" title="Robot Happy" /&gt;&lt;BR /&gt;&lt;DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;BR /&gt;&lt;BR /&gt;Message Edited by Geo*** on &lt;SPAN class="date_text"&gt;2009-01-16&lt;/SPAN&gt; &lt;SPAN class="time_text"&gt;02:41 PM&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 16 Jan 2009 22:40:05 GMT</pubDate>
      <guid>https://community.nxp.com/t5/8-bit-Microcontrollers/Interrupt-Latency-and-Bus-Clk-frequency-relationHC8-HCS08-HC12/m-p/216944#M18882</guid>
      <dc:creator>denny_george</dc:creator>
      <dc:date>2009-01-16T22:40:05Z</dc:date>
    </item>
    <item>
      <title>Re: Interrupt Latency and Bus Clk frequency relationHC8/HCS08/HC12/HCS12 etc</title>
      <link>https://community.nxp.com/t5/8-bit-Microcontrollers/Interrupt-Latency-and-Bus-Clk-frequency-relationHC8-HCS08-HC12/m-p/216945#M18883</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;DIV&gt;Hi,&lt;/DIV&gt;&lt;DIV&gt;You want to know the timing of an interrupt, is that correct?&lt;/DIV&gt;&lt;DIV&gt;(I have not read all the messages, so I might be wrong)&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;When an interrupt is received it takes, the 9S08 saves the CPU registers on the stack, except for reg H. That is it pushes A, X and CCR&amp;nbsp;on the stack, 6 cycles.&lt;/DIV&gt;&lt;DIV&gt;It then pushes the PC on the stack, 2 * 2 cycles = 4 cycles.&lt;/DIV&gt;&lt;DIV&gt;It fetches the interrupt vector, that is 2 * 2 cycles or 4 cycles and modifies the PC.&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;So the interrupt takes 6 + 4 + 4 = 14 cycles to enter the interrupt routine.&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&lt;DIV&gt;To this must&amp;nbsp;be added the time of the current instruction to be finished.&lt;/DIV&gt;&lt;DIV&gt;The slowest instruction is a version of&amp;nbsp; DBNZ. It takes 8 bus clocks.&lt;/DIV&gt;&lt;DIV&gt;So the time for the interupt is somwere between 14 and 14 + 8 = 22 clock cycles.&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;Was that what you wanted to know?&lt;/DIV&gt;&lt;DIV&gt;I saw that you were discussing the SWI instruction.&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;Regards,&lt;/DIV&gt;&lt;DIV&gt;Ake&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 20 Jan 2009 18:57:11 GMT</pubDate>
      <guid>https://community.nxp.com/t5/8-bit-Microcontrollers/Interrupt-Latency-and-Bus-Clk-frequency-relationHC8-HCS08-HC12/m-p/216945#M18883</guid>
      <dc:creator>Ake</dc:creator>
      <dc:date>2009-01-20T18:57:11Z</dc:date>
    </item>
  </channel>
</rss>

