<?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 interrupt in assembly in S12 / MagniV Microcontrollers</title>
    <link>https://community.nxp.com/t5/S12-MagniV-Microcontrollers/SCI-interrupt-in-assembly/m-p/191502#M7490</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Coolcatt,&lt;/P&gt;&lt;P&gt;If your SCI transmission problems are not caused by a RX buffer overrun, then you could also check how exactly you match the target baud rate. I don't know the C328 hardware, but I've made the experience that some USB-RS232 adapters are very sensitive to deviations of the baud rate.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;If you would like to to see an example of an SCI ISR written in assembly,&amp;nbsp; have a look at this:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;A href="http://github.com/hotwolf/S12CBase" rel="nofollow" target="_blank" title="S12CBase project"&gt;http://github.com/hotwolf/S12CBase&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;It's a basic application framework for the S12C32/S12C128 that I just happend to post two days ago. It's all written in assembly and it has fully interrupt driven SCI RX/TX routines.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 14 Apr 2010 19:30:10 GMT</pubDate>
    <dc:creator>hotwolf</dc:creator>
    <dc:date>2010-04-14T19:30:10Z</dc:date>
    <item>
      <title>SCI interrupt in assembly</title>
      <link>https://community.nxp.com/t5/S12-MagniV-Microcontrollers/SCI-interrupt-in-assembly/m-p/191500#M7488</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hey guys,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I am trying to interface with a C328 UART camera, and I'm running into some problems.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have it hooked up and the first step is to send an SYNC message. &amp;nbsp;I do that fine and i start to receive the ACK message. &amp;nbsp;I got the first byte (0xAA), but then the next byte is supposed to be 0x0F or 0x0E, followed by 4 bytes of 0x00. &amp;nbsp;My problem is that after i receive the AA, i only get 3 of the other bytes and they are all 0x00. &amp;nbsp;Does this mean that it is overwriting the second byte before I obtain it? &amp;nbsp;I have tried it at 14,400 and 115,200 but get the same results.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Here are my thoughts: &amp;nbsp;I do not have interrupt routines, i just monitor the appropriate bit to see if the receive buffer has any information for me. &amp;nbsp;I receive the byte, then print it in hex to the HyperTerminal to verify the value. &amp;nbsp;Am i doing too much in between receiving this?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Should I set it up so that the interrupt routine will get the value and store it in a buffer until it gets the entire command then process it?&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I am programming it in assembly and i am also not familiar with how to do the interrupt service routines. &amp;nbsp;I have used the mc9s12c32 and can use those interrupt service routines, but I am not sure how to do it as far as initializing the routine because it seems to follow a different format/process.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Any comments would be greatly appreciate &lt;A href="http://freescale.i.lithium.com/i/smilies/16x16_smiley-happy.gif"&gt;&lt;IMG alt=":smileyhappy:" class="emoticon emoticon-smileyhappy" src="http://freescale.i.lithium.com/i/smilies/16x16_smiley-happy.gif" title="Smiley Happy" /&gt;&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 14 Apr 2010 01:41:26 GMT</pubDate>
      <guid>https://community.nxp.com/t5/S12-MagniV-Microcontrollers/SCI-interrupt-in-assembly/m-p/191500#M7488</guid>
      <dc:creator>coolcatt</dc:creator>
      <dc:date>2010-04-14T01:41:26Z</dc:date>
    </item>
    <item>
      <title>Re: SCI interrupt in assembly</title>
      <link>https://community.nxp.com/t5/S12-MagniV-Microcontrollers/SCI-interrupt-in-assembly/m-p/191501#M7489</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I suspect that you have a receive overrun condition.&amp;nbsp; On the receipt of each byte of a data packet, the processing of the data must be kept to absolute minimum.&amp;nbsp; Normally, each received byte would be written to a FIFO or "circular" buffer, with&amp;nbsp;very little other processing allowed.&amp;nbsp; This should be done within an ISR.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The duration of this process becomes far more important for higher baud rates.&amp;nbsp; In fact a baud rate of 115200 baud may prove to be too high, leaving a maximum period of less than 86 microseconds for handling each byte, especially if other interrupts should occur at a critical point (just prior to the SCI receive interrupt occurring).&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The contents of the buffer would usually be interrogated and processed from within the main loop code.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;In essence, the ISR code will be similar to other sub-routines, but its start address would be programmed at the appropriate location in the vector table, and it should finish with the RTI instruction.&amp;nbsp; Always ensure that the interrupt flag for the peripheral module is cleared before exiting the ISR.&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>Wed, 14 Apr 2010 14:45:20 GMT</pubDate>
      <guid>https://community.nxp.com/t5/S12-MagniV-Microcontrollers/SCI-interrupt-in-assembly/m-p/191501#M7489</guid>
      <dc:creator>bigmac</dc:creator>
      <dc:date>2010-04-14T14:45:20Z</dc:date>
    </item>
    <item>
      <title>Re: SCI interrupt in assembly</title>
      <link>https://community.nxp.com/t5/S12-MagniV-Microcontrollers/SCI-interrupt-in-assembly/m-p/191502#M7490</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Coolcatt,&lt;/P&gt;&lt;P&gt;If your SCI transmission problems are not caused by a RX buffer overrun, then you could also check how exactly you match the target baud rate. I don't know the C328 hardware, but I've made the experience that some USB-RS232 adapters are very sensitive to deviations of the baud rate.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;If you would like to to see an example of an SCI ISR written in assembly,&amp;nbsp; have a look at this:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;A href="http://github.com/hotwolf/S12CBase" rel="nofollow" target="_blank" title="S12CBase project"&gt;http://github.com/hotwolf/S12CBase&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;It's a basic application framework for the S12C32/S12C128 that I just happend to post two days ago. It's all written in assembly and it has fully interrupt driven SCI RX/TX routines.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 14 Apr 2010 19:30:10 GMT</pubDate>
      <guid>https://community.nxp.com/t5/S12-MagniV-Microcontrollers/SCI-interrupt-in-assembly/m-p/191502#M7490</guid>
      <dc:creator>hotwolf</dc:creator>
      <dc:date>2010-04-14T19:30:10Z</dc:date>
    </item>
  </channel>
</rss>

