<?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: String transmission/Reception</title>
    <link>https://community.nxp.com/t5/S12-MagniV-Microcontrollers/String-transmission-Reception/m-p/217707#M9105</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Mmm. Certainly you need some&amp;nbsp;string buffer&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;#define buflen 20&lt;/P&gt;&lt;P&gt;char strbuf[buflen];&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;and string index variable, which is 0 before reception of string. On RX interrupt you read byte from data register, put it to&lt;/P&gt;&lt;P&gt;strbuf[index] and increment the index. Then you check if you received desired number of chars, also if index&amp;nbsp;is stil valid and is lower than buflen.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Above&amp;nbsp;simple approach would work if you had no noise, connect/disconnect issues&amp;nbsp;etc. For real life app your protocol may need to include handsheaking, start-of-message (re)synchronization, maybe some checksum. You may also need FIFO buffer to let your ISR routine accepting new messages, while you are analysing and processing commands received earlier...&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 29 Jun 2011 01:43:56 GMT</pubDate>
    <dc:creator>kef</dc:creator>
    <dc:date>2011-06-29T01:43:56Z</dc:date>
    <item>
      <title>String transmission/Reception</title>
      <link>https://community.nxp.com/t5/S12-MagniV-Microcontrollers/String-transmission-Reception/m-p/217706#M9104</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi friends,&lt;/P&gt;&lt;P&gt;&amp;nbsp; I am using 12Xs128 controller for one of my applications. Here,&lt;/P&gt;&lt;P&gt;&amp;nbsp;I should accept a string serially via RS232 , ultimately the string shall be (string of 8 characters) converted to hexadecimal format and transmitted onto some network. Also, the received string shall be transmitted onto the serial port. Since my string is of 8 characters (in decimal/hex) there will be 32 bits . How can I do this? Any help please...&lt;/P&gt;&lt;P&gt;Thanks in advance.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 27 Jun 2011 17:36:22 GMT</pubDate>
      <guid>https://community.nxp.com/t5/S12-MagniV-Microcontrollers/String-transmission-Reception/m-p/217706#M9104</guid>
      <dc:creator>vishaka_maithil</dc:creator>
      <dc:date>2011-06-27T17:36:22Z</dc:date>
    </item>
    <item>
      <title>Re: String transmission/Reception</title>
      <link>https://community.nxp.com/t5/S12-MagniV-Microcontrollers/String-transmission-Reception/m-p/217707#M9105</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Mmm. Certainly you need some&amp;nbsp;string buffer&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;#define buflen 20&lt;/P&gt;&lt;P&gt;char strbuf[buflen];&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;and string index variable, which is 0 before reception of string. On RX interrupt you read byte from data register, put it to&lt;/P&gt;&lt;P&gt;strbuf[index] and increment the index. Then you check if you received desired number of chars, also if index&amp;nbsp;is stil valid and is lower than buflen.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Above&amp;nbsp;simple approach would work if you had no noise, connect/disconnect issues&amp;nbsp;etc. For real life app your protocol may need to include handsheaking, start-of-message (re)synchronization, maybe some checksum. You may also need FIFO buffer to let your ISR routine accepting new messages, while you are analysing and processing commands received earlier...&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 29 Jun 2011 01:43:56 GMT</pubDate>
      <guid>https://community.nxp.com/t5/S12-MagniV-Microcontrollers/String-transmission-Reception/m-p/217707#M9105</guid>
      <dc:creator>kef</dc:creator>
      <dc:date>2011-06-29T01:43:56Z</dc:date>
    </item>
  </channel>
</rss>

