<?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: SCI interrupts on CSM12C32 module</title>
    <link>https://community.nxp.com/t5/S12-MagniV-Microcontrollers/SCI-interrupts-on-CSM12C32-module/m-p/189426#M7296</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;i checked the manual for HCS12 serial monitor program and pasting some info from it to here:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#ff0000"&gt;&lt;FONT size="2"&gt;&lt;FONT face="helvetica"&gt;For the serial port function of the monitor to work, the SCI0 serial interface is&lt;BR /&gt;used. The monitor must have exclusive use of this interface. User application&lt;BR /&gt;code should not implement communications on this serial channel.&lt;BR /&gt;This monitor accommodates RS-232 serial communications through SCI0 at&lt;BR /&gt;115.2 kbaud. For systems requiring the use of SCI0, use a BDM development&lt;BR /&gt;system that allows more sophisticated debugging. Alternatively, this monitor&lt;BR /&gt;program may be modified by the user to check the state of the switches used&lt;BR /&gt;to enter the monitor and adjust vector relocation accordingly. This modification&lt;BR /&gt;would enable the user to use the monitor SCI port, although debugging of SCI0&lt;BR /&gt;routines would be very difficult or impossible using the monitor.&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Is my problem related to this? if so, what can i do now?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Fri, 09 Apr 2010 15:44:05 GMT</pubDate>
    <dc:creator>ersinozkan</dc:creator>
    <dc:date>2010-04-09T15:44:05Z</dc:date>
    <item>
      <title>SCI interrupts on CSM12C32 module</title>
      <link>https://community.nxp.com/t5/S12-MagniV-Microcontrollers/SCI-interrupts-on-CSM12C32-module/m-p/189424#M7294</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 am trying to read data from sci by handling &amp;nbsp;RDRF interrupt. i had some trouble with it and then i found sample source codes from Internet. also i tried the sample project which is in code-warrior examples.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;1) Codewarrior provides an example project for mc9s12c32. &amp;nbsp;it uses vector table in isr_vectors.c&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;typedef void (*near tIsrFunc)(void);&lt;BR /&gt;const tIsrFunc _vect[] @0xFF80 = {&lt;BR /&gt;.....&lt;/P&gt;&lt;P&gt;}&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;i tried same way in my project but i couldn't handle any sci interrupts.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;2) i checked code-warrior help. it gives two way to use interrupts.&lt;/P&gt;&lt;P&gt;define&lt;/P&gt;&lt;P&gt;VECTOR ADDRESS 0x8A INCcount&lt;/P&gt;&lt;P&gt;or&lt;/P&gt;&lt;P&gt;VECTOR 69 INCcount&lt;/P&gt;&lt;P&gt;in prm file then use&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;interrupt void INCcount() ..&lt;/P&gt;&lt;P&gt;or&lt;/P&gt;&lt;P&gt;#pragma TRAP_PROC&lt;/P&gt;&lt;P&gt;void INCCount() &amp;nbsp;..&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;or directly use&lt;/P&gt;&lt;P&gt;interrupt 69 void INCcount(void) ...&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;when i try defining vectors in prm file, something strange is happening. when i send a byte to mcu i get back '0xE0 &amp;nbsp;0xF2 &amp;nbsp;0x3E' &amp;nbsp;messages in endless loop.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;3) i have found a source code from my school. they are using it on the same module i have.&lt;/P&gt;&lt;P&gt;i checked the code and they are handling IRQ interrupt not SCI. IRQ is vector 6 and SCI is vector 20. i didn't have time to ask about this. i read all data-sheets again and again but no answer.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;also there is &amp;nbsp;a weird thing about their code. they use vector table for interrupt definitions. what that code do is transmitting the received byte back by appending it to a message "you send a byte ...".&lt;/P&gt;&lt;P&gt;for the first byte i send, mcu handles interrupt but always sends back &amp;nbsp;'a', smiley face and '&amp;gt;'.&lt;/P&gt;&lt;P&gt;sometimes after i send a new byte, it sends back previous byte.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;also i edited that code a bit. i am turning led1 on and off each almost each second. until i send a byte to mcu led blinks very well. but after the first byte i send blinking stops and never starts again.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;and i am changing the state of led2 in interrupt function. it must be turn off after nth interrupt and turn on n+1th interrupt. but what happens is in turns off and &amp;nbsp;on (very fast blinking) in one interrupt.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;i hope I'm missing a simple point.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;waiting for all ideas and working source codes if possible.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;have a nice day&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 07 Apr 2010 14:56:25 GMT</pubDate>
      <guid>https://community.nxp.com/t5/S12-MagniV-Microcontrollers/SCI-interrupts-on-CSM12C32-module/m-p/189424#M7294</guid>
      <dc:creator>ersinozkan</dc:creator>
      <dc:date>2010-04-07T14:56:25Z</dc:date>
    </item>
    <item>
      <title>Re: SCI interrupts on CSM12C32 module</title>
      <link>https://community.nxp.com/t5/S12-MagniV-Microcontrollers/SCI-interrupts-on-CSM12C32-module/m-p/189425#M7295</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;here is one of my source code&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;#include &amp;lt;hidef.h&amp;gt;      /* common defines and macros */
#include &amp;lt;mc9s12c32.h&amp;gt;     /* derivative information */
#pragma LINK_INFO DERIVATIVE "mc9s12c32"

byte interrupt_counter = 0;
int x,y;
byte dummy;
   
