<?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 send decimal zero not working in S12 / MagniV Microcontrollers</title>
    <link>https://community.nxp.com/t5/S12-MagniV-Microcontrollers/SCI-send-decimal-zero-not-working/m-p/636207#M13552</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Daniel,&lt;/P&gt;&lt;P&gt;Thank you for your support.&lt;BR /&gt; I want to send sensor value for 4 digits and my requirement is only two bytes.&lt;BR /&gt;how to transmit in SCI?&lt;/P&gt;&lt;P&gt;Ex: I send sensor value 3245&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Transmit side:&lt;/STRONG&gt; &lt;BR /&gt;int16 sensor_val&amp;nbsp;= 3245&lt;BR /&gt;char buffer[2];&lt;BR /&gt;buffer[0]=&lt;SPAN&gt;sensor_val&lt;/SPAN&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;/256&lt;BR /&gt;buffer[1]=&lt;SPAN&gt;sensor_val&lt;/SPAN&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;%256&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;if i send &lt;SPAN&gt;sensor_val&lt;/SPAN&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;= 280&lt;BR /&gt;buffer[0]=1&lt;BR /&gt;buffer[1]=24&lt;/P&gt;&lt;P&gt;if i send &lt;SPAN&gt;sensor_val&lt;/SPAN&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;=240&lt;BR /&gt;buffer[0]=0&lt;BR /&gt;buffer[1]=240&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Receiver side :&lt;/STRONG&gt;&lt;BR /&gt;int8 getdata,getdata1;&lt;BR /&gt;int16 sensorout;&lt;/P&gt;&lt;P&gt;getdata = buffer[0];&lt;BR /&gt;getdata1 = buffer[1];&lt;/P&gt;&lt;P&gt;sensorout = (getdata *256+getdata1 )&lt;BR /&gt;sensorout = 3245&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;P&gt;Devaraj&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 24 Jan 2017 10:42:01 GMT</pubDate>
    <dc:creator>devarajraj</dc:creator>
    <dc:date>2017-01-24T10:42:01Z</dc:date>
    <item>
      <title>SCI send decimal zero not working</title>
      <link>https://community.nxp.com/t5/S12-MagniV-Microcontrollers/SCI-send-decimal-zero-not-working/m-p/636203#M13548</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&lt;SPAN style="font-size: 8.0pt;"&gt;I am trying to work with SCI on the uC MC9S12XHY256 and seem to set right baud rate of 9600 and I think my initialization is correct. If i send char &lt;/SPAN&gt;&lt;SPAN style="font-size: 7.5pt; color: #222222;"&gt;‘A’, 'B' and decimal value 1 is working.&lt;/SPAN&gt;&lt;SPAN style="font-size: 8.0pt;"&gt; &lt;STRONG&gt;I send decimal zero or null char is not working&lt;/STRONG&gt;. &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 7.5pt; background: white;"&gt;Does anyone have an idea?&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 23 Jan 2017 04:14:32 GMT</pubDate>
      <guid>https://community.nxp.com/t5/S12-MagniV-Microcontrollers/SCI-send-decimal-zero-not-working/m-p/636203#M13548</guid>
      <dc:creator>devarajraj</dc:creator>
      <dc:date>2017-01-23T04:14:32Z</dc:date>
    </item>
    <item>
      <title>Re: SCI send decimal zero not working</title>
      <link>https://community.nxp.com/t5/S12-MagniV-Microcontrollers/SCI-send-decimal-zero-not-working/m-p/636204#M13549</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Could you provide us the code?&lt;/P&gt;&lt;P&gt;Note: In case a resource(s) cannot be publicly shared on Community, use the following &lt;A _jive_internal="true" href="https://community.nxp.com/docs/DOC-329745"&gt;procedure.&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Daniel&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 23 Jan 2017 10:08:08 GMT</pubDate>
      <guid>https://community.nxp.com/t5/S12-MagniV-Microcontrollers/SCI-send-decimal-zero-not-working/m-p/636204#M13549</guid>
      <dc:creator>martynek</dc:creator>
      <dc:date>2017-01-23T10:08:08Z</dc:date>
    </item>
    <item>
      <title>Re: SCI send decimal zero not working</title>
      <link>https://community.nxp.com/t5/S12-MagniV-Microcontrollers/SCI-send-decimal-zero-not-working/m-p/636205#M13550</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;The attached code is what i am using to try to send data out the SCI port.The problem that no response for decimal zero on the output window(hyper terminal). &lt;STRONG&gt;code:&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;void SCI_Config(uint16 prescaler)&lt;BR /&gt;{ &lt;BR /&gt; SCI1BDH = (uint8)((prescaler&amp;gt;&amp;gt;8)); &lt;BR /&gt; SCI1BDL = (uint8)(prescaler);&lt;BR /&gt; SCI1CR1 = 0x00; &lt;BR /&gt; SCI1CR2 = 0x2C; &lt;BR /&gt;}&lt;/P&gt;&lt;P&gt;void PutChar1(uint8 ch) &lt;BR /&gt;{&lt;BR /&gt; while(!SCI1SR1_TDRE) {}; &lt;BR /&gt; SCI1DRL = ch; &lt;BR /&gt;}&lt;/P&gt;&lt;P&gt;void main(void) &lt;BR /&gt;{&lt;BR /&gt; Clock_Init(); &lt;BR /&gt; SCI_Config(156); &lt;BR /&gt; EnableInterrupts;&lt;BR /&gt; arr[0] ='A'; &lt;BR /&gt; arr[1] = 0;&lt;BR /&gt; arr[2] = 'B';&lt;BR /&gt; PutChar1(arr[0]);&lt;BR /&gt; PutChar1(arr[1]);&lt;BR /&gt; PutChar1(arr[2]);&lt;BR /&gt; for(;;) &lt;BR /&gt; { &lt;BR /&gt;}&lt;BR /&gt;}&lt;/P&gt;&lt;P&gt;EXample:&lt;BR /&gt;&lt;STRONG&gt;Input&lt;/STRONG&gt; &lt;BR /&gt; arr[0] ='A'; &lt;BR /&gt; arr[1] = 0;&lt;BR /&gt; arr[2] = 'B';&lt;BR /&gt;&lt;STRONG&gt;output&lt;/STRONG&gt;&lt;BR /&gt;A B&lt;/P&gt;&lt;P&gt;Thank you,&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Devaraj&amp;nbsp;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 24 Jan 2017 05:53:28 GMT</pubDate>
      <guid>https://community.nxp.com/t5/S12-MagniV-Microcontrollers/SCI-send-decimal-zero-not-working/m-p/636205#M13550</guid>
      <dc:creator>devarajraj</dc:creator>
      <dc:date>2017-01-24T05:53:28Z</dc:date>
    </item>
    <item>
      <title>Re: SCI send decimal zero not working</title>
      <link>https://community.nxp.com/t5/S12-MagniV-Microcontrollers/SCI-send-decimal-zero-not-working/m-p/636206#M13551</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If you want to send decimal 0, send 0x30 (ASCII).&lt;/P&gt;&lt;P&gt;arr[1] = 0x30;&lt;/P&gt;&lt;P&gt;PutChar1(arr[1]);&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Daniel&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 24 Jan 2017 09:17:44 GMT</pubDate>
      <guid>https://community.nxp.com/t5/S12-MagniV-Microcontrollers/SCI-send-decimal-zero-not-working/m-p/636206#M13551</guid>
      <dc:creator>martynek</dc:creator>
      <dc:date>2017-01-24T09:17:44Z</dc:date>
    </item>
    <item>
      <title>Re: SCI send decimal zero not working</title>
      <link>https://community.nxp.com/t5/S12-MagniV-Microcontrollers/SCI-send-decimal-zero-not-working/m-p/636207#M13552</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Daniel,&lt;/P&gt;&lt;P&gt;Thank you for your support.&lt;BR /&gt; I want to send sensor value for 4 digits and my requirement is only two bytes.&lt;BR /&gt;how to transmit in SCI?&lt;/P&gt;&lt;P&gt;Ex: I send sensor value 3245&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Transmit side:&lt;/STRONG&gt; &lt;BR /&gt;int16 sensor_val&amp;nbsp;= 3245&lt;BR /&gt;char buffer[2];&lt;BR /&gt;buffer[0]=&lt;SPAN&gt;sensor_val&lt;/SPAN&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;/256&lt;BR /&gt;buffer[1]=&lt;SPAN&gt;sensor_val&lt;/SPAN&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;%256&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;if i send &lt;SPAN&gt;sensor_val&lt;/SPAN&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;= 280&lt;BR /&gt;buffer[0]=1&lt;BR /&gt;buffer[1]=24&lt;/P&gt;&lt;P&gt;if i send &lt;SPAN&gt;sensor_val&lt;/SPAN&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;=240&lt;BR /&gt;buffer[0]=0&lt;BR /&gt;buffer[1]=240&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Receiver side :&lt;/STRONG&gt;&lt;BR /&gt;int8 getdata,getdata1;&lt;BR /&gt;int16 sensorout;&lt;/P&gt;&lt;P&gt;getdata = buffer[0];&lt;BR /&gt;getdata1 = buffer[1];&lt;/P&gt;&lt;P&gt;sensorout = (getdata *256+getdata1 )&lt;BR /&gt;sensorout = 3245&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;P&gt;Devaraj&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 24 Jan 2017 10:42:01 GMT</pubDate>
      <guid>https://community.nxp.com/t5/S12-MagniV-Microcontrollers/SCI-send-decimal-zero-not-working/m-p/636207#M13552</guid>
      <dc:creator>devarajraj</dc:creator>
      <dc:date>2017-01-24T10:42:01Z</dc:date>
    </item>
    <item>
      <title>Re: SCI send decimal zero not working</title>
      <link>https://community.nxp.com/t5/S12-MagniV-Microcontrollers/SCI-send-decimal-zero-not-working/m-p/636208#M13553</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Use bit shift:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;uint16_t &amp;nbsp;sensor_val&amp;nbsp;= 3245;&lt;/P&gt;&lt;P&gt;uint8_t sensor_val_low, sensor_val_high;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;sensor_val_low &amp;nbsp;= (sensor_val &amp;amp; 0xFF);&lt;BR /&gt; sensor_val_high = (sensor_val &amp;gt;&amp;gt; 8);&lt;/P&gt;&lt;P&gt;buffer[0]= sensor_val_low; &amp;nbsp;&lt;BR /&gt; buffer[1]= sensor_val_high;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;And the other way round on the other site.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;uint16_t sensorout;&lt;/P&gt;&lt;P&gt;uint8_t getdata_low, getdata_high;&lt;/P&gt;&lt;P&gt;getdata_low = buffer[0];&lt;/P&gt;&lt;P&gt;getdate_high = buffer[1];&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;sensorout = (getdata_high &amp;lt;&amp;lt; 8);&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;sensorout |= getdata_low; &lt;SPAN style="font-size: 10.0pt;"&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;&lt;/P&gt;&lt;P&gt;Regards &lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Daniel&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;&lt;SPAN style="font-size: 9.5pt;"&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 24 Jan 2017 17:56:58 GMT</pubDate>
      <guid>https://community.nxp.com/t5/S12-MagniV-Microcontrollers/SCI-send-decimal-zero-not-working/m-p/636208#M13553</guid>
      <dc:creator>danielmartynek</dc:creator>
      <dc:date>2017-01-24T17:56:58Z</dc:date>
    </item>
  </channel>
</rss>

