<?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: 9s12dp256 serial com in S12 / MagniV Microcontrollers</title>
    <link>https://community.nxp.com/t5/S12-MagniV-Microcontrollers/9s12dp256-serial-com/m-p/134624#M2097</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;I can't offer much help, except to say that if the values between 252 and 255 exclude 253 (in other words, 252, 254 and 255 only), then it's could be indicative of too high a baud rate at the receiver.&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Sun, 29 Oct 2006 16:05:09 GMT</pubDate>
    <dc:creator>rocco</dc:creator>
    <dc:date>2006-10-29T16:05:09Z</dc:date>
    <item>
      <title>9s12dp256 serial com</title>
      <link>https://community.nxp.com/t5/S12-MagniV-Microcontrollers/9s12dp256-serial-com/m-p/134623#M2096</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Hi,&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;I wrote a code with ICC12 to receive serial com on SCI1 and display it&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;on the screen (prinf) using interrupt. all I'm getting is a range of&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;values between 252 and 255. why?&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;here is my code:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;#include&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;#include&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;void initialize(void);&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;void sci_isr (void);&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;unsigned int rxData;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;unsigned int i; /* the message received. */&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;#pragma interrupt_handler sci_isr&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;//Serial Com 1 Interrupt&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;void sci_isr (void){&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;if (SCI1SR1&amp;amp;0x20){ rxData = SCI1DRL; /* The receiver is full. Read a byte. */&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;printf(" %d \r", rxData);}&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;}&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;}&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;void initialize(){&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;i=0;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;SCI1BDL=156;SCI1BDH=0x00; //Set Boud rate to 38,400&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;SCI1CR1=0x00;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;SCI1CR2=0x24; //enable SCI reciever interrupt&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;*(void (**)())0x3fd4=sci_isr; //Serial Com. #1 interrupt&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;asm("cli");&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;}&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;void main (void){&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;initialize();&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;while(1){}&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;}&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 29 Oct 2006 13:39:59 GMT</pubDate>
      <guid>https://community.nxp.com/t5/S12-MagniV-Microcontrollers/9s12dp256-serial-com/m-p/134623#M2096</guid>
      <dc:creator>yklein</dc:creator>
      <dc:date>2006-10-29T13:39:59Z</dc:date>
    </item>
    <item>
      <title>Re: 9s12dp256 serial com</title>
      <link>https://community.nxp.com/t5/S12-MagniV-Microcontrollers/9s12dp256-serial-com/m-p/134624#M2097</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;I can't offer much help, except to say that if the values between 252 and 255 exclude 253 (in other words, 252, 254 and 255 only), then it's could be indicative of too high a baud rate at the receiver.&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 29 Oct 2006 16:05:09 GMT</pubDate>
      <guid>https://community.nxp.com/t5/S12-MagniV-Microcontrollers/9s12dp256-serial-com/m-p/134624#M2097</guid>
      <dc:creator>rocco</dc:creator>
      <dc:date>2006-10-29T16:05:09Z</dc:date>
    </item>
    <item>
      <title>Re: 9s12dp256 serial com</title>
      <link>https://community.nxp.com/t5/S12-MagniV-Microcontrollers/9s12dp256-serial-com/m-p/134625#M2098</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;You might add code to check whether you are getting framing errors.&amp;nbsp; This would also indicate a mismatch&amp;nbsp;between the receive and&amp;nbsp;the incoming baud rate.&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;&amp;nbsp;&lt;/DIV&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 30 Oct 2006 00:07:20 GMT</pubDate>
      <guid>https://community.nxp.com/t5/S12-MagniV-Microcontrollers/9s12dp256-serial-com/m-p/134625#M2098</guid>
      <dc:creator>bigmac</dc:creator>
      <dc:date>2006-10-30T00:07:20Z</dc:date>
    </item>
    <item>
      <title>Re: 9s12dp256 serial com</title>
      <link>https://community.nxp.com/t5/S12-MagniV-Microcontrollers/9s12dp256-serial-com/m-p/134626#M2099</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;Well, first make sure everything is 'set up' right.&lt;BR /&gt;&lt;BR /&gt;Transmit a known string out the serial tx port. In poll mode. If that works, then you know you probably have things 'set up' right, like baud rate and such.&lt;BR /&gt;&lt;BR /&gt;Then do a simple loop of poll the input and if it finds anything send it to the output. That will tell you if you have your rx configured right.&lt;BR /&gt;&lt;BR /&gt;THEN start working on a serial interrupt to buffer routine.&lt;BR /&gt;&lt;BR /&gt;Divide and conquer.&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 31 Oct 2006 02:34:21 GMT</pubDate>
      <guid>https://community.nxp.com/t5/S12-MagniV-Microcontrollers/9s12dp256-serial-com/m-p/134626#M2099</guid>
      <dc:creator>mke_et</dc:creator>
      <dc:date>2006-10-31T02:34:21Z</dc:date>
    </item>
    <item>
      <title>Re: 9s12dp256 serial com</title>
      <link>https://community.nxp.com/t5/S12-MagniV-Microcontrollers/9s12dp256-serial-com/m-p/134627#M2100</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;A further observation - it is not a good idea to call the print() function from within the ISR because it is a complex function, and its execution time may be unpredictable.&amp;nbsp; If it took longer than about 260 microseconds to execute, this could create a problem for your code.&amp;nbsp; Try reducing the baud rate from 38400, and see if the problem persists.&amp;nbsp;&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 more usual approach is to store the incoming bytes in a global buffer that can be read and displayed from within main().&amp;nbsp;&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;What serial port does the printf() function use - is there a conflict with your use of SCI1?&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>Tue, 31 Oct 2006 12:30:08 GMT</pubDate>
      <guid>https://community.nxp.com/t5/S12-MagniV-Microcontrollers/9s12dp256-serial-com/m-p/134627#M2100</guid>
      <dc:creator>bigmac</dc:creator>
      <dc:date>2006-10-31T12:30:08Z</dc:date>
    </item>
    <item>
      <title>Re: 9s12dp256 serial com</title>
      <link>https://community.nxp.com/t5/S12-MagniV-Microcontrollers/9s12dp256-serial-com/m-p/134628#M2101</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;thanks for the help. I found my problem I miss calculate the baud rate register value.&lt;BR /&gt;it's working now.&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 31 Oct 2006 15:22:10 GMT</pubDate>
      <guid>https://community.nxp.com/t5/S12-MagniV-Microcontrollers/9s12dp256-serial-com/m-p/134628#M2101</guid>
      <dc:creator>yklein</dc:creator>
      <dc:date>2006-10-31T15:22:10Z</dc:date>
    </item>
  </channel>
</rss>