#pragma TRAP_PROC
void SCI_ISR(void) {
    if( (SCISR1 &amp;amp; 0b00000111) ){
        dummy = SCIDRL;
        return;   
    }
   
    if( (SCISR1 &amp;amp; 0b00101000) ){
        dummy = SCIDRL;
        interrupt_counter++;
        while (!(SCISR1 &amp;amp; 0x80));  // wait for output buffer empty
        SCIDRL = interrupt_counter + '0' ;
    } 
   
    if((interrupt_counter % 2) == 0)
        PORTA = 0x01;         
    else
        PORTA = 0x00;
   
    x=0;
    y=0;
}                               

/*
interrupt 6 void SCI_ISR(void) {
    byte dummy;
    if( (SCISR1 &amp;amp; 0b00000111) ){
        dummy = SCIDRL;
        return;   
    }
   
    if( (SCISR1 &amp;amp; 0b00101000) ){
        dummy = SCIDRL;
        interrupt_counter++;
        while (!(SCISR1 &amp;amp; 0x80));  // wait for output buffer empty
        SCIDRL = interrupt_counter + '0' ;
    } 
   
    if((interrupt_counter % 2) == 0)
        PORTA = 0x01;         
    else
        PORTA = 0x00;
}                               
*/

#pragma CODE_SEG DEFAULT        
void main(void) {
  /* put your own code here */

  EnableInterrupts;

  DDRA = 0x01;
 
  SCIBDH = 0x00;
  SCIBDL = (unsigned char)((16000000UL /* OSC freq */ / 2) / 9600 /* baud rate */ / 16 /*factor*/);
  SCICR1 = 0x00;
  SCICR2 = 0x2C;

  for(;;) {
      for(x=0;x&amp;lt;100;x++){
          for(y=0;y&amp;lt;10000;y++){
          }
      }
     
      while (!(SCISR1 &amp;amp; 0x80));  /* wait for output buffer empty */
      SCIDRL = 'x';
     
  } /* wait forever */
  /* please make sure that you never leave this function */
}
&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;i also have&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;VECTOR 6 SCI_ISR&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;line in prm file. 6 is for IRQ. it has to be 20 for SCI interrupts but it doesnt work.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;as you see, i send 'x' chars in main loop. but after interrupt subroutine, it stops.&lt;/P&gt;&lt;P&gt;anything i am missing ?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;also, adding full project in zip format.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&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>Thu, 29 Oct 2020 09:40:47 GMT</pubDate>
      <guid>https://community.nxp.com/t5/S12-MagniV-Microcontrollers/SCI-interrupts-on-CSM12C32-module/m-p/189425#M7295</guid>
      <dc:creator>ersinozkan</dc:creator>
      <dc:date>2020-10-29T09:40:47Z</dc:date>
    </item>
    <item>
      <title>Re: SCI interrupts on CSM12C32 module</title>
      <link>https://community.nxp.com/t5/S12-MagniV-Microcontrollers/SCI-interrupts-on-CSM12C32-module/m-p/189426#M7296</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;i checked the manual for HCS12 serial monitor program and pasting some info from it to here:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#ff0000"&gt;&lt;FONT size="2"&gt;&lt;FONT face="helvetica"&gt;For the serial port function of the monitor to work, the SCI0 serial interface is&lt;BR /&gt;used. The monitor must have exclusive use of this interface. User application&lt;BR /&gt;code should not implement communications on this serial channel.&lt;BR /&gt;This monitor accommodates RS-232 serial communications through SCI0 at&lt;BR /&gt;115.2 kbaud. For systems requiring the use of SCI0, use a BDM development&lt;BR /&gt;system that allows more sophisticated debugging. Alternatively, this monitor&lt;BR /&gt;program may be modified by the user to check the state of the switches used&lt;BR /&gt;to enter the monitor and adjust vector relocation accordingly. This modification&lt;BR /&gt;would enable the user to use the monitor SCI port, although debugging of SCI0&lt;BR /&gt;routines would be very difficult or impossible using the monitor.&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Is my problem related to this? if so, what can i do now?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 09 Apr 2010 15:44:05 GMT</pubDate>
      <guid>https://community.nxp.com/t5/S12-MagniV-Microcontrollers/SCI-interrupts-on-CSM12C32-module/m-p/189426#M7296</guid>
      <dc:creator>ersinozkan</dc:creator>
      <dc:date>2010-04-09T15:44:05Z</dc:date>
    </item>
    <item>
      <title>Re: SCI interrupts on CSM12C32 module</title>
      <link>https://community.nxp.com/t5/S12-MagniV-Microcontrollers/SCI-interrupts-on-CSM12C32-module/m-p/189427#M7297</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I have exactly the same error, i have been searching and trying codes from internet, but the error is the same. what is wrong?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 17 Nov 2010 07:15:34 GMT</pubDate>
      <guid>https://community.nxp.com/t5/S12-MagniV-Microcontrollers/SCI-interrupts-on-CSM12C32-module/m-p/189427#M7297</guid>
      <dc:creator>Covenant</dc:creator>
      <dc:date>2010-11-17T07:15:34Z</dc:date>
    </item>
    <item>
      <title>Re: SCI interrupts on CSM12C32 module</title>
      <link>https://community.nxp.com/t5/S12-MagniV-Microcontrollers/SCI-interrupts-on-CSM12C32-module/m-p/189428#M7298</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I would strongly recommend using this code for vector table declarations:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;A href="https://community.freescale.com/message/59586#59586" title="https://community.freescale.com/message/59586#59586"&gt;https://community.freescale.com/message/59586#59586&lt;/A&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 17 Nov 2010 20:27:11 GMT</pubDate>
      <guid>https://community.nxp.com/t5/S12-MagniV-Microcontrollers/SCI-interrupts-on-CSM12C32-module/m-p/189428#M7298</guid>
      <dc:creator>Lundin</dc:creator>
      <dc:date>2010-11-17T20:27:11Z</dc:date>
    </item>
  </channel>
</rss>

