<?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: Trouble sending a Char using the SCI module of MC9S08SH4MPJ with Device Initialization. in 8-bit Microcontrollers</title>
    <link>https://community.nxp.com/t5/8-bit-Microcontrollers/Trouble-sending-a-Char-using-the-SCI-module-of-MC9S08SH4MPJ-with/m-p/248759#M19798</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&lt;SPAN style="font-size: 16px; background-color: #ffffff;"&gt;Hi every one!&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 16px; background-color: #ffffff;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 16px; background-color: #ffffff;"&gt;Thank you so much for your answers, I'll do the test in the next days because I'm now a quite bussy, but I'll tell you how it works!&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 16px; background-color: #ffffff;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 16px; background-color: #ffffff;"&gt;Best Regards!&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 26 Feb 2013 13:09:52 GMT</pubDate>
    <dc:creator>elkin_granados</dc:creator>
    <dc:date>2013-02-26T13:09:52Z</dc:date>
    <item>
      <title>Trouble sending a Char using the SCI module of MC9S08SH4MPJ with Device Initialization.</title>
      <link>https://community.nxp.com/t5/8-bit-Microcontrollers/Trouble-sending-a-Char-using-the-SCI-module-of-MC9S08SH4MPJ-with/m-p/248755#M19794</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&lt;SPAN style="font-family: arial, helvetica, sans-serif; font-size: 12pt;"&gt;Hi every one!&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: arial, helvetica, sans-serif; font-size: 12pt;"&gt;A few days ago I bought a micro MC9S08SH4MPJ for making a application that reads an ADC channel value and send it to PC with the SCI module. I'm using Codewarriro 6.3, with device initialization. I set the microcontroller for working with the internal clock, I set the internal oscillator frequency in 32.7K and the internal bus clock in 16,74 Mhz. The SCI module is setting for basic use, 8 bit data, no parity, the baud rate divisor in 9 for a baud rate of 116626 bds/s.&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: arial, helvetica, sans-serif; font-size: 12pt;"&gt;In the main.c routine I have the following for making a test:&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier; font-size: 8pt;"&gt;#include &amp;lt;hidef.h&amp;gt; /* for EnableInterrupts macro */&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier; font-size: 8pt;"&gt;#include "derivative.h" /* include peripheral declarations */&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier; font-size: 8pt;"&gt;#ifdef __cplusplus&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier; font-size: 8pt;"&gt;extern "C"&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier; font-size: 8pt;"&gt;#endif&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 8pt; line-height: 1.5em; font-family: 'courier new', courier;"&gt;char var[]= "Hello world!";&amp;nbsp; //declaring a char array for test&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier; font-size: 8pt;"&gt;int i = 0;&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; //declaring an int for sending bucle&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier; font-size: 8pt;"&gt;void MCU_init(void); /* Device initialization function declaration */&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier; font-size: 8pt;"&gt;void main(void) {&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier; font-size: 8pt;"&gt;&amp;nbsp; MCU_init(); /* call Device Initialization */&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier; font-size: 8pt;"&gt;&amp;nbsp; /* include your code here */&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier; font-size: 8pt;"&gt;//bucle for sending each character of the array&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier; font-size: 8pt;"&gt;for(i=0;i&amp;lt;sizeof(var);i++) {&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier; font-size: 8pt;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier; font-size: 8pt;"&gt;&amp;nbsp;&amp;nbsp; sendCharSCI(var[i]);&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier; font-size: 8pt;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier; font-size: 8pt;"&gt;&amp;nbsp;&amp;nbsp; } &lt;/SPAN&gt;&lt;/P&gt;&lt;P style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier; font-size: 8pt;"&gt;&amp;nbsp; for(;;) {&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier; font-size: 8pt;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; /* __RESET_WATCHDOG(); by default, COP is disabled with device init. When enabling, also reset the watchdog. */&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier; font-size: 8pt;"&gt;&amp;nbsp; } /* loop forever */&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier; font-size: 8pt;"&gt;&amp;nbsp; /* please make sure that you never leave main */&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier; font-size: 8pt;"&gt;}&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier; font-size: 8pt;"&gt;//Funtion that sends character for SCI module&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier; font-size: 8pt;"&gt;void sendCharSCI(unsigned char data){&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier; font-size: 8pt;"&gt;&amp;nbsp; char read = 0;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; //variable for rear SCIS1 register&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier; font-size: 8pt;"&gt;&amp;nbsp; SCIC2_TE = 1;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; //enable SCI data transmition&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier; font-size: 8pt;"&gt;&amp;nbsp; read = SCIS1;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; //read SCIS1 register&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier; font-size: 8pt;"&gt;&amp;nbsp; SCID = data;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; //write the data for sending in SCID register&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier; font-size: 8pt;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; while (SCIS1_TDRE == 0){ }&amp;nbsp; //waiting buffer empty&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 8pt; line-height: 1.5em; font-family: 'courier new', courier;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier; font-size: 8pt;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; while (SCIS1_TC == 0){ }&amp;nbsp;&amp;nbsp;&amp;nbsp; // waiting transmition complete&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 8pt; line-height: 1.5em; font-family: 'courier new', courier;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier; font-size: 8pt;"&gt;&amp;nbsp; SCIC2_TE = 0;&amp;nbsp;&amp;nbsp;&amp;nbsp; //disable SCI data transmition&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier; font-size: 8pt;"&gt;}&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: arial, helvetica, sans-serif; font-size: 12pt;"&gt;I'm testing the program using and FT232 for simulate a COM PORT. When I check in the hyperteminal the PC is receiving data, but no the same chars of the array. I noted that the received char is the ASCII char + 96. for example, the 'H' is 72 in decimal, then I'm receiving the char 72+96 = 168 that is '&lt;SPAN style="color: #000000; text-align: justify; background-color: #ffffff;"&gt; ¨&lt;/SPAN&gt; '.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: arial, helvetica, sans-serif; font-size: 12pt;"&gt;I don't know if you need any more info, if it, please tell me.&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: arial, helvetica, sans-serif; font-size: 12pt;"&gt;I Have a micro coldfire V1 JM128VLD, and I tried to do the same test and works fine!&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: arial, helvetica, sans-serif; font-size: 12pt;"&gt;If anybody could help me with this I'll be really grateful!&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: arial, helvetica, sans-serif; font-size: 12pt;"&gt;Sorry for my english, Thank you so much and greetings from Colombia!&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 05 Feb 2013 16:44:43 GMT</pubDate>
      <guid>https://community.nxp.com/t5/8-bit-Microcontrollers/Trouble-sending-a-Char-using-the-SCI-module-of-MC9S08SH4MPJ-with/m-p/248755#M19794</guid>
      <dc:creator>elkin_granados</dc:creator>
      <dc:date>2013-02-05T16:44:43Z</dc:date>
    </item>
    <item>
      <title>Re: Trouble sending a Char using the SCI module of MC9S08SH4MPJ with Device Initialization.</title>
      <link>https://community.nxp.com/t5/8-bit-Microcontrollers/Trouble-sending-a-Char-using-the-SCI-module-of-MC9S08SH4MPJ-with/m-p/248756#M19795</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi could you show me what are doing in &lt;SPAN style="font-family: 'courier new', courier; font-size: 11px; background-color: #ffffff;"&gt;void MCU_init(void){???}&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 21 Feb 2013 03:18:36 GMT</pubDate>
      <guid>https://community.nxp.com/t5/8-bit-Microcontrollers/Trouble-sending-a-Char-using-the-SCI-module-of-MC9S08SH4MPJ-with/m-p/248756#M19795</guid>
      <dc:creator>admin</dc:creator>
      <dc:date>2013-02-21T03:18:36Z</dc:date>
    </item>
    <item>
      <title>Re: Trouble sending a Char using the SCI module of MC9S08SH4MPJ with Device Initialization.</title>
      <link>https://community.nxp.com/t5/8-bit-Microcontrollers/Trouble-sending-a-Char-using-the-SCI-module-of-MC9S08SH4MPJ-with/m-p/248757#M19796</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Elkin,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;You probably have a problem in the initialization.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have been using the following routines for years:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE __default_attr="c++" __jive_macro_name="code" class="_jivemacro_uid_13614639642171781 jive_text_macro jive_macro_code" jivemacro_uid="_13614639642171781" modifiedtitle="true"&gt;
