<?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>8-bit MicrocontrollersのトピックSoftware UART Code for MC9S08QD4</title>
    <link>https://community.nxp.com/t5/8-bit-Microcontrollers/Software-UART-Code-for-MC9S08QD4/m-p/355443#M21138</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi..&lt;/P&gt;&lt;P style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I am using MC9S08QD4, in this the UART protocol is not present, So i am looking for building software uart.&lt;/P&gt;&lt;P style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Is it possible?&lt;/P&gt;&lt;P style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;If possible any body having sample code for this and pls share it.&lt;/P&gt;&lt;P style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;P&gt;Venkatesh&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 04 Mar 2015 06:23:05 GMT</pubDate>
    <dc:creator>venkateshgv</dc:creator>
    <dc:date>2015-03-04T06:23:05Z</dc:date>
    <item>
      <title>Software UART Code for MC9S08QD4</title>
      <link>https://community.nxp.com/t5/8-bit-Microcontrollers/Software-UART-Code-for-MC9S08QD4/m-p/355443#M21138</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi..&lt;/P&gt;&lt;P style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I am using MC9S08QD4, in this the UART protocol is not present, So i am looking for building software uart.&lt;/P&gt;&lt;P style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Is it possible?&lt;/P&gt;&lt;P style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;If possible any body having sample code for this and pls share it.&lt;/P&gt;&lt;P style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;P&gt;Venkatesh&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 04 Mar 2015 06:23:05 GMT</pubDate>
      <guid>https://community.nxp.com/t5/8-bit-Microcontrollers/Software-UART-Code-for-MC9S08QD4/m-p/355443#M21138</guid>
      <dc:creator>venkateshgv</dc:creator>
      <dc:date>2015-03-04T06:23:05Z</dc:date>
    </item>
    <item>
      <title>Re: Software UART Code for MC9S08QD4</title>
      <link>https://community.nxp.com/t5/8-bit-Microcontrollers/Software-UART-Code-for-MC9S08QD4/m-p/355444#M21139</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Yes, it's possible to implement a 100% software UART (even having different baud rates for TX and RX, if you like).&amp;nbsp; What do you think people did before hardware UARTs were invented?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The whole concept is based on relatively accurate bit timing (there a small allowance of baud rate mismatch).&amp;nbsp; I have code for several versions of this (all in ASM8 assembly language) and if you can follow assembly I could provide some but I will have to clean it up a bit from some proprietary code before posting it.&amp;nbsp; So, let me know if assembly code is good for you and I'll try to get it ready in a few days.&amp;nbsp; &lt;STRONG&gt;(UPDATE: Code is now attached&lt;/STRONG&gt; &lt;EM&gt;-- you will need &lt;A href="http://aspisys.com/asm8.htm"&gt;ASM8&lt;/A&gt; to assemble.&lt;/EM&gt;&lt;STRONG&gt;)&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regardless, the idea is pretty much this:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;For RX:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;* You need a half-bit time delay, and a full bit time delay for the baud rate you need.&lt;/P&gt;&lt;P&gt;* You poll and wait for a start bit edge (a zero, normally -- unless your line is inverted).&lt;/P&gt;&lt;P&gt;* Once you get the start bit, you wait half bit to go to the center of the bit for sampling.&lt;/P&gt;&lt;P&gt;* Then you enter a loop starting with a full bit delay (this will bring you to the center of the first data bit).&lt;/P&gt;&lt;P&gt;* You read the RX line's state (you can even make multiple reads -- say, 3) to eliminate possible noise on the line.&amp;nbsp; You accept what the majority of the reads give you.&lt;/P&gt;&lt;P&gt;* You shift the bit into the most significant bit of your data byte (a rotate right in assembly)&lt;/P&gt;&lt;P&gt;* You repeat the loop for 8 bits and you're done.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;For TX:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;* You only need a full bit time delay routine.&lt;/P&gt;&lt;P&gt;* You do the start&amp;nbsp; bit (normally, a zero).&lt;/P&gt;&lt;P&gt;* You delay for a bit time.&lt;/P&gt;&lt;P&gt;* You shift out the next bit (rotate right).&lt;/P&gt;&lt;P&gt;* Depending on the shifted out bit being 0 or 1 you set the TX line accordinly.&lt;/P&gt;&lt;P&gt;* You repeat the loop for 9 bits (start plus 8 data) and you're done.&lt;/P&gt;&lt;P&gt;* Don't forget to leave the TX line high (and wait a bit time) for stop bit.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Hope this helps.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 04 Mar 2015 14:49:51 GMT</pubDate>
      <guid>https://community.nxp.com/t5/8-bit-Microcontrollers/Software-UART-Code-for-MC9S08QD4/m-p/355444#M21139</guid>
      <dc:creator>tonyp</dc:creator>
      <dc:date>2015-03-04T14:49:51Z</dc:date>
    </item>
    <item>
      <title>Re: Software UART Code for MC9S08QD4</title>
      <link>https://community.nxp.com/t5/8-bit-Microcontrollers/Software-UART-Code-for-MC9S08QD4/m-p/355445#M21140</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello..Tony..&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks for the idea.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Yes, i can able to understand the Assembly language &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;once u finish..pls share ..&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 05 Mar 2015 03:55:46 GMT</pubDate>
      <guid>https://community.nxp.com/t5/8-bit-Microcontrollers/Software-UART-Code-for-MC9S08QD4/m-p/355445#M21140</guid>
      <dc:creator>venkateshgv</dc:creator>
      <dc:date>2015-03-05T03:55:46Z</dc:date>
    </item>
    <item>
      <title>Re: Software UART Code for MC9S08QD4</title>
      <link>https://community.nxp.com/t5/8-bit-Microcontrollers/Software-UART-Code-for-MC9S08QD4/m-p/355446#M21141</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi&lt;/P&gt;&lt;P&gt;Also you can use as reference the application note &lt;A href="http://cache.freescale.com/files/microcontrollers/doc/app_note/AN2637.pdf"&gt;AN2637&lt;/A&gt;, this is for a HC08 device but it can help you.&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;Have a great day,&lt;BR /&gt;Vicente&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;-----------------------------------------------------------------------------------------------------------------------&lt;BR /&gt;Note: If this post answers your question, please click the Correct Answer button. Thank you!&lt;BR /&gt;-----------------------------------------------------------------------------------------------------------------------&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 13 Mar 2015 17:22:38 GMT</pubDate>
      <guid>https://community.nxp.com/t5/8-bit-Microcontrollers/Software-UART-Code-for-MC9S08QD4/m-p/355446#M21141</guid>
      <dc:creator>vicentegomez</dc:creator>
      <dc:date>2015-03-13T17:22:38Z</dc:date>
    </item>
  </channel>
</rss>

