<?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>S12 / MagniV Microcontrollers中的主题 Re: Serial communication trouble</title>
    <link>https://community.nxp.com/t5/S12-MagniV-Microcontrollers/Serial-communication-trouble/m-p/206659#M8404</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello, and welcome to the forum.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;One possibility is that you may be stuck within the wait loop in the first line of the SENDDATA sub-routine, and then a COP timeout eventually occurs, to cause a reset.&amp;nbsp; In this case the sub-routine would not complete, and the RTS instruction would not be reached.&amp;nbsp; Temporarily comment out the wait loop, and see if the reset problem persists.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;If you are actually reaching the RTS instruction (and a single SCI character is sent),&amp;nbsp; perhaps the stack-based&amp;nbsp;return address of the sub-routine is somehow being corrupted.&amp;nbsp; If&amp;nbsp;execution of an ISR&amp;nbsp;were to occur whilst within the sub-routine, the ISR would be the likely source of the problem.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Mac&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Sun, 13 Jun 2010 12:04:48 GMT</pubDate>
    <dc:creator>bigmac</dc:creator>
    <dc:date>2010-06-13T12:04:48Z</dc:date>
    <item>
      <title>Serial communication trouble</title>
      <link>https://community.nxp.com/t5/S12-MagniV-Microcontrollers/Serial-communication-trouble/m-p/206658#M8403</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello, I have trouble on a serial communication subroutine and would like to have some help.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I'm using a MC9S12X MCU an after executing a ATD single-channel conversion the following code is executed:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; LDAA ATDDR0&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; JSR SENDATA&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;SENDATA&amp;nbsp;&amp;nbsp; BRCLR SCISR1,$80,SENDATA&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; STAA SCIDRL&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp; RTS&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The problem is that after the RTS, the program branches to the begging of the code instead of branching to the place of the code where the subroutine was called.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I've tried this code on a MC9S12 MCU too and the same thing occurs. I would like to find out why this is happening and any solution. I'll pretty much appreciate any help here.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 13 Jun 2010 04:05:51 GMT</pubDate>
      <guid>https://community.nxp.com/t5/S12-MagniV-Microcontrollers/Serial-communication-trouble/m-p/206658#M8403</guid>
      <dc:creator>CAAG</dc:creator>
      <dc:date>2010-06-13T04:05:51Z</dc:date>
    </item>
    <item>
      <title>Re: Serial communication trouble</title>
      <link>https://community.nxp.com/t5/S12-MagniV-Microcontrollers/Serial-communication-trouble/m-p/206659#M8404</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello, and welcome to the forum.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;One possibility is that you may be stuck within the wait loop in the first line of the SENDDATA sub-routine, and then a COP timeout eventually occurs, to cause a reset.&amp;nbsp; In this case the sub-routine would not complete, and the RTS instruction would not be reached.&amp;nbsp; Temporarily comment out the wait loop, and see if the reset problem persists.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;If you are actually reaching the RTS instruction (and a single SCI character is sent),&amp;nbsp; perhaps the stack-based&amp;nbsp;return address of the sub-routine is somehow being corrupted.&amp;nbsp; If&amp;nbsp;execution of an ISR&amp;nbsp;were to occur whilst within the sub-routine, the ISR would be the likely source of the problem.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Mac&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 13 Jun 2010 12:04:48 GMT</pubDate>
      <guid>https://community.nxp.com/t5/S12-MagniV-Microcontrollers/Serial-communication-trouble/m-p/206659#M8404</guid>
      <dc:creator>bigmac</dc:creator>
      <dc:date>2010-06-13T12:04:48Z</dc:date>
    </item>
  </channel>
</rss>