&lt;P&gt;// SCI FUNCTIONS //////////////////////////////////////////////////////&lt;/P&gt;
&lt;P&gt;//---------------------------------------------------------------------&lt;/P&gt;
&lt;P&gt;void SCI_Init(void)&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; {SCIBD=14; SCIC1=0x00; SCIC2=0x0C; SCIS2=0x00; SCIC3=0x00;}&amp;nbsp;&amp;nbsp; // 8.388MHz/16/14=38,400 baud (actually 37,449)&lt;/P&gt;
&lt;P&gt;//---------------------------------------------------------------------&lt;/P&gt;
&lt;P&gt;void SCI_CharOut(byte data)&amp;nbsp; {while (!SCIS1_TDRE); SCID=data;}&lt;/P&gt;
&lt;P&gt;//---------------------------------------------------------------------&lt;/P&gt;
&lt;P&gt;void SCI_NibbOut(byte data)&amp;nbsp; {if (data&amp;gt;0x09) SCI_CharOut(data+0x37); else SCI_CharOut(data+0x30);}&lt;/P&gt;
&lt;P&gt;//---------------------------------------------------------------------&lt;/P&gt;
&lt;P&gt;void SCI_ByteOut(byte data)&amp;nbsp; {SCI_NibbOut(data&amp;gt;&amp;gt;4); SCI_NibbOut(data&amp;amp;0x0F);}&lt;/P&gt;
&lt;P&gt;//---------------------------------------------------------------------&lt;/P&gt;
&lt;P&gt;void SCI_TextOut(byte *data) {while (*data!=0x00) {SCI_CharOut(*data); data++;}}&lt;/P&gt;
&lt;P&gt;//---------------------------------------------------------------------&lt;/P&gt;
&lt;P&gt;byte SCI_CharIn(void)&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; {while (!SCIS1_RDRF); return SCID;}&lt;/P&gt;
&lt;P&gt;//---------------------------------------------------------------------&lt;/P&gt;
&lt;P&gt;byte SCI_ByteIn(void)&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; {byte h,l; h=SCI_CharIn()-48; if (h&amp;gt;9) h-=7; l=SCI_CharIn()-48; if (l&amp;gt;9) l-=7; return (h&amp;amp;15)*16+(l&amp;amp;15);}&lt;/P&gt;
&lt;P&gt;//---------------------------------------------------------------------&lt;/P&gt;
&lt;P&gt;void SCI_CRLF(void)&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; {SCI_CharOut(0x0D); SCI_CharOut(0x0A);}&lt;/P&gt;
&lt;SPAN class="mce_paste_marker"&gt;
&lt;/SPAN&gt;&lt;/PRE&gt;&lt;P&gt;Just use SCI_Init() and change the baudrate divisor: SCIBD=9; then use SCI_CharOut() to send your characters.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Rod.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 21 Feb 2013 16:30:19 GMT</pubDate>
      <guid>https://community.nxp.com/t5/8-bit-Microcontrollers/Trouble-sending-a-Char-using-the-SCI-module-of-MC9S08SH4MPJ-with/m-p/248757#M19796</guid>
      <dc:creator>RodBorras</dc:creator>
      <dc:date>2013-02-21T16:30:19Z</dc:date>
    </item>
    <item>
      <title>Re: Trouble sending a Char using the SCI module of MC9S08SH4MPJ with Device Initialization.</title>
      <link>https://community.nxp.com/t5/8-bit-Microcontrollers/Trouble-sending-a-Char-using-the-SCI-module-of-MC9S08SH4MPJ-with/m-p/248758#M19797</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Part of your code -&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;void sendCharSCI( byte data)&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;{&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;&amp;nbsp;&amp;nbsp; char read = 0;&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; // variable for rear SCIS1 register&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;&amp;nbsp;&amp;nbsp; SCIC2_TE = 1;&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; // enable SCI data transmition&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;&amp;nbsp;&amp;nbsp; read = SCIS1;&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; // read SCIS1 register&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;&amp;nbsp;&amp;nbsp; SCID = data;&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; // write the data for sending in SCID register&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;&amp;nbsp;&amp;nbsp; while (SCIS1_TDRE == 0){ }&amp;nbsp; // waiting buffer empty&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;&amp;nbsp;&amp;nbsp; while (SCIS1_TC == 0){ }&amp;nbsp;&amp;nbsp;&amp;nbsp; // waiting transmition complete&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;&amp;nbsp;&amp;nbsp; SCIC2_TE = 0;&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; // disable SCI data transmition&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;}&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;OL&gt;&lt;LI&gt;The control bit SCIC2_TE should be enabled within the SCI initialisation process, and remain enabled.&amp;nbsp; The SCI transmitter should not be enabled, and then disabled, for the sending of each character.&amp;nbsp; Every time the TE bit is set, an "idle" byte is sent to the buffer, with the result that one character period of idle state will be interspersed between each send character, thus halving the character throughput.&lt;/LI&gt;&lt;LI&gt;The SCIS1_TDRE flag should be checked &lt;SPAN style="text-decoration: underline;"&gt;prior&lt;/SPAN&gt; to the sending of each character.&amp;nbsp; No additional read of the SCIS1 register is necessary&lt;/LI&gt;&lt;LI&gt;You normally do not need to monitor the TC flag with full-duplex operation.&amp;nbsp; For a half-duplex operation, you would need to monitor when the final character of the data packet or data sequence had been sent.&amp;nbsp; Presumably you are using full-duplex.&lt;/LI&gt;&lt;/OL&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Taking these issues into account, should give the following code -&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;void sendCharSCI( byte data)&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;{&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;&amp;nbsp;&amp;nbsp; while (SCIS1_TDRE == 0); // wait for transmit buffer empty&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;&amp;nbsp;&amp;nbsp; SCID = data;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; // write character to buffer&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;}&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;Additionally, if you are using the internal reference within the ICS module (rather than an external crystal), the non-volatile trim value will need to be calibrated, and programmed to flash (normally when the code is programmed).&amp;nbsp; The trim value stored in flash is then transferred to the actual trim register during initialisation of the MCU.&amp;nbsp; If this is not correctly done, baud rate error will occur.&amp;nbsp; It is possible that an incorrect baud rate may account for the problems you are observing.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Mac&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 22 Feb 2013 15:58:42 GMT</pubDate>
      <guid>https://community.nxp.com/t5/8-bit-Microcontrollers/Trouble-sending-a-Char-using-the-SCI-module-of-MC9S08SH4MPJ-with/m-p/248758#M19797</guid>
      <dc:creator>bigmac</dc:creator>
      <dc:date>2013-02-22T15:58:42Z</dc:date>
    </item>
    <item>
      <title>Re: Trouble sending a Char using the SCI module of MC9S08SH4MPJ with Device Initialization.</title>
      <link>https://community.nxp.com/t5/8-bit-Microcontrollers/Trouble-sending-a-Char-using-the-SCI-module-of-MC9S08SH4MPJ-with/m-p/248759#M19798</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&lt;SPAN style="font-size: 16px; background-color: #ffffff;"&gt;Hi every one!&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 16px; background-color: #ffffff;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 16px; background-color: #ffffff;"&gt;Thank you so much for your answers, I'll do the test in the next days because I'm now a quite bussy, but I'll tell you how it works!&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 16px; background-color: #ffffff;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 16px; background-color: #ffffff;"&gt;Best Regards!&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 26 Feb 2013 13:09:52 GMT</pubDate>
      <guid>https://community.nxp.com/t5/8-bit-Microcontrollers/Trouble-sending-a-Char-using-the-SCI-module-of-MC9S08SH4MPJ-with/m-p/248759#M19798</guid>
      <dc:creator>elkin_granados</dc:creator>
      <dc:date>2013-02-26T13:09:52Z</dc:date>
    </item>
  </channel>
</rss>

