<?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中的主题 Re: SCI port initialisation</title>
    <link>https://community.nxp.com/t5/8-bit-Microcontrollers/SCI-port-initialisation/m-p/135617#M4101</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;DIV&gt;Hi miSta,&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;Even though I was the one that pointed you at this code, I had never really looked into it much.&lt;/DIV&gt;&lt;DIV&gt;It does turn the TXENA and RXENA on and off all the time. I don't know why they are doing this. The more normal case is just to enable both along with the rest of the SCI initialisation (baudrate etc) and just leave them on.&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Mon, 04 Jun 2007 06:02:08 GMT</pubDate>
    <dc:creator>peg</dc:creator>
    <dc:date>2007-06-04T06:02:08Z</dc:date>
    <item>
      <title>SCI port initialisation</title>
      <link>https://community.nxp.com/t5/8-bit-Microcontrollers/SCI-port-initialisation/m-p/135616#M4100</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN style="font-family: Arial;"&gt;I am wondering .. i'm looking at the demo9s08app.c and it seems that every time a character is sent , it opens the port&lt;BR /&gt;send : SCIC2 =0x08;&lt;BR /&gt;receive: SCIC2 =0x04;&lt;BR /&gt;&lt;BR /&gt;but when i initialised the port in my own code , at the start , i will get an initial word .. ( eg. Hello ) followed by funny characters ...&lt;BR /&gt;&lt;BR /&gt;i talked to some pple , and they said that i have to calibrate the chip with ICSTRIM using an oscillator ...&lt;BR /&gt;a thread has mentioned this as well .. (internal ref clock accurate ... thread)&lt;BR /&gt;&lt;BR /&gt;what is the difference between the demo app file usage and the intention of opening the port from the beginning ?&lt;BR /&gt;&lt;BR /&gt;*just wondering*&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;DIV&gt; &lt;/DIV&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 04 Jun 2007 02:27:30 GMT</pubDate>
      <guid>https://community.nxp.com/t5/8-bit-Microcontrollers/SCI-port-initialisation/m-p/135616#M4100</guid>
      <dc:creator>miSta</dc:creator>
      <dc:date>2007-06-04T02:27:30Z</dc:date>
    </item>
    <item>
      <title>Re: SCI port initialisation</title>
      <link>https://community.nxp.com/t5/8-bit-Microcontrollers/SCI-port-initialisation/m-p/135617#M4101</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;DIV&gt;Hi miSta,&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;Even though I was the one that pointed you at this code, I had never really looked into it much.&lt;/DIV&gt;&lt;DIV&gt;It does turn the TXENA and RXENA on and off all the time. I don't know why they are doing this. The more normal case is just to enable both along with the rest of the SCI initialisation (baudrate etc) and just leave them on.&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 04 Jun 2007 06:02:08 GMT</pubDate>
      <guid>https://community.nxp.com/t5/8-bit-Microcontrollers/SCI-port-initialisation/m-p/135617#M4101</guid>
      <dc:creator>peg</dc:creator>
      <dc:date>2007-06-04T06:02:08Z</dc:date>
    </item>
    <item>
      <title>Re: SCI port initialisation</title>
      <link>https://community.nxp.com/t5/8-bit-Microcontrollers/SCI-port-initialisation/m-p/135618#M4102</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;Setting transmit enable prior to sending each character, and then disabling, will have another side effect.&amp;nbsp; Whenever the TE bit is set active, an "idle" character will be queued.&amp;nbsp; With continuous enabling and disabling, this&amp;nbsp;would give a one character space between each group of send characters.&amp;nbsp; For many applications, this delay would be unnecessary and undesireable unless the remote end were to need a small "end of line" delay.&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 only other&amp;nbsp;reason I can think of is, if the code were "lifted" from an application that had Tx and Rx lines common (paralleled).&amp;nbsp; Of course, for the 'QG8, this mode of operation may be directly configured.&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;DIV&gt;&lt;FONT size="2"&gt;&lt;/FONT&gt;&amp;nbsp;&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>Mon, 04 Jun 2007 10:03:21 GMT</pubDate>
      <guid>https://community.nxp.com/t5/8-bit-Microcontrollers/SCI-port-initialisation/m-p/135618#M4102</guid>
      <dc:creator>bigmac</dc:creator>
      <dc:date>2007-06-04T10:03:21Z</dc:date>
    </item>
    <item>
      <title>Re: SCI port initialisation</title>
      <link>https://community.nxp.com/t5/8-bit-Microcontrollers/SCI-port-initialisation/m-p/135619#M4103</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;Yeah .. that's the normal case to keep the ports open ..that's what i am doing&lt;BR /&gt;but as i mentioned earlier .. by keeping it opened, i get a funny character like looping2 ...&lt;BR /&gt;&lt;BR /&gt;but as mac mentioned , the on and off of the ports gives out a character space, so in other words , to emulate it , i would have to code a stop bit , if i were to leave the ports on at the start of init. ? (with baud rate ec ?)&lt;BR /&gt;&lt;BR /&gt;&lt;DIV&gt;&lt;/DIV&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 04 Jun 2007 11:48:08 GMT</pubDate>
      <guid>https://community.nxp.com/t5/8-bit-Microcontrollers/SCI-port-initialisation/m-p/135619#M4103</guid>
      <dc:creator>miSta</dc:creator>
      <dc:date>2007-06-04T11:48:08Z</dc:date>
    </item>
    <item>
      <title>Re: SCI port initialisation</title>
      <link>https://community.nxp.com/t5/8-bit-Microcontrollers/SCI-port-initialisation/m-p/135620#M4104</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;DIV&gt;&lt;/DIV&gt;&lt;DIV&gt;Hi,&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;I have no direct experience with this, but as I understand it, no idle char would be queued.&lt;/DIV&gt;&lt;DIV&gt;In order to do this you must TE=0 while the shifter is still busy. The code presented does not do TE=0 until TC.&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;BR /&gt;&lt;BR /&gt;Message Edited by peg on &lt;SPAN class="date_text"&gt;2007-06-04&lt;/SPAN&gt; &lt;SPAN class="time_text"&gt;03:18 PM&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 04 Jun 2007 12:14:33 GMT</pubDate>
      <guid>https://community.nxp.com/t5/8-bit-Microcontrollers/SCI-port-initialisation/m-p/135620#M4104</guid>
      <dc:creator>peg</dc:creator>
      <dc:date>2007-06-04T12:14:33Z</dc:date>
    </item>
    <item>
      <title>Re: SCI port initialisation</title>
      <link>https://community.nxp.com/t5/8-bit-Microcontrollers/SCI-port-initialisation/m-p/135621#M4105</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;DIV&gt;&lt;/DIV&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;How are you monitoring the characters sent by the SCI?&amp;nbsp; The "funny characters" may be a representation of control characters that might be unknowingly sent.&amp;nbsp; If you are terminating your string with a null character,&amp;nbsp;is it possible&amp;nbsp;this&amp;nbsp;is being&amp;nbsp;sent?&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 actual representation of control characters may depend on the terminal program in use, assuming this is what you are using.&amp;nbsp; The idle "character" will be seen as a delay, and should not generate any displayed character.&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;Peg,&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 following is an exerpt from the 'QG8 data sheet -&lt;/FONT&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;FONT size="2"&gt;&lt;FONT face="Times-Roman"&gt;&lt;EM&gt;The transmitter is enabled by setting the TE bit in SCIC2. This queues a preamble character that is one full character frame of the idle state. The transmitter then remains idle until data is available in the transmit data buffer.&lt;/EM&gt;&lt;/FONT&gt;&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;Another excerpt from the same section -&lt;/FONT&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;FONT size="2"&gt;&lt;FONT face="Times-Roman"&gt;&lt;EM&gt;Writing 0 to TE does not immediately release the pin to be a general-purpose I/O pin. Any transmit activity that is in progress must first be completed. This includes data characters in progress, queued idle characters, and queued break characters&lt;/EM&gt;.&lt;/FONT&gt;&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;So it would&amp;nbsp;appear that the idle is queued when first enabled, and when disabling the transmitter,&amp;nbsp;this does not take effect until the transmit buffer is emptied and transmission is complete.&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>Mon, 04 Jun 2007 22:27:25 GMT</pubDate>
      <guid>https://community.nxp.com/t5/8-bit-Microcontrollers/SCI-port-initialisation/m-p/135621#M4105</guid>
      <dc:creator>bigmac</dc:creator>
      <dc:date>2007-06-04T22:27:25Z</dc:date>
    </item>
    <item>
      <title>Re: SCI port initialisation</title>
      <link>https://community.nxp.com/t5/8-bit-Microcontrollers/SCI-port-initialisation/m-p/135622#M4106</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;hmm..&lt;BR /&gt;So that means that when i first initialised the ports (rxd and txd)the ports are enabled , and when transmission is completed, it turns to a general i/o port ?&lt;BR /&gt;so when i want to transmit another character , i still have to enable the transmit ports ?&lt;BR /&gt;or is it that after i sent a transmission and it is completed , i can leave it at idle? (my mate says we could do that .. he does it in assembly , and i'm doing it in C )&lt;BR /&gt;&lt;BR /&gt;i'm pretty much confused at the moment &lt;IMG alt=":smileytongue:" class="emoticon emoticon-smileytongue" id="smileytongue" src="http://freescale.i.lithium.com/i/smilies/16x16_smiley-tongue.gif" title="Smiley Tongue" /&gt;&lt;BR /&gt;but 'm going to 'try' to get the chip calibrated .. (using oscilloscope)&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;DIV&gt;&lt;/DIV&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 05 Jun 2007 00:17:38 GMT</pubDate>
      <guid>https://community.nxp.com/t5/8-bit-Microcontrollers/SCI-port-initialisation/m-p/135622#M4106</guid>
      <dc:creator>miSta</dc:creator>
      <dc:date>2007-06-05T00:17:38Z</dc:date>
    </item>
    <item>
      <title>Re: SCI port initialisation</title>
      <link>https://community.nxp.com/t5/8-bit-Microcontrollers/SCI-port-initialisation/m-p/135623#M4107</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;DIV&gt;Hi miSta,&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;Don't worry, if you set TE and RE it will stay enabled always. What we are talking about here is clearing TE during shifter operation won't revert to GPIO until the shifter is finished.&lt;/DIV&gt;&lt;DIV&gt;This little side issue being discussed does not really affect you. It only affects rapid, high turn-around communications.&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;Mac, those excerpts certainly look very clear in that it will happen. I didn't see these before but I did see these which seem to muddy the waters somewhat:&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&lt;FONT face="Helvetica" size="1"&gt;&lt;/FONT&gt;&lt;P&gt;&lt;FONT face="Helvetica" size="1"&gt;&lt;EM&gt;TE also can be used to queue an idle character by writing TE = 0 then TE = 1 while a transmission is in progress.&lt;/EM&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT face="Helvetica" size="1"&gt;&lt;FONT face="Arial" size="3"&gt;and this:&lt;/FONT&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;FONT face="Helvetica" size="1"&gt;&lt;FONT face="Times-Roman"&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;P align="left"&gt;&lt;FONT face="Helvetica" size="1"&gt;&lt;FONT face="Times-Roman"&gt;&lt;EM&gt;Normally, a program would wait for TDRE to become set to indicate the last&lt;/EM&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;P align="left"&gt;&lt;FONT face="Helvetica" size="1"&gt;&lt;FONT face="Times-Roman"&gt;&lt;EM&gt;character of a message has moved to the transmit shifter, then write 0 and then write 1 to the TE bit. This&lt;/EM&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;P align="left"&gt;&lt;FONT face="Helvetica" size="1"&gt;&lt;FONT face="Times-Roman"&gt;&lt;EM&gt;action queues an idle character to be sent as soon as the shifter is available. As long as the character in the&lt;/EM&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;P align="left"&gt;&lt;FONT face="Helvetica" size="1"&gt;&lt;FONT face="Times-Roman"&gt;&lt;EM&gt;shifter does not finish while TE = 0, the SCI transmitter never actually releases control of the TxD1 pin. If&lt;/EM&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;P align="left"&gt;&lt;FONT face="Helvetica" size="1"&gt;&lt;FONT face="Times-Roman"&gt;&lt;EM&gt;there is a possibility of the shifter finishing while TE = 0, set the general-purpose I/O controls so the pin&lt;/EM&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;P align="left"&gt;&lt;FONT face="Helvetica" size="1"&gt;&lt;FONT face="Times-Roman"&gt;&lt;EM&gt;that is shared with TxD1 is an output driving a logic 1. This ensures that the TxD1 line will look like a&lt;/EM&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT face="Helvetica" size="1"&gt;&lt;FONT face="Times-Roman"&gt;&lt;EM&gt;normal idle line even if the SCI loses control of the port pin between writing 0 and then 1 to TE.&lt;/EM&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT face="Helvetica" size="1"&gt;&lt;FONT face="Times-Roman"&gt;&lt;FONT face="Arial" size="3"&gt;Although I have not used this idle wakeup before I will be soon on a GT16A so I will see what happens there. I believe I have already detected a bug in the silicon in the SCI&amp;nbsp;there, but want to test further first (by comparing with QG8).&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT face="Helvetica" size="1"&gt;&lt;FONT face="Times-Roman"&gt;&amp;nbsp;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;/DIV&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 05 Jun 2007 05:58:43 GMT</pubDate>
      <guid>https://community.nxp.com/t5/8-bit-Microcontrollers/SCI-port-initialisation/m-p/135623#M4107</guid>
      <dc:creator>peg</dc:creator>
      <dc:date>2007-06-05T05:58:43Z</dc:date>
    </item>
  </channel>
</rss>

