<?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: rs 485 bus in 8-bit Microcontrollers</title>
    <link>https://community.nxp.com/t5/8-bit-Microcontrollers/rs-485-bus/m-p/144780#M6947</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;DIV&gt;&lt;/DIV&gt;I am starting to implement an RS485 multi-drop bus using HCS08 based micro controller.&lt;BR /&gt;&lt;BR /&gt;I was looking into using a delayed collision detect.&amp;nbsp; The TX ready interrupt (TDRE) ISR to suck data from my TX message buffer.&amp;nbsp; The RX data ready RDRF ISR was to pop the echo'd byte and compare against the appropriate TX message buffer byte.&lt;BR /&gt;&lt;BR /&gt;So the message buffer was an array of bytes, a target byte count, a read&amp;nbsp; pointer, a verify pointer and a rewind pointer(start of message).&lt;BR /&gt;&lt;BR /&gt;TX ISR:&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; SCID = msgBuf[rdOffset++];&lt;BR /&gt;&lt;BR /&gt;RX ISR:&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; temp = SCID&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; if msgBuf[vfOffset++] != temp {&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp; disable TX INT&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp; rdOffset = 0;&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp; vfOffset = 0;&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp; startRetryCnt();&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;BR /&gt;&lt;BR /&gt;Since I am getting RX overrun (OR) interrupts I assume my TX and periodic interrupts are pre-empting the RX interrupt.&amp;nbsp; Is this why Bigmac proposed letting the TX byte travel through the TX Buf, tx shifter, rx shifter rxbuf and compare before second byte sent out?&lt;BR /&gt;&lt;BR /&gt;I was trying to spend as little time as possble on the bus, since a collision requires a back off period anyway I figured 3 bytes of error were as bad as one.&lt;BR /&gt;&lt;BR /&gt;For now I'm going to back off, and use a less aggressive mechanism more along the lines of Mac's, and prove I can detect collisions before I try to optimize bus utilization.&lt;BR /&gt;&lt;DIV&gt;&lt;/DIV&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Fri, 25 Jan 2008 08:52:40 GMT</pubDate>
    <dc:creator>alexod</dc:creator>
    <dc:date>2008-01-25T08:52:40Z</dc:date>
    <item>
      <title>rs 485 bus</title>
      <link>https://community.nxp.com/t5/8-bit-Microcontrollers/rs-485-bus/m-p/144773#M6940</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;DIV&gt;I am trying to recieve a message via the Uart for a MC9S08GT16A.&amp;nbsp;&amp;nbsp;The following code is my attempt to read a line of text and send it out.&amp;nbsp; I cannot seem to find any indication that I am recieving data.&amp;nbsp;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;void RecMsg() {&lt;BR /&gt;&amp;nbsp;byte ix=0;&amp;nbsp;&amp;nbsp;&amp;nbsp; // String pointer&lt;BR /&gt;&amp;nbsp;byte dummy;&amp;nbsp;&amp;nbsp;&amp;nbsp; // dummy var for reading SCIS1&lt;BR /&gt;&amp;nbsp;byte nxt_char;&lt;BR /&gt;&amp;nbsp;char msg[8] ;&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;SEREN == OFF ;&lt;BR /&gt;&amp;nbsp;&amp;nbsp;SCI1C2_RE = 1;&amp;nbsp;&amp;nbsp;&amp;nbsp; // enable Rx&lt;BR /&gt;&amp;nbsp;&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;dummy = SCI1S1;&amp;nbsp;&amp;nbsp; // 1st half of TDRE clear procedure&lt;BR /&gt;&amp;nbsp;msg[ix++] = dummy;&lt;BR /&gt;&amp;nbsp;while( msg[ix++] != 0x00) {&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;nxt_char =SCI1D ; // 2nd half of TDRE clear procedure&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;msg[ix++]=nxt_char ;&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;while(!SCI1S1_TDRE){&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;feedCOP();&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;};&lt;BR /&gt;&amp;nbsp;} //end while((SCI1D&lt;BR /&gt;&amp;nbsp;while(!SCI1S1_TC){&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;feedCOP();&lt;BR /&gt;&amp;nbsp;};&lt;BR /&gt;&amp;nbsp;if(ix&amp;gt;&amp;gt;1)&lt;BR /&gt;&amp;nbsp;SendMsg(msg);&lt;BR /&gt;&amp;nbsp;&lt;BR /&gt;&amp;nbsp;SCI1C2_TE = 0;&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&lt;BR /&gt;} //end RecMsg&lt;/DIV&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 08 Feb 2007 03:17:47 GMT</pubDate>
      <guid>https://community.nxp.com/t5/8-bit-Microcontrollers/rs-485-bus/m-p/144773#M6940</guid>
      <dc:creator>DanielMorley</dc:creator>
      <dc:date>2007-02-08T03:17:47Z</dc:date>
    </item>
    <item>
      <title>Re: rs 485 bus</title>
      <link>https://community.nxp.com/t5/8-bit-Microcontrollers/rs-485-bus/m-p/144774#M6941</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;DIV&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;FONT size="2"&gt;Hello Daniel,&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;There seems to be a little confusion over which flags to test.&amp;nbsp; Firstly, you need to wait until the RDRF flag&amp;nbsp;is set before attempting to read&amp;nbsp;each received character.&amp;nbsp; You also attempt to test the TDRE and TC flags associated with the send process - this confuses the issue for receive function.&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;I assume that the SEREN signal is used for switching the RS485 transceiver device between receive and send modes.&amp;nbsp; I also assume that you are using two-wire, half-duplex RS485 operation (not 4-wire operation).&amp;nbsp; I would suggest that receive mode should remain operational, for both the transceiver and the SCI module, unless you are actually in the process of sending data.&amp;nbsp; However, I cannot see any need to clear the TE and RE bits within the RecMsg() or SendMsg() functions.&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;Broadly speaking, the SendMsg() function should -&lt;/FONT&gt;&lt;/DIV&gt;&lt;BLOCKQUOTE dir="ltr"&gt;&lt;DIV&gt;&lt;FONT size="2"&gt;Set SEREN signal active to enable send mode for the transceiver (and usually to&amp;nbsp;disable receive).&lt;/FONT&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;FONT size="2"&gt;Send the required sequence of characters, waiting for the TDRE flag to become set, between characters.&lt;/FONT&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;FONT size="2"&gt;After the final character is sent, wait for the TC flag to become set.&lt;/FONT&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;FONT size="2"&gt;Set SEREN inactive to revert to receive mode.&lt;/FONT&gt;&lt;/DIV&gt;&lt;/BLOCKQUOTE&gt;&lt;DIV&gt;&lt;FONT size="2"&gt;You can then revert to polling for further receive characters.&amp;nbsp; Ultimately, you may want to use interrupts&amp;nbsp;for the&amp;nbsp;receive process, so that you can do other things whilst waiting for each receive 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;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;&amp;nbsp;&lt;/DIV&gt;&lt;P&gt;Message Edited by bigmac on &lt;SPAN class="date_text"&gt;2007-02-08&lt;/SPAN&gt;&lt;SPAN class="time_text"&gt;02:25 PM&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 08 Feb 2007 12:20:45 GMT</pubDate>
      <guid>https://community.nxp.com/t5/8-bit-Microcontrollers/rs-485-bus/m-p/144774#M6941</guid>
      <dc:creator>bigmac</dc:creator>
      <dc:date>2007-02-08T12:20:45Z</dc:date>
    </item>
    <item>
      <title>Re: rs 485 bus</title>
      <link>https://community.nxp.com/t5/8-bit-Microcontrollers/rs-485-bus/m-p/144775#M6942</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;DIV&gt;&amp;nbsp;Thanks for your reply.&amp;nbsp; I am trying to follow your advice.&amp;nbsp; Yes all of your asssumptions are correct, &amp;nbsp;reguarding SEREN is on and off for the external 485 chip.&amp;nbsp; The sendmessage works find.&amp;nbsp; The recieve function is where I just cann't get a handle on.&amp;nbsp; I am using the send message to check the SCI1D for any sign of life.&amp;nbsp;&amp;nbsp; It is giving me 000 as an output.&amp;nbsp; Reguardless of what data I send.&amp;nbsp; Do you see anything wrong for this vesion of the function.&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;SCI1_Receive(void){&lt;BR /&gt;&amp;nbsp;&lt;BR /&gt;&amp;nbsp;&lt;BR /&gt;&amp;nbsp;static unsigned char pointer = 0;&lt;BR /&gt;&amp;nbsp;uchar ReceiveBuffer[10];&lt;BR /&gt;&amp;nbsp;uchar myChar;&lt;BR /&gt;&amp;nbsp;&lt;BR /&gt;&amp;nbsp;&lt;BR /&gt;&amp;nbsp;&lt;BR /&gt;&amp;nbsp;SEREN == OFF ;&lt;BR /&gt;&amp;nbsp;&amp;nbsp;SCI1C2_RE = 1;&amp;nbsp;&amp;nbsp;&amp;nbsp; // enable Rx&lt;BR /&gt;&amp;nbsp;&amp;nbsp;SCI1C2_RIE=1;&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&lt;BR /&gt;&amp;nbsp;&amp;nbsp;myChar=SCI1S1;&lt;BR /&gt;&amp;nbsp;&amp;nbsp;myChar=SCI1C3;&amp;nbsp; // Reading SCI1C3 is needed as described in EB642&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;SendMsg(num2asc(SCI1D));&lt;BR /&gt;&amp;nbsp;ReceiveBuffer[pointer++] = SCI1D;&lt;BR /&gt;&amp;nbsp;if(pointer &amp;gt;= 10) {&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;SendMsg(num2asc(SCI1D));&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;pointer = 0;&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;BR /&gt;&amp;nbsp;}&lt;BR /&gt;&amp;nbsp;&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;SCI1C2_RIE=0;&lt;BR /&gt;&amp;nbsp;// SendMsg(pointer);&lt;BR /&gt;}&lt;BR /&gt;&lt;/DIV&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 11 Feb 2007 00:31:24 GMT</pubDate>
      <guid>https://community.nxp.com/t5/8-bit-Microcontrollers/rs-485-bus/m-p/144775#M6942</guid>
      <dc:creator>DanielMorley</dc:creator>
      <dc:date>2007-02-11T00:31:24Z</dc:date>
    </item>
    <item>
      <title>Re: rs 485 bus</title>
      <link>https://community.nxp.com/t5/8-bit-Microcontrollers/rs-485-bus/m-p/144776#M6943</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;Hi, Daniel:&lt;BR /&gt;&lt;BR /&gt;I notice that your buffer pointer is static, but the buffer itself is local. Therefore, the buffer is going to be created and destroyed on the stack for each character.&lt;BR /&gt;&lt;BR /&gt;That may or may not be the problem . . .&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 11 Feb 2007 03:19:49 GMT</pubDate>
      <guid>https://community.nxp.com/t5/8-bit-Microcontrollers/rs-485-bus/m-p/144776#M6943</guid>
      <dc:creator>rocco</dc:creator>
      <dc:date>2007-02-11T03:19:49Z</dc:date>
    </item>
    <item>
      <title>Re: rs 485 bus</title>
      <link>https://community.nxp.com/t5/8-bit-Microcontrollers/rs-485-bus/m-p/144777#M6944</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;DIV&gt;No It is changed and that is not it. I am confused on why a simple send SCI1D to the serial port is still giving me a 000.&amp;nbsp; I cann't see how it could be a hardware issue.&amp;nbsp; The recieve port is getting the signal.&amp;nbsp; Could it be something in sendmessage routine?&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&lt;BR /&gt;&amp;nbsp;void SendMsg(char msg[]) {&lt;BR /&gt;&amp;nbsp;byte ix=0;&amp;nbsp;&amp;nbsp;&amp;nbsp; // String pointer&lt;BR /&gt;&amp;nbsp;byte dummy;&amp;nbsp;&amp;nbsp;&amp;nbsp; // dummy var for reading SCIS1&lt;BR /&gt;&amp;nbsp;byte nxt_char;&lt;BR /&gt;&amp;nbsp;&lt;BR /&gt;&amp;nbsp;SCI1C2 = 0x08;&amp;nbsp;&amp;nbsp;&amp;nbsp; // enable Tx&lt;BR /&gt;&amp;nbsp;dummy = SCI1S1;&amp;nbsp;&amp;nbsp; // 1st half of TDRE clear procedure&lt;BR /&gt;&amp;nbsp;nxt_char = msg[ix++];&lt;BR /&gt;&amp;nbsp;while(nxt_char != 0x00) {&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;SCI1D = nxt_char; // 2nd half of TDRE clear procedure&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;nxt_char = msg[ix++];&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;while(!SCI1S1_TDRE){&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;feedCOP();&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;};&lt;BR /&gt;&amp;nbsp;} //end while((SCI1D&lt;BR /&gt;&amp;nbsp;while(!SCI1S1_TC){&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;feedCOP();&lt;BR /&gt;&amp;nbsp;};&lt;BR /&gt;&amp;nbsp;SCI1C2_TE = 0;&lt;BR /&gt;} //end SendMsg&lt;BR /&gt;&amp;nbsp;&lt;/DIV&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 11 Feb 2007 03:38:12 GMT</pubDate>
      <guid>https://community.nxp.com/t5/8-bit-Microcontrollers/rs-485-bus/m-p/144777#M6944</guid>
      <dc:creator>DanielMorley</dc:creator>
      <dc:date>2007-02-11T03:38:12Z</dc:date>
    </item>
    <item>
      <title>Re: rs 485 bus</title>
      <link>https://community.nxp.com/t5/8-bit-Microcontrollers/rs-485-bus/m-p/144778#M6945</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;oh . . . ok . . .&lt;BR /&gt;&lt;BR /&gt;It's hard for me to debug when I'm not looking at the right code . . &lt;IMG alt=":smileywink:" class="emoticon emoticon-smileywink" id="smileywink" src="http://freescale.i.lithium.com/i/smilies/16x16_smiley-wink.gif" title="Smiley Wink" /&gt;&lt;BR /&gt;&lt;BR /&gt;If that is not how the buffer is now defined, how is it defined now? Are you sure the receive and transmit routine are using the same buffer? What is the scope of the new buffer? Are the two routines in the same source file? (I assume so).&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 11 Feb 2007 04:58:50 GMT</pubDate>
      <guid>https://community.nxp.com/t5/8-bit-Microcontrollers/rs-485-bus/m-p/144778#M6945</guid>
      <dc:creator>rocco</dc:creator>
      <dc:date>2007-02-11T04:58:50Z</dc:date>
    </item>
    <item>
      <title>Re: rs 485 bus</title>
      <link>https://community.nxp.com/t5/8-bit-Microcontrollers/rs-485-bus/m-p/144779#M6946</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 Daniel,&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;DIV&gt;&lt;BR /&gt;&lt;/DIV&gt;&lt;BLOCKQUOTE&gt;&lt;DIV&gt;&lt;FONT size="2"&gt;&lt;/FONT&gt;&lt;HR /&gt;&lt;FONT size="2"&gt;Daniel Morley wrote:&lt;BR /&gt;&lt;/FONT&gt;&lt;DIV&gt;&lt;FONT size="2"&gt;&amp;nbsp;The sendmessage works find.&amp;nbsp; The recieve function is where I just cann't get a handle on.&amp;nbsp; I am using the send message to check the SCI1D for any sign of life.&amp;nbsp;&amp;nbsp; It is giving me 000 as an output.&amp;nbsp; Reguardless of what data I send.&amp;nbsp;&lt;/FONT&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;FONT size="2"&gt;&lt;/FONT&gt;&amp;nbsp;&lt;/DIV&gt;&lt;FONT size="2"&gt;&lt;/FONT&gt;&lt;HR /&gt;&lt;/DIV&gt;&lt;/BLOCKQUOTE&gt;&lt;DIV&gt;&lt;FONT size="2"&gt;Am I correct in assuming you are attempting to do a "loopback", where each&amp;nbsp;character sent from the send buffer is to be received by the receive buffer.&amp;nbsp; If this is the case, you will need to ensure the following -&lt;/FONT&gt;&lt;/DIV&gt;&lt;OL&gt;&lt;LI&gt;&lt;FONT size="2"&gt;Two separate&amp;nbsp;buffers, one for send and the other for receive, each with&amp;nbsp;its associated pointer.&amp;nbsp; These should have global scope, per Rocco's post.&lt;/FONT&gt;&lt;/LI&gt;&lt;LI&gt;&lt;FONT size="2"&gt;Since you are polling the flags, you may only send a single character at a time, and must then &lt;U&gt;wait for the RDRF flag&lt;/U&gt; to become set before reading SCI1D.&amp;nbsp; You do not appear to be doing this.&amp;nbsp; After this has occurred, you may then send the next character.&lt;/FONT&gt;&lt;/LI&gt;&lt;LI&gt;&lt;FONT size="2"&gt;For a loopback test to succeed, the receive buffer associated with the RS485 driver must be continuously enabled, even when sending.&amp;nbsp; Conventionally, this would not be the case for a RS485 interface.&lt;/FONT&gt;&lt;/LI&gt;&lt;/OL&gt;&lt;FONT size="2"&gt;&lt;/FONT&gt;&lt;DIV&gt;&lt;FONT size="2"&gt;Item 2 would no longer apply if you were to use&amp;nbsp;receive interrupts, since the send&amp;nbsp;and the receive processes would be entirely separate - the receive buffer would be filled from within the ISR independently of the data 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;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;&amp;nbsp;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 11 Feb 2007 14:32:32 GMT</pubDate>
      <guid>https://community.nxp.com/t5/8-bit-Microcontrollers/rs-485-bus/m-p/144779#M6946</guid>
      <dc:creator>bigmac</dc:creator>
      <dc:date>2007-02-11T14:32:32Z</dc:date>
    </item>
    <item>
      <title>Re: rs 485 bus</title>
      <link>https://community.nxp.com/t5/8-bit-Microcontrollers/rs-485-bus/m-p/144780#M6947</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;DIV&gt;&lt;/DIV&gt;I am starting to implement an RS485 multi-drop bus using HCS08 based micro controller.&lt;BR /&gt;&lt;BR /&gt;I was looking into using a delayed collision detect.&amp;nbsp; The TX ready interrupt (TDRE) ISR to suck data from my TX message buffer.&amp;nbsp; The RX data ready RDRF ISR was to pop the echo'd byte and compare against the appropriate TX message buffer byte.&lt;BR /&gt;&lt;BR /&gt;So the message buffer was an array of bytes, a target byte count, a read&amp;nbsp; pointer, a verify pointer and a rewind pointer(start of message).&lt;BR /&gt;&lt;BR /&gt;TX ISR:&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; SCID = msgBuf[rdOffset++];&lt;BR /&gt;&lt;BR /&gt;RX ISR:&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; temp = SCID&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; if msgBuf[vfOffset++] != temp {&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp; disable TX INT&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp; rdOffset = 0;&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp; vfOffset = 0;&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp; startRetryCnt();&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;BR /&gt;&lt;BR /&gt;Since I am getting RX overrun (OR) interrupts I assume my TX and periodic interrupts are pre-empting the RX interrupt.&amp;nbsp; Is this why Bigmac proposed letting the TX byte travel through the TX Buf, tx shifter, rx shifter rxbuf and compare before second byte sent out?&lt;BR /&gt;&lt;BR /&gt;I was trying to spend as little time as possble on the bus, since a collision requires a back off period anyway I figured 3 bytes of error were as bad as one.&lt;BR /&gt;&lt;BR /&gt;For now I'm going to back off, and use a less aggressive mechanism more along the lines of Mac's, and prove I can detect collisions before I try to optimize bus utilization.&lt;BR /&gt;&lt;DIV&gt;&lt;/DIV&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 25 Jan 2008 08:52:40 GMT</pubDate>
      <guid>https://community.nxp.com/t5/8-bit-Microcontrollers/rs-485-bus/m-p/144780#M6947</guid>
      <dc:creator>alexod</dc:creator>
      <dc:date>2008-01-25T08:52:40Z</dc:date>
    </item>
    <item>
      <title>Re: rs 485 bus</title>
      <link>https://community.nxp.com/t5/8-bit-Microcontrollers/rs-485-bus/m-p/144781#M6948</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&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;My use of half-duplex RS485 communications has always been associated with a master/slave system.&amp;nbsp; Since the slave will only generate a transmission in response to a request made by the master,&amp;nbsp;there is no chance of collision with normal operation.&amp;nbsp; Of course, it is always possible that the request byte(s) may be corrupted so that two slaves may attempt to respond, but this shoould be a very infrrequent event, and would be detected by using a checksum or CRC for the returned data.&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;I would think that RS485 communications may be inappropriate where collision is a frequent possibility.&amp;nbsp; My reason for saying this is that the output state is actively driven in both directions that can result in high currents during a collision.&amp;nbsp;&amp;nbsp;RS485 drivers do have current limiting for short circuit protection, but the current level may be higher than you might wish to&amp;nbsp;cater for&amp;nbsp;during normal operation.&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;Accepting that it may not be possible to use master/slave operation, to detect a collision the primary issue would be to&amp;nbsp;determine&amp;nbsp;the send byte&amp;nbsp;corresponding to the&amp;nbsp;current received byte.&amp;nbsp; The comparison should be done within the receive&amp;nbsp;ISR, because once the ISR is exited, the position within the receive buffer&amp;nbsp;could be ambiguous, especially if there is a delay before the buffer is next read.&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;One possible method might be to allocate an additional&amp;nbsp;global variable, and&amp;nbsp;a global flag.&amp;nbsp; When sending&amp;nbsp;each data byte within the send ISR, also place the current character value within the new global variable.&amp;nbsp; When no more data is to be sent, perhaps the variable should be zeroed to indicate that receive comparison is no longer required.&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;Within the receive ISR, if the variable value is non-zero, do the comparison with the incoming byte value, and set the global flag if there is an error.&amp;nbsp; You will need to determine if&amp;nbsp; the echo of each send byte should also be placed in the receive buffer (there doesn't appear to be any specific reason to do so).&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;If zero is a valid send value, an alternative method of determining when the comparison is required would be to examine the current state of the send enable output line from the MCU.&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;A final word about your baud rate.&amp;nbsp; The critical timing will&amp;nbsp;commence when the send character is actually written to SCID.&amp;nbsp; There should be&amp;nbsp;immediate exit from the ISR after this occurs.&amp;nbsp; You then require that the&amp;nbsp;SCI receive interrupt should be the next event, and SCID&amp;nbsp;read should be the first thing done within the ISR, to minimize&amp;nbsp;any possibility of overrun.&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;You must also ensure that any other higher priority interrupts&amp;nbsp;cannot occur.&amp;nbsp; Perhaps these could be disabled within the send ISR, and re-enabled within the receive ISR.&amp;nbsp; The maximum number of MCU cycles between the write and read operations for SCID will dictate the maximum allowable baud rate, and this may be significantly less than the RS485 specification allows.&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;Note that this&amp;nbsp;limitation only applies when you require collision detection&amp;nbsp;as a result of&amp;nbsp;a send, and not to the normal receipt of SCI data&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;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 25 Jan 2008 22:16:10 GMT</pubDate>
      <guid>https://community.nxp.com/t5/8-bit-Microcontrollers/rs-485-bus/m-p/144781#M6948</guid>
      <dc:creator>bigmac</dc:creator>
      <dc:date>2008-01-25T22:16:10Z</dc:date>
    </item>
    <item>
      <title>Re: rs 485 bus</title>
      <link>https://community.nxp.com/t5/8-bit-Microcontrollers/rs-485-bus/m-p/144782#M6949</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;Mac,&lt;BR /&gt;&lt;BR /&gt;Thanks for the info.&lt;BR /&gt;&lt;BR /&gt;The slaves on my bus are easily discarding rubbish, and resynching with the next whole message seen.&amp;nbsp; I have variable length packets, and if the byte count gets scrambled, then I end up lookig for a long message before typically discarding for bad check sum.&lt;BR /&gt;&lt;BR /&gt;I have a multi master potential, and was looking for a smart way to resend.&amp;nbsp; However, the data would either be&lt;BR /&gt;1 - infrequent user command, users will press again if they didn't see it, especially with a membrane keypad.&lt;BR /&gt;2 - host streamed data has a short life span, and lost data can be dropped without damage to the whole.&lt;BR /&gt;3 - critical data requires an ack, and so will be handled. - corrupted ack or no ack will cause re-send.&lt;BR /&gt;&lt;BR /&gt;I think I can stand sending only one byte and waiting for the rx'd version before sending the next.&lt;BR /&gt;&lt;BR /&gt;Will try disabling Ticker while waiting for the echos&lt;BR /&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 05 Feb 2008 07:37:38 GMT</pubDate>
      <guid>https://community.nxp.com/t5/8-bit-Microcontrollers/rs-485-bus/m-p/144782#M6949</guid>
      <dc:creator>alexod</dc:creator>
      <dc:date>2008-02-05T07:37:38Z</dc:date>
    </item>
    <item>
      <title>Re: rs 485 bus</title>
      <link>https://community.nxp.com/t5/8-bit-Microcontrollers/rs-485-bus/m-p/144783#M6950</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;Hi alexod,&lt;BR /&gt;&lt;BR /&gt;I will be, over the next few weeks, converting an existing product from single master - many slave to multi-master (1, 2 or 3) - many slaves on a two-wire 485 bus. I have many ideas in my head how to implement this but have not started in ernest yet. Collisions is of course the major new problem here. I am looking to implement idle line detect to save nodes listening to all of a message not intended for them and also to use this as a method of collision avoidance.&lt;BR /&gt;So stay tuned, we may have some ideas we can share.&lt;BR /&gt;&lt;BR /&gt;&lt;DIV&gt;&lt;/DIV&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 05 Feb 2008 15:52:07 GMT</pubDate>
      <guid>https://community.nxp.com/t5/8-bit-Microcontrollers/rs-485-bus/m-p/144783#M6950</guid>
      <dc:creator>peg</dc:creator>
      <dc:date>2008-02-05T15:52:07Z</dc:date>
    </item>
    <item>
      <title>Re: rs 485 bus</title>
      <link>https://community.nxp.com/t5/8-bit-Microcontrollers/rs-485-bus/m-p/144784#M6951</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&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;With a multi-master system, I guess the only likely send contention is between masters.&amp;nbsp; I would assume that each slave would be specifically addressed by one of the masters, so the return slave transmissions would be well regulated.&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;A&amp;nbsp;possible approach is for each master unit to also possess a unique slave address, so that it may be polled by the currently active master, duriing "round robin" polling of the various slaves.&amp;nbsp; In this way, one of the other master units may be assigned as the active master.&amp;nbsp; This should avoid any transmission&amp;nbsp;contention.&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;To cater for a reset condition, perhaps due to temporary power loss, and the startup of the system, perhaps each master should monitor the period since last polled, and if it should exceed a limit, to assume current master status, and commence polling operation.&amp;nbsp; The possibility of contention during this process could be minimized by making the time period a random value between minimum and maximum limits.&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;Should a data transmission be corrupted, the ease of detecting the start of the next data packet by each slave will depend, to some extent, on the type of data being transmitted.&amp;nbsp; If the data can be limited to ASCII characters, it opens up the possibility of using control character to define the start and end of the packet, in addition to handshaking the data transfer.&amp;nbsp; The most complex case would occur if the data may assume any 8-bit value.&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;If the size of the data packet is relatively small, the ASCII approach might be adopted, even though two characters&amp;nbsp;would be required to represent&amp;nbsp;a random&amp;nbsp;8-bit value.&amp;nbsp;Of course, if the data to be sent can be naturally represented&amp;nbsp;as an ASCII string, the choice is obvious.&amp;nbsp;&amp;nbsp;It is also possible that the size of a variable length packet need not be sent if the beginning and end of the packet are uniquely defined.&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;Previously, I have chosen to use the special 9-bit mode so that I can directly differentiate the byte (or should that be nonnet for nine bits) that represents the slave address.&amp;nbsp; The ninth bit setting can also filter the incoming data to the slaves, so that each slave will monitor only&amp;nbsp;address bytes, until its own address is received, although personally, I have not found this to be necessary.&amp;nbsp; One drawback with this method is that the SCI receive ISR processing will be a little more complex, to determine the ninth-bit status, and avoid the need to store other than&amp;nbsp;8-bit values within the receive circular buffer..&amp;nbsp; Otherwise, two bytes of RAM would be needed&amp;nbsp;to store&amp;nbsp;each 9-bit value.&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;&amp;nbsp;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 05 Feb 2008 22:25:12 GMT</pubDate>
      <guid>https://community.nxp.com/t5/8-bit-Microcontrollers/rs-485-bus/m-p/144784#M6951</guid>
      <dc:creator>bigmac</dc:creator>
      <dc:date>2008-02-05T22:25:12Z</dc:date>
    </item>
    <item>
      <title>Re: rs 485 bus</title>
      <link>https://community.nxp.com/t5/8-bit-Microcontrollers/rs-485-bus/m-p/144785#M6952</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;DIV&gt;&lt;/DIV&gt;For this system I am using an ASCII formatted header,&lt;BR /&gt;&lt;BR /&gt;STX (or was it SOH I forget), then&lt;BR /&gt;3 bytes address, these being a byte for&amp;nbsp;&lt;BR /&gt;&amp;nbsp; device type&lt;BR /&gt;&amp;nbsp; device unique address&lt;BR /&gt;&amp;nbsp; sub function address.&lt;BR /&gt;byte count, I needed variable length packets so I added the byte count.&amp;nbsp; The payload is not ascii, hence not just using ETX&lt;BR /&gt;&lt;BR /&gt;First byte of payload was a message type ID&lt;BR /&gt;&lt;BR /&gt;after the payload I added a footer&lt;BR /&gt;XOR Checksum,&lt;BR /&gt;EOT&lt;BR /&gt;&lt;BR /&gt;I found the SOH, ADDR combination sufficient that nodes (including idle masters) only synch'd with start of real messages. If I ever latched onto the wrong thing, data looking like header, worst case byte counter would get set to 255, Check sum typically failed, and I missed a few messages in between.&lt;BR /&gt;&lt;BR /&gt;As for line idle, I was simply going to restart an idle timer in the RX ISR.&amp;nbsp; If this timer expires, then line is idle.&amp;nbsp; Of course, I could only detect after the shifter in the SCI captured the byte, so I could possibly have an outgoing byte in the pipe at the same time.&amp;nbsp; Hmm, isn't there a receiver active flag I could look at?&lt;BR /&gt;&lt;BR /&gt;A comparator&amp;nbsp; between TX and RX lines (with delay buffers) would be excellent, especially if it was hardwired&amp;nbsp; to the TX enable of the RS485 driver, that would stop that commotion.&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;I agree with Mac, a round robin scheme, where the Master A reliquishes bus control, explicitly giving it to Master B, who gives to Master C etc.&amp;nbsp; Trouble is starting the system, everyone having to register.&amp;nbsp; A static configuration will allow this, but needs either NVRAM/FLASH/EEPROM set up or dip switch/jumper setting.&lt;BR /&gt;&lt;BR /&gt;One thing that has helped in the past is giving a "random delay" to units when they start registering.&amp;nbsp; This needs to be appropriately scaled for your app.&amp;nbsp; Thankfully I'm in infotainment, not engine management, so I have time.&lt;BR /&gt;&lt;BR /&gt;I was hoping to find a standard way of doing things, but neither Modbus, DMX nor NMEA 0183 seemed to help me.&amp;nbsp; Did I miss an existing mulit drop "multi master" standard while looking?&lt;BR /&gt;&lt;DIV&gt;&lt;/DIV&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 06 Feb 2008 02:31:33 GMT</pubDate>
      <guid>https://community.nxp.com/t5/8-bit-Microcontrollers/rs-485-bus/m-p/144785#M6952</guid>
      <dc:creator>alexod</dc:creator>
      <dc:date>2008-02-06T02:31:33Z</dc:date>
    </item>
    <item>
      <title>Re: rs 485 bus</title>
      <link>https://community.nxp.com/t5/8-bit-Microcontrollers/rs-485-bus/m-p/144786#M6953</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;Dear Alexod,&lt;BR /&gt;&lt;BR /&gt;Maybe you could use some CSMA-CD strategies to deal with collisions. I don't know the current status of CSMA-CD but in ancient times they were listening to the bus all the time and when a collision happens, both transmitters shut up, wait for a random time (ms) and transmit after this random time if the line was idle.&lt;BR /&gt;&lt;BR /&gt;There was also a variation of CSMA-CD that instead a random time, there was a node attribute, priority, so the higher priority nodes had shorter times.&lt;BR /&gt;&lt;BR /&gt;In hardware terms you'll need one xor gate checking TX against RX line.&lt;BR /&gt;&lt;BR /&gt;Maybe you could look at CAN startegies, too. But since the CAN chips take care of this comm level, maybe you'll have to llok at the basics.&lt;BR /&gt;&lt;BR /&gt;I hope it helps,&lt;BR /&gt;&lt;BR /&gt;Celso&lt;BR /&gt;&lt;DIV&gt;&lt;/DIV&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 06 Feb 2008 21:27:36 GMT</pubDate>
      <guid>https://community.nxp.com/t5/8-bit-Microcontrollers/rs-485-bus/m-p/144786#M6953</guid>
      <dc:creator>celsoken</dc:creator>
      <dc:date>2008-02-06T21:27:36Z</dc:date>
    </item>
    <item>
      <title>Re: rs 485 bus</title>
      <link>https://community.nxp.com/t5/8-bit-Microcontrollers/rs-485-bus/m-p/144787#M6954</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;Celso,&lt;BR /&gt;&lt;BR /&gt;Thanks, will look into it.&amp;nbsp; The flow diagram on Wikipedia's entry for CSMA/CD looks very familiar.&lt;BR /&gt;&lt;BR /&gt;The board design is pretty solid at the moment and I can't lobby for additional hardware for collision detect.&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;As for just an XOR.&amp;nbsp; I got caught out a few years ago.&amp;nbsp; I had two 8:1 mux devices, they shared addresses, and differed only in bit 0 of the address went through an inverter to CS# of one device, and direct to the other.&amp;nbsp; We ended up with a gate delay which meant we had trouble reading those devices.&amp;nbsp; I am now concerned that if I XOR TXD and RXD, there is the propagation delay through the TX buffer(charge pump/driver) and RX buffer, so there will be glitches at the leading edge of each transition on the TX line.&amp;nbsp; I would want some assurance that that glitch would not be a problem.&lt;BR /&gt;&lt;BR /&gt;As for CAN.&amp;nbsp; You'd think being an in-car infotainment system we would be going CAN.&amp;nbsp; However, the project architect elected to use RS485, primarily as a cost issue, but also so we never get connected to the vehicles own CAN bus.&amp;nbsp; The project will be heading to marine applications too, hence my interest in NMEA 0183 NMEA 2000.&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;DIV&gt;&lt;/DIV&gt;Again thanks,&lt;BR /&gt;&lt;BR /&gt;Alex&lt;BR /&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 07 Feb 2008 01:47:12 GMT</pubDate>
      <guid>https://community.nxp.com/t5/8-bit-Microcontrollers/rs-485-bus/m-p/144787#M6954</guid>
      <dc:creator>alexod</dc:creator>
      <dc:date>2008-02-07T01:47:12Z</dc:date>
    </item>
    <item>
      <title>Re: rs 485 bus</title>
      <link>https://community.nxp.com/t5/8-bit-Microcontrollers/rs-485-bus/m-p/144788#M6955</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I appologize for piggy-backing onto this discussion.&amp;nbsp; But I too am about to start a RS-422/485 design, using a MC9S08QG8 as the master micro.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;For development of the system, I am wondering what you all might recommend for hardware.&amp;nbsp; For instance, is there a good eval board that has a 485 transceiver which can be connected to a PC for debug?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks for your recommendations.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 15 Oct 2009 02:13:16 GMT</pubDate>
      <guid>https://community.nxp.com/t5/8-bit-Microcontrollers/rs-485-bus/m-p/144788#M6955</guid>
      <dc:creator>irob</dc:creator>
      <dc:date>2009-10-15T02:13:16Z</dc:date>
    </item>
    <item>
      <title>Re: rs 485 bus</title>
      <link>https://community.nxp.com/t5/8-bit-Microcontrollers/rs-485-bus/m-p/144789#M6956</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;For my development system, we had the actual boards in house pretty quick, so no eval board for the CPU.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The other end is quite important though, the data for your RS485 bus.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;We started with a real low cost USB to RS485 device from an outfit called Light-O-Rama.&amp;nbsp; Basically it's an FTDI chip in a small housing with RJ45 plugs for the RS485 interface.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I later switched to a quad serial port box from Quatech.&amp;nbsp; These are switchable between RS232, 422 and 485.&amp;nbsp; They have a version with voltage protection too.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;For monitoring I went with Free Serial Port Monitor by &lt;A href="http://www.hhdsoftware.com/" rel="nofollow" target="_blank"&gt;http://www.hhdsoftware.com/&lt;/A&gt;&amp;nbsp; I find this software gives all that I expected from our old HP serial protocol analyzer.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 15 Oct 2009 02:24:10 GMT</pubDate>
      <guid>https://community.nxp.com/t5/8-bit-Microcontrollers/rs-485-bus/m-p/144789#M6956</guid>
      <dc:creator>alexod</dc:creator>
      <dc:date>2009-10-15T02:24:10Z</dc:date>
    </item>
    <item>
      <title>Re: rs 485 bus</title>
      <link>https://community.nxp.com/t5/8-bit-Microcontrollers/rs-485-bus/m-p/144790#M6957</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Dear Irob,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;So you're promoting the QG8 as a master. Yoda would be proud huh?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;If I had to do it w/ available stuff, I'd use the DEMO9S08GQ8, wich already has a RS-232 interface, a gender changer (change DB9 female to male) and use a shelf PC RS-232 to 485 converter. Remember to use one QG8 pin for flow control (RTS or DTR).&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The same type of converter could be used for sniffing the network.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I hope it helps,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Celso&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 15 Oct 2009 02:32:08 GMT</pubDate>
      <guid>https://community.nxp.com/t5/8-bit-Microcontrollers/rs-485-bus/m-p/144790#M6957</guid>
      <dc:creator>celsoken</dc:creator>
      <dc:date>2009-10-15T02:32:08Z</dc:date>
    </item>
    <item>
      <title>Re: rs 485 bus</title>
      <link>https://community.nxp.com/t5/8-bit-Microcontrollers/rs-485-bus/m-p/144791#M6958</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;Thanks, everyone!&amp;nbsp; Great suggestions.&amp;nbsp; I have the DEMOQG8 board.&amp;nbsp; For monitoring, I have been using the open source RealTerm for some time now, which even has the flow control bit option for RS485 apps.&amp;nbsp; Could be useful in your dev setup, celsoken.&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 15 Oct 2009 04:02:44 GMT</pubDate>
      <guid>https://community.nxp.com/t5/8-bit-Microcontrollers/rs-485-bus/m-p/144791#M6958</guid>
      <dc:creator>irob</dc:creator>
      <dc:date>2009-10-15T04:02:44Z</dc:date>
    </item>
    <item>
      <title>Re: rs 485 bus</title>
      <link>https://community.nxp.com/t5/8-bit-Microcontrollers/rs-485-bus/m-p/144792#M6959</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Realterm sounds nice to me! I'll evaluate that! Thanks Irob!&lt;/P&gt;&lt;P&gt;Cheers,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Celso&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 15 Oct 2009 04:21:20 GMT</pubDate>
      <guid>https://community.nxp.com/t5/8-bit-Microcontrollers/rs-485-bus/m-p/144792#M6959</guid>
      <dc:creator>celsoken</dc:creator>
      <dc:date>2009-10-15T04:21:20Z</dc:date>
    </item>
  </channel>
</rss>

