<?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: Sci for MC9S08GT60 in 8-bit Microcontrollers</title>
    <link>https://community.nxp.com/t5/8-bit-Microcontrollers/Sci-for-MC9S08GT60/m-p/139182#M5243</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;DIV&gt;&lt;FONT size="2"&gt;Hello Kris,&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 a baud rate of 9600, other higher priority&amp;nbsp;ISR(s) would need to take more than 1ms (about 3700 bus cycles) for overrun to occur.&amp;nbsp; If the execution time for any of the other ISRs is of this magnitude, this would seem excessive, and I might suggest that you consider a different approach with respect to these lengthy&amp;nbsp;ISRs.&amp;nbsp; As a general rule, there should not be intensive processing within any ISR.&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;If there happens to be a single offender ISR it should be feasible to re-enable interrupts within this one ISR only, provided you prevent re-entry to that particular&amp;nbsp;interrupt.&amp;nbsp; This way, there would be stack usage for a maximum of two interrupts only.&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;The following thread provides a discussion about the nesting of interrupts -&lt;/FONT&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;A href="http://forums.freescale.com/freescale/board/message?board.id=CWCOMM&amp;amp;message.id=4977" target="_blank"&gt;&lt;FONT size="2"&gt;&lt;/FONT&gt;&lt;/A&gt;&lt;A href="http://forums.freescale.com/freescale/board/message?board.id=CWCOMM&amp;amp;message.id=4977" target="test_blank"&gt;http://forums.freescale.com/freescale/board/message?board.id=CWCOMM&amp;amp;message.id=4977&lt;/A&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, 06 Jul 2007 22:36:41 GMT</pubDate>
    <dc:creator>bigmac</dc:creator>
    <dc:date>2007-07-06T22:36:41Z</dc:date>
    <item>
      <title>Sci for MC9S08GT60</title>
      <link>https://community.nxp.com/t5/8-bit-Microcontrollers/Sci-for-MC9S08GT60/m-p/139176#M5237</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;DIV&gt;Hi all.&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;// ---- External Crystal = 32768 Hz,&amp;nbsp;Fbus =&amp;nbsp;3,67 MHz - FEE mode&lt;BR /&gt;ICGC1 = 0b00111000;&lt;BR /&gt;ICGC2 = 0x52;&lt;BR /&gt;&lt;/DIV&gt;&lt;DIV&gt;For baud rate 9600 - BR&amp;nbsp;is set&amp;nbsp;to 24;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;interrupt sci2rx void SCI2_RX_RS()&lt;BR /&gt;{&lt;BR /&gt;&amp;nbsp;rej=SCI2S1;&lt;BR /&gt;&amp;nbsp;if(rej&amp;amp;0x8) {&lt;BR /&gt;&amp;nbsp;Rbajt=SCI2D;&lt;BR /&gt;&amp;nbsp;}&lt;BR /&gt;&amp;nbsp;Rbajt=SCI2D;&lt;BR /&gt;&amp;nbsp;if(SCI2C1_M) osmy_bit = SCI2C3 &amp;amp; SCI2C3_R8_MASK;&lt;BR /&gt;}&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;Sometimes&amp;nbsp;when I "call" the read interrupt routine&amp;nbsp;the OR flag&amp;nbsp;is automatic set.&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;Thanks.&lt;/DIV&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 05 Jul 2007 14:44:34 GMT</pubDate>
      <guid>https://community.nxp.com/t5/8-bit-Microcontrollers/Sci-for-MC9S08GT60/m-p/139176#M5237</guid>
      <dc:creator>kris</dc:creator>
      <dc:date>2007-07-05T14:44:34Z</dc:date>
    </item>
    <item>
      <title>Re: Sci for MC9S08GT60</title>
      <link>https://community.nxp.com/t5/8-bit-Microcontrollers/Sci-for-MC9S08GT60/m-p/139177#M5238</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;DIV&gt;&lt;/DIV&gt;Hello Kris,&lt;BR /&gt;&lt;BR /&gt;The clock and SCI baud rate setup appear to be okay.&amp;nbsp; I'm assuming that the baud rate register value is DECIMAL "24" and not 0x24.&lt;BR /&gt;&lt;BR /&gt;A common cause of overrun error (OR bit set) is another section of code disabling global interrupts for long periods of time or another interrupt requiring so much time to complete that an SCI receive interrupt goes unserviced.&amp;nbsp;&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;Frank&lt;DIV&gt;&lt;/DIV&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 05 Jul 2007 21:35:12 GMT</pubDate>
      <guid>https://community.nxp.com/t5/8-bit-Microcontrollers/Sci-for-MC9S08GT60/m-p/139177#M5238</guid>
      <dc:creator>thisobj</dc:creator>
      <dc:date>2007-07-05T21:35:12Z</dc:date>
    </item>
    <item>
      <title>Re: Sci for MC9S08GT60</title>
      <link>https://community.nxp.com/t5/8-bit-Microcontrollers/Sci-for-MC9S08GT60/m-p/139178#M5239</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;DIV&gt;&lt;FONT size="2"&gt;Hello,&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;Do you happen to be using 9-bit mode?&amp;nbsp; If so, both SCIxD and R8 bit must be read to clear the RDRF flag.&amp;nbsp; Failure to do so could result in an overrun error.&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, 06 Jul 2007 02:00:05 GMT</pubDate>
      <guid>https://community.nxp.com/t5/8-bit-Microcontrollers/Sci-for-MC9S08GT60/m-p/139178#M5239</guid>
      <dc:creator>bigmac</dc:creator>
      <dc:date>2007-07-06T02:00:05Z</dc:date>
    </item>
    <item>
      <title>Re: Sci for MC9S08GT60</title>
      <link>https://community.nxp.com/t5/8-bit-Microcontrollers/Sci-for-MC9S08GT60/m-p/139179#M5240</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;DIV&gt;&lt;/DIV&gt;&lt;DIV&gt;Hi and welcome Kris,&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;I did not confrim your baudrate settings however the ISR looks ok.&lt;/DIV&gt;&lt;DIV&gt;You also seem to be handling 9-bit mode correctly.&lt;/DIV&gt;&lt;DIV&gt;Although I wonder if you have represented your code correctly.&lt;/DIV&gt;&lt;DIV&gt;Here, you seem to be reading SCID (into Rbajt) twice if OR set and once if not, which does not make sense to me.&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;So it would seem that the ISR is being blocked (by being disabled either directly or other ISR's).&lt;/DIV&gt;&lt;DIV&gt;This would need to occur for one character time though.&lt;/DIV&gt;&lt;DIV&gt;You could perhaps try (for a test) doubling your bus speed (but keeping baud the same) to see if this has any effect. Or disabling other interrupts?&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;BR /&gt;&lt;BR /&gt;Message Edited by peg on &lt;SPAN class="date_text"&gt;2007-07-06&lt;/SPAN&gt; &lt;SPAN class="time_text"&gt;09:20 AM&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 06 Jul 2007 06:12:12 GMT</pubDate>
      <guid>https://community.nxp.com/t5/8-bit-Microcontrollers/Sci-for-MC9S08GT60/m-p/139179#M5240</guid>
      <dc:creator>peg</dc:creator>
      <dc:date>2007-07-06T06:12:12Z</dc:date>
    </item>
    <item>
      <title>Re: Sci for MC9S08GT60</title>
      <link>https://community.nxp.com/t5/8-bit-Microcontrollers/Sci-for-MC9S08GT60/m-p/139180#M5241</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;How&amp;nbsp;increase priority of ISR (SCI1)?&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;Best regards.&lt;/DIV&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 06 Jul 2007 13:15:20 GMT</pubDate>
      <guid>https://community.nxp.com/t5/8-bit-Microcontrollers/Sci-for-MC9S08GT60/m-p/139180#M5241</guid>
      <dc:creator>kris</dc:creator>
      <dc:date>2007-07-06T13:15:20Z</dc:date>
    </item>
    <item>
      <title>Re: Sci for MC9S08GT60</title>
      <link>https://community.nxp.com/t5/8-bit-Microcontrollers/Sci-for-MC9S08GT60/m-p/139181#M5242</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;DIV&gt;&lt;/DIV&gt;Hi Kris,&lt;BR /&gt;&lt;BR /&gt;There is no way for the user to prioritize interrupts.&amp;nbsp; There is an internal priority, and this is described on &lt;B&gt;&lt;I&gt;page 66 of document, MC9S08GB60/D.pdf&lt;/I&gt;&lt;/B&gt;.&amp;nbsp;&amp;nbsp; Keep in mind that internal priority is only relevant in the case of multiple interrupts pending.&amp;nbsp; When an interrupt occurs, further interrupts are locked out until (1) that interrupt service returns (with an RTI) or (2) the code specifically enables interrupts within the service code.&amp;nbsp; Choice (2) is extremely risky in a processor with limited RAM or if using an RTOS, since stack overflow can easily occur. &amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;The&amp;nbsp; suggestion by Peg to disable other interrupts as a test is a good one.&amp;nbsp; Typically, multiple PWM interrupts can cause long holdoff times in servicing lower priority interrupts.&lt;BR /&gt;&lt;BR /&gt;You could eliminate the double read on the data register as follows:&lt;BR /&gt;&lt;BLOCKQUOTE&gt;// &lt;I&gt;modify code as follows:&lt;/I&gt;&lt;BR /&gt;&lt;/BLOCKQUOTE&gt;&lt;BLOCKQUOTE&gt;&lt;I&gt;rej = SCI2S1;&lt;/I&gt;&lt;BR /&gt;&lt;I&gt;Rbajt = SCI2D;&lt;/I&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;I&gt;if( rej &amp;amp; 0x08 ) {&lt;/I&gt;&lt;BR /&gt;&lt;I&gt;&amp;nbsp;&amp;nbsp; rej&amp;nbsp; = rej;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; // this could be your breakpoint on OR set.&lt;/I&gt;&lt;BR /&gt;&lt;I&gt;}&lt;BR /&gt;&lt;BR /&gt;&lt;/I&gt;&lt;I&gt;// remaining 'M' test code...&lt;/I&gt;&lt;BR /&gt;&lt;/BLOCKQUOTE&gt;NOTE: Since &lt;I&gt;rej&lt;/I&gt; and &lt;I&gt;Rbajt&lt;/I&gt; are assigned to register values, they should be delcared as volatile byte-length types (example:&amp;nbsp; &lt;I&gt;volatile char rej&lt;/I&gt;).&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;Frank&lt;BR /&gt;&lt;DIV&gt;&lt;/DIV&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 06 Jul 2007 18:52:52 GMT</pubDate>
      <guid>https://community.nxp.com/t5/8-bit-Microcontrollers/Sci-for-MC9S08GT60/m-p/139181#M5242</guid>
      <dc:creator>thisobj</dc:creator>
      <dc:date>2007-07-06T18:52:52Z</dc:date>
    </item>
    <item>
      <title>Re: Sci for MC9S08GT60</title>
      <link>https://community.nxp.com/t5/8-bit-Microcontrollers/Sci-for-MC9S08GT60/m-p/139182#M5243</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;DIV&gt;&lt;FONT size="2"&gt;Hello Kris,&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 a baud rate of 9600, other higher priority&amp;nbsp;ISR(s) would need to take more than 1ms (about 3700 bus cycles) for overrun to occur.&amp;nbsp; If the execution time for any of the other ISRs is of this magnitude, this would seem excessive, and I might suggest that you consider a different approach with respect to these lengthy&amp;nbsp;ISRs.&amp;nbsp; As a general rule, there should not be intensive processing within any ISR.&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;If there happens to be a single offender ISR it should be feasible to re-enable interrupts within this one ISR only, provided you prevent re-entry to that particular&amp;nbsp;interrupt.&amp;nbsp; This way, there would be stack usage for a maximum of two interrupts only.&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;The following thread provides a discussion about the nesting of interrupts -&lt;/FONT&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;A href="http://forums.freescale.com/freescale/board/message?board.id=CWCOMM&amp;amp;message.id=4977" target="_blank"&gt;&lt;FONT size="2"&gt;&lt;/FONT&gt;&lt;/A&gt;&lt;A href="http://forums.freescale.com/freescale/board/message?board.id=CWCOMM&amp;amp;message.id=4977" target="test_blank"&gt;http://forums.freescale.com/freescale/board/message?board.id=CWCOMM&amp;amp;message.id=4977&lt;/A&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, 06 Jul 2007 22:36:41 GMT</pubDate>
      <guid>https://community.nxp.com/t5/8-bit-Microcontrollers/Sci-for-MC9S08GT60/m-p/139182#M5243</guid>
      <dc:creator>bigmac</dc:creator>
      <dc:date>2007-07-06T22:36:41Z</dc:date>
    </item>
  </channel>
</rss>

