<?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: 9-bit SCI Trouble in 8-bit Microcontrollers</title>
    <link>https://community.nxp.com/t5/8-bit-Microcontrollers/9-bit-SCI-Trouble/m-p/124159#M176</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;BR /&gt;&lt;BLOCKQUOTE&gt;&lt;HR /&gt;rhinoceroshead wrote:&lt;BR /&gt;&lt;DIV&gt;&lt;/DIV&gt;&lt;BR /&gt;&lt;P&gt;What data type is OutputBuffer declared as? If it is a char then there would be no ninth bit to set.&lt;/P&gt;&lt;BR /&gt;&lt;P&gt;SCC3_T8 = (OutBuffer[OutIndxR] &amp;gt;&amp;gt; 8) &amp;amp; 1; /* Set the ninth bit */&lt;/P&gt;&lt;BR /&gt;&lt;P&gt;Otherwise, this should work - provided that the SCI has been configured for 9 bit data.&lt;/P&gt;&lt;BR /&gt;&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;Its is a word/unsigned int. Which tells me that I have to manipulate the first bit of the second byte in the transmitted data? I will try this and let you know, but please tell me what you think.&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;Sincere thanks,&lt;BR /&gt;Rock&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Fri, 14 Jul 2006 23:52:26 GMT</pubDate>
    <dc:creator>RocK</dc:creator>
    <dc:date>2006-07-14T23:52:26Z</dc:date>
    <item>
      <title>9-bit SCI Trouble</title>
      <link>https://community.nxp.com/t5/8-bit-Microcontrollers/9-bit-SCI-Trouble/m-p/124156#M173</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;I am having difficulty getting the 9th bit of the serial communication to be high during transmission. After setting the SCC3 register bit T8 to TRUE I then do a "AS1_SendChar(*Ptr)" in which I expect the 9th bit to be high. However, after looking at the transmission on a scope this is clearly not happening.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I realize I must be missing something so what must be done to ensure manipulation of this 9th bit.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Sincere thanks,&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Rock&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 14 Jul 2006 22:28:55 GMT</pubDate>
      <guid>https://community.nxp.com/t5/8-bit-Microcontrollers/9-bit-SCI-Trouble/m-p/124156#M173</guid>
      <dc:creator>RocK</dc:creator>
      <dc:date>2006-07-14T22:28:55Z</dc:date>
    </item>
    <item>
      <title>Re: 9-bit SCI Trouble</title>
      <link>https://community.nxp.com/t5/8-bit-Microcontrollers/9-bit-SCI-Trouble/m-p/124157#M174</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;UPDATE:&lt;BR /&gt;&lt;BR /&gt;I seem to have found why setting the SCC3_T8 bit manually isn't working. Below is the ISR that has code which sets up SCC3_T8 for you. However, I am still not sure how to manipulate the 9th bit. I removed all the comments except for the line of code of interrest to improve readability.&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;Thanks,&lt;BR /&gt;Rock&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;/*&lt;BR /&gt;** ===================================================================&lt;BR /&gt;** Method : AS1_InterruptTx (bean AsynchroSerial)&lt;BR /&gt;**&lt;BR /&gt;** Description :&lt;BR /&gt;** The method services the receive interrupt of the selected&lt;BR /&gt;** peripheral(s) and eventually invokes the bean's event(s).&lt;BR /&gt;** This method is internal. It is used by Processor Expert only.&lt;BR /&gt;** ===================================================================&lt;BR /&gt;*/&lt;BR /&gt;#define ON_FREE_TX 1&lt;BR /&gt;#define ON_TX_CHAR 2&lt;BR /&gt;ISR(AS1_InterruptTx)&lt;BR /&gt;{&lt;BR /&gt; byte OnFlags = 0;&lt;BR /&gt;&lt;BR /&gt; if(SerFlag &amp;amp; RUNINT_FROM_TX) {&lt;BR /&gt; OnFlags |= ON_TX_CHAR;&lt;BR /&gt;}&lt;BR /&gt; SerFlag &amp;amp;= ~RUNINT_FROM_TX;&lt;BR /&gt; if(AS1_OutLen) {&lt;BR /&gt; AS1_OutLen--;&lt;BR /&gt; SerFlag |= RUNINT_FROM_TX;&lt;BR /&gt; (void)SCS1;&lt;BR /&gt; SCC3_T8 = (OutBuffer[OutIndxR] &amp;gt;&amp;gt; 8) &amp;amp; 1; /* Set the ninth bit */&lt;BR /&gt; SCDR = (byte)OutBuffer[OutIndxR];&lt;BR /&gt; if (++OutIndxR &amp;gt;= AS1_OUT_BUF_SIZE) {&lt;BR /&gt; OutIndxR = 0;&lt;BR /&gt; }&lt;BR /&gt; }&lt;BR /&gt; else {&lt;BR /&gt; OnFlags |= ON_FREE_TX;&lt;BR /&gt; SCC2_SCTIE = 0;&lt;BR /&gt; }&lt;BR /&gt; if(OnFlags &amp;amp; ON_TX_CHAR) {&lt;BR /&gt; AS1_OnTxChar();&lt;BR /&gt; }&lt;BR /&gt; if(OnFlags &amp;amp; ON_FREE_TX) {&lt;BR /&gt; AS1_OnFreeTxBuf();&lt;BR /&gt;; }&lt;BR /&gt;}&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 14 Jul 2006 23:15:27 GMT</pubDate>
      <guid>https://community.nxp.com/t5/8-bit-Microcontrollers/9-bit-SCI-Trouble/m-p/124157#M174</guid>
      <dc:creator>RocK</dc:creator>
      <dc:date>2006-07-14T23:15:27Z</dc:date>
    </item>
    <item>
      <title>Re: 9-bit SCI Trouble</title>
      <link>https://community.nxp.com/t5/8-bit-Microcontrollers/9-bit-SCI-Trouble/m-p/124158#M175</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;DIV&gt;&lt;/DIV&gt;&lt;P&gt;What data type is OutputBuffer declared as?&amp;nbsp; If it is a char then there would be no ninth bit to set.&lt;/P&gt;&lt;P&gt;SCC3_T8 = (OutBuffer[OutIndxR] &amp;gt;&amp;gt; 8) &amp;amp; 1; /* Set the ninth bit */&lt;/P&gt;&lt;P&gt;Otherwise, this should work - provided that the SCI has been configured for 9 bit data.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 14 Jul 2006 23:26:53 GMT</pubDate>
      <guid>https://community.nxp.com/t5/8-bit-Microcontrollers/9-bit-SCI-Trouble/m-p/124158#M175</guid>
      <dc:creator>rhinoceroshead</dc:creator>
      <dc:date>2006-07-14T23:26:53Z</dc:date>
    </item>
    <item>
      <title>Re: 9-bit SCI Trouble</title>
      <link>https://community.nxp.com/t5/8-bit-Microcontrollers/9-bit-SCI-Trouble/m-p/124159#M176</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;BR /&gt;&lt;BLOCKQUOTE&gt;&lt;HR /&gt;rhinoceroshead wrote:&lt;BR /&gt;&lt;DIV&gt;&lt;/DIV&gt;&lt;BR /&gt;&lt;P&gt;What data type is OutputBuffer declared as? If it is a char then there would be no ninth bit to set.&lt;/P&gt;&lt;BR /&gt;&lt;P&gt;SCC3_T8 = (OutBuffer[OutIndxR] &amp;gt;&amp;gt; 8) &amp;amp; 1; /* Set the ninth bit */&lt;/P&gt;&lt;BR /&gt;&lt;P&gt;Otherwise, this should work - provided that the SCI has been configured for 9 bit data.&lt;/P&gt;&lt;BR /&gt;&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;Its is a word/unsigned int. Which tells me that I have to manipulate the first bit of the second byte in the transmitted data? I will try this and let you know, but please tell me what you think.&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;Sincere thanks,&lt;BR /&gt;Rock&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 14 Jul 2006 23:52:26 GMT</pubDate>
      <guid>https://community.nxp.com/t5/8-bit-Microcontrollers/9-bit-SCI-Trouble/m-p/124159#M176</guid>
      <dc:creator>RocK</dc:creator>
      <dc:date>2006-07-14T23:52:26Z</dc:date>
    </item>
    <item>
      <title>Re: 9-bit SCI Trouble</title>
      <link>https://community.nxp.com/t5/8-bit-Microcontrollers/9-bit-SCI-Trouble/m-p/124160#M177</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;DIV&gt;Okay, try replacing that line with this just as a test:&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;SCC3_T8 = ((unsigned int)(0x0100) &amp;gt;&amp;gt; 8) &amp;amp; 1; /* Set the ninth bit */&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;This should just send the 9th bit regardless of what data you really want to send.&amp;nbsp; If&amp;nbsp;the bit&amp;nbsp;shows up on the oscilloscope then you know that the configuration is good and that the code is working - which would mean the only reason you hadn't seen the pulse before is because the unsgined ints that you were sending just didn't happen to have a ninth bit as a 1.&amp;nbsp; If this test doesn't work, then you know that something has to be wrong with the SCI configuration.&lt;/DIV&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 15 Jul 2006 02:58:18 GMT</pubDate>
      <guid>https://community.nxp.com/t5/8-bit-Microcontrollers/9-bit-SCI-Trouble/m-p/124160#M177</guid>
      <dc:creator>rhinoceroshead</dc:creator>
      <dc:date>2006-07-15T02:58:18Z</dc:date>
    </item>
    <item>
      <title>Re: 9-bit SCI Trouble</title>
      <link>https://community.nxp.com/t5/8-bit-Microcontrollers/9-bit-SCI-Trouble/m-p/124161#M178</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;Hello,&lt;BR /&gt;The SendChar method and both input and output buffers use the special type AS1_TComData that represents a character. &lt;BR /&gt;This type is declared according to the required width specified by AsynchroSerial bean property named 'Width'.&lt;BR /&gt;So to send a character with 9-bit message it's enough to just pass it as a unsigned int to the SendChar function. For example:&lt;BR /&gt;&lt;BR /&gt; AS1_TComData x; // x is delared as a 16-bit word&lt;BR /&gt; ...&lt;BR /&gt;&lt;BR /&gt; x = 'a' | 0x100; // send a with 9-th bit set&lt;BR /&gt; AS1_SendChar(x);&lt;BR /&gt;&lt;BR /&gt;best regards&lt;BR /&gt;Petr Hradsky&lt;BR /&gt;Processor Expert Support Team&lt;BR /&gt;UNIS&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 17 Jul 2006 15:13:09 GMT</pubDate>
      <guid>https://community.nxp.com/t5/8-bit-Microcontrollers/9-bit-SCI-Trouble/m-p/124161#M178</guid>
      <dc:creator>ProcessorExpert</dc:creator>
      <dc:date>2006-07-17T15:13:09Z</dc:date>
    </item>
    <item>
      <title>Re: 9-bit SCI Trouble</title>
      <link>https://community.nxp.com/t5/8-bit-Microcontrollers/9-bit-SCI-Trouble/m-p/124162#M179</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;Petr Hradsky,&lt;BR /&gt;&lt;BR /&gt;Thanks for the help, hopefully this post will help any other soul lucky enough to have to deal with a 9-bit protocol. I fortunately found the data type and guess my way to the answer on Friday and mistakenly didn't post my solution, my apologize.&lt;BR /&gt;&lt;BR /&gt;Sincere thanks,&lt;BR /&gt;Rock&lt;P&gt;Message Edited by RocK on &lt;SPAN class="date_text"&gt;2006-07-17&lt;/SPAN&gt; &lt;SPAN class="time_text"&gt;10:43 AM&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 17 Jul 2006 22:42:21 GMT</pubDate>
      <guid>https://community.nxp.com/t5/8-bit-Microcontrollers/9-bit-SCI-Trouble/m-p/124162#M179</guid>
      <dc:creator>RocK</dc:creator>
      <dc:date>2006-07-17T22:42:21Z</dc:date>
    </item>
  </channel>
</rss>

