<?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>Other NXP ProductsのトピックRe: MC68302 / HDLC problem</title>
    <link>https://community.nxp.com/t5/Other-NXP-Products/MC68302-HDLC-problem/m-p/159572#M800</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;&lt;/FONT&gt;&lt;P&gt;&lt;FONT size="2"&gt;brudd,&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT size="2"&gt;It's been a long time since I've worked on HDLC, but I believe I can at least describe what is going on and where you can look next in fixing your problem as previously in my career, I worked on HDLC and derivative protocols for many years.&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT size="2"&gt;You wrote:&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT size="2"&gt;&lt;EM&gt;&lt;STRONG&gt;&amp;nbsp; What we don't understand is, if both hardwares are running at same baud rate&lt;BR /&gt;&amp;nbsp; why should there be a sync problem?&lt;/STRONG&gt;&lt;/EM&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT size="2"&gt;&lt;EM&gt;&lt;STRONG&gt;&amp;nbsp; Is 68302 really so intolerant about its baud rate?&lt;BR /&gt;&lt;/STRONG&gt;&lt;/EM&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT size="2"&gt;The main issue with running these older protocols is that they are truly "synchronous" protocols and if you don't get the timing 100% exact, you'll get problems such as aborts, overruns, crc errors etc. These devices and associated level 1 protocols assume the timing must be just about perfect and when the receiver receives data from another devices, it must be syncrhonized by a clock that is either on the wire itself or is recovered in some manner.&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT size="2"&gt;Interfaces such as RS-232, V.35, RS-449, etc. all had the concept of a master (Data Communincations Equipment (DCE)) and a slave (Data Terminal Equipment (DTE)) where the DTE sent both data and clock and was the master of the clocking speed, and for syncrhonous communications there was an actual clocking signal that transmitted the DCE's clock to the DTE and the DTE then used that clock to receive data from the DCE and also send data back to the DCE based on that clock. That way everybody was in sync.&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT size="2"&gt;For later protocols such as RS-485, they got rid of the clocking signal on the interface and instead required each device use its own interenal clock for transmit and the for receive recover the clock. The Non-Return to Zero Inverted (NRZI) method was chosen as it allowed a receiving device to recover the clock by looking at the bit transitions versus a reference speed on the receiving end. This became the model for almost all layer 1 protocols after that, including Ethernet.&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT size="2"&gt;The key for the 68302 (at least my reading of the user manual) is that it does not have the function internally to do recovered clock by itself (it only supports internal and external, but does not in itself do clock recovery). Here is a key excerpt from the manual:&lt;/FONT&gt;&lt;/P&gt;&lt;FONT size="2"&gt;&lt;I&gt;&lt;/I&gt;&lt;/FONT&gt;&lt;P&gt;&lt;FONT size="2"&gt;&lt;I&gt;&lt;STRONG&gt;ENC—Data Encoding Format&lt;/STRONG&gt;&lt;/I&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT size="2"&gt;&lt;I&gt;&lt;STRONG&gt;0 = Non-return to zero (NRZ). A one is a high level; a zero is a low level.&lt;BR /&gt;1 = Non-return to zero inverted (NRZI). A one is represented by no change in the level;&lt;BR /&gt;a zero is represented by a change in the level. The receiver decodes NRZI, but a&lt;BR /&gt;clock must be supplied. The transmitter encodes NRZI. During an idle condition,&lt;BR /&gt;with the FLG bit cleared, the line will be forced to a high state.&lt;/STRONG&gt;&lt;/I&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT size="2"&gt;The key phrase above is "The receiver decodes NRZI, but a clock must be supplied" meaning that the 68302 doesn't itself support clock recovery, and therefore if the design requires it (such as for 2 wire RS-485) then you need to get the clock from the PHY and use that clock source as an "extenal clock" for receive data.&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT size="2"&gt;So assuming your design supports a PHY that can recover clock and generate a signal out of the PHY and that signal is also then wired to the 68302 SCC input for that port, then what you need to do is set the SCCs up so that they use an internal 19.2 clock for transmit and then use an external clock for receive where that external clock comes from the RS485 PHY. I have never personally worked with RS485 PHYs, but I'm also guessing that they either need to have a reference frequency given to them to assist in the clock recovery, so you may need to look exactly how the PHY does clock recovery and what its requirements are (I would even guess that perhaps the PHY could possibly drive both transmit and receive clocks, in which case you'd set up the SCCs to run external clock for both transmit and receive). Anyway you'll need to look at the manual for the PHY chip and also understand how the clock is controlled and connected between the PHY and the 68302.&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT size="2"&gt;The reason that your test worked when you looped back was that as the transmitter and receiver were truly running of the same clock, everything was synchronous and so it worked whereas when you hooked up two separate systems, the clock only being off by a tiny amount will cause the errors you are seeing.&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT size="2"&gt;Anyway, hopefully this should get you going in the right direction to fix your problem.&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT size="2"&gt;Best regards,&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT size="2"&gt;abartky&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT size="2"&gt;&amp;nbsp;&lt;/FONT&gt;&lt;/P&gt;&lt;/DIV&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 31 Oct 2007 00:49:57 GMT</pubDate>
    <dc:creator>abartky</dc:creator>
    <dc:date>2007-10-31T00:49:57Z</dc:date>
    <item>
      <title>MC68302 / HDLC problem</title>
      <link>https://community.nxp.com/t5/Other-NXP-Products/MC68302-HDLC-problem/m-p/159571#M799</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;DIV&gt;&lt;BR /&gt;We are using a Motorola MC68302 communications processor in slave mode in receive HDLC mode.&lt;BR /&gt;Unless we use the same system clock for both transmit and receive we get many message errors&lt;BR /&gt;in the receive (every 3 to 4 messages gives an rx error; usually Non Octet Aligned Frame&lt;BR /&gt;or Rx Abort Sequence errors.&lt;/DIV&gt;&lt;DIV&gt;It seems we are missing something in the setup (or maybe the hardware) such that the transmit&lt;BR /&gt;and receive are not in sync. We have read the MC68302 user manual from cover to cover but&lt;BR /&gt;cannot see where we are going wrong.&lt;/DIV&gt;&lt;DIV&gt;&lt;BR /&gt;Here is our setup.&lt;BR /&gt;==================&lt;/DIV&gt;&lt;DIV&gt;&lt;BR /&gt;system clock = 19.6608MHz&lt;BR /&gt;Mode HDLC NRZI baud rate&amp;nbsp; = 19200&lt;/DIV&gt;&lt;DIV&gt;&lt;BR /&gt;We are using 68302 processor running on system clock of 19.6608MHz. The channel 1&lt;BR /&gt;(SCC1) is configured as HDLC NRZI receive only and its baud rate is 19200. This is a&lt;BR /&gt;two wire RS485 serial link.&lt;BR /&gt;We than use another set of same hardware and configure the channel 2 (SCC2) as&lt;BR /&gt;HDLC NRZI transmit only which is also is a two wire RS485 serial link. When we connect&lt;BR /&gt;&amp;nbsp;these two hardware together we receive 15-20% Errors which we don't understand why?&lt;/DIV&gt;&lt;DIV&gt;When we use one set of hardware and configure 68302 channel1 as HDLC NRZI Rx, channel 2 as&lt;BR /&gt;HDLC NRZI Tx and loop back channel1 to channel2, we do not see any errors and&lt;BR /&gt;we get 100% successful transmission. bearing in mind that the loop back does include&lt;BR /&gt;RS485 driver circuitry for both channels.&lt;/DIV&gt;&lt;DIV&gt;When we then shared the system&amp;nbsp; clock between the two systems this also does not generates&lt;BR /&gt;any errors and&amp;nbsp; produces 100% successful results.&lt;/DIV&gt;&lt;DIV&gt;All the above tests seems to indicate that there is synchronisation issue&lt;BR /&gt;between two sets of hardware.&lt;BR /&gt;What we don't understand is, if both hardwares are running at same baud rate&lt;BR /&gt;why should there be a sync problem?&lt;BR /&gt;Is 68302 really so intolerant about its baud rate?&lt;/DIV&gt;&lt;DIV&gt;&lt;BR /&gt;Register setup&lt;BR /&gt;==============&lt;BR /&gt;The SCM register setting we are using to configure 68302 as Rx&lt;/DIV&gt;&lt;DIV&gt;NOF3-NOF0&amp;nbsp; = 0000&lt;BR /&gt;C32 = 0&lt;BR /&gt;FSE = 0&lt;BR /&gt;RTE = 0&lt;BR /&gt;FLG = 0 we tried both options for&lt;BR /&gt;idling it does seem to make any different.&lt;BR /&gt;ENC = 1 NRZI&lt;/DIV&gt;&lt;DIV&gt;&lt;BR /&gt;DIAG1 &amp;amp; 0 = 11 Software Control&lt;BR /&gt;ENR,ENT = 01 Rx&lt;BR /&gt;MODE = 00 HDLC&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 30 Oct 2007 20:02:14 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Other-NXP-Products/MC68302-HDLC-problem/m-p/159571#M799</guid>
      <dc:creator>brudd</dc:creator>
      <dc:date>2007-10-30T20:02:14Z</dc:date>
    </item>
    <item>
      <title>Re: MC68302 / HDLC problem</title>
      <link>https://community.nxp.com/t5/Other-NXP-Products/MC68302-HDLC-problem/m-p/159572#M800</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;&lt;/FONT&gt;&lt;P&gt;&lt;FONT size="2"&gt;brudd,&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT size="2"&gt;It's been a long time since I've worked on HDLC, but I believe I can at least describe what is going on and where you can look next in fixing your problem as previously in my career, I worked on HDLC and derivative protocols for many years.&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT size="2"&gt;You wrote:&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT size="2"&gt;&lt;EM&gt;&lt;STRONG&gt;&amp;nbsp; What we don't understand is, if both hardwares are running at same baud rate&lt;BR /&gt;&amp;nbsp; why should there be a sync problem?&lt;/STRONG&gt;&lt;/EM&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT size="2"&gt;&lt;EM&gt;&lt;STRONG&gt;&amp;nbsp; Is 68302 really so intolerant about its baud rate?&lt;BR /&gt;&lt;/STRONG&gt;&lt;/EM&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT size="2"&gt;The main issue with running these older protocols is that they are truly "synchronous" protocols and if you don't get the timing 100% exact, you'll get problems such as aborts, overruns, crc errors etc. These devices and associated level 1 protocols assume the timing must be just about perfect and when the receiver receives data from another devices, it must be syncrhonized by a clock that is either on the wire itself or is recovered in some manner.&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT size="2"&gt;Interfaces such as RS-232, V.35, RS-449, etc. all had the concept of a master (Data Communincations Equipment (DCE)) and a slave (Data Terminal Equipment (DTE)) where the DTE sent both data and clock and was the master of the clocking speed, and for syncrhonous communications there was an actual clocking signal that transmitted the DCE's clock to the DTE and the DTE then used that clock to receive data from the DCE and also send data back to the DCE based on that clock. That way everybody was in sync.&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT size="2"&gt;For later protocols such as RS-485, they got rid of the clocking signal on the interface and instead required each device use its own interenal clock for transmit and the for receive recover the clock. The Non-Return to Zero Inverted (NRZI) method was chosen as it allowed a receiving device to recover the clock by looking at the bit transitions versus a reference speed on the receiving end. This became the model for almost all layer 1 protocols after that, including Ethernet.&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT size="2"&gt;The key for the 68302 (at least my reading of the user manual) is that it does not have the function internally to do recovered clock by itself (it only supports internal and external, but does not in itself do clock recovery). Here is a key excerpt from the manual:&lt;/FONT&gt;&lt;/P&gt;&lt;FONT size="2"&gt;&lt;I&gt;&lt;/I&gt;&lt;/FONT&gt;&lt;P&gt;&lt;FONT size="2"&gt;&lt;I&gt;&lt;STRONG&gt;ENC—Data Encoding Format&lt;/STRONG&gt;&lt;/I&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT size="2"&gt;&lt;I&gt;&lt;STRONG&gt;0 = Non-return to zero (NRZ). A one is a high level; a zero is a low level.&lt;BR /&gt;1 = Non-return to zero inverted (NRZI). A one is represented by no change in the level;&lt;BR /&gt;a zero is represented by a change in the level. The receiver decodes NRZI, but a&lt;BR /&gt;clock must be supplied. The transmitter encodes NRZI. During an idle condition,&lt;BR /&gt;with the FLG bit cleared, the line will be forced to a high state.&lt;/STRONG&gt;&lt;/I&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT size="2"&gt;The key phrase above is "The receiver decodes NRZI, but a clock must be supplied" meaning that the 68302 doesn't itself support clock recovery, and therefore if the design requires it (such as for 2 wire RS-485) then you need to get the clock from the PHY and use that clock source as an "extenal clock" for receive data.&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT size="2"&gt;So assuming your design supports a PHY that can recover clock and generate a signal out of the PHY and that signal is also then wired to the 68302 SCC input for that port, then what you need to do is set the SCCs up so that they use an internal 19.2 clock for transmit and then use an external clock for receive where that external clock comes from the RS485 PHY. I have never personally worked with RS485 PHYs, but I'm also guessing that they either need to have a reference frequency given to them to assist in the clock recovery, so you may need to look exactly how the PHY does clock recovery and what its requirements are (I would even guess that perhaps the PHY could possibly drive both transmit and receive clocks, in which case you'd set up the SCCs to run external clock for both transmit and receive). Anyway you'll need to look at the manual for the PHY chip and also understand how the clock is controlled and connected between the PHY and the 68302.&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT size="2"&gt;The reason that your test worked when you looped back was that as the transmitter and receiver were truly running of the same clock, everything was synchronous and so it worked whereas when you hooked up two separate systems, the clock only being off by a tiny amount will cause the errors you are seeing.&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT size="2"&gt;Anyway, hopefully this should get you going in the right direction to fix your problem.&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT size="2"&gt;Best regards,&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT size="2"&gt;abartky&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT size="2"&gt;&amp;nbsp;&lt;/FONT&gt;&lt;/P&gt;&lt;/DIV&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 31 Oct 2007 00:49:57 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Other-NXP-Products/MC68302-HDLC-problem/m-p/159572#M800</guid>
      <dc:creator>abartky</dc:creator>
      <dc:date>2007-10-31T00:49:57Z</dc:date>
    </item>
    <item>
      <title>Re: MC68302 / HDLC problem</title>
      <link>https://community.nxp.com/t5/Other-NXP-Products/MC68302-HDLC-problem/m-p/159573#M801</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;DIV&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;P&gt;Just caught an error in my previous reply. I had one case where I said "DTE" when I should have said "DCE". Here is the corrected paragraph:&lt;/P&gt;&lt;P&gt;Interfaces such as RS-232, V.35, RS-449, etc. all had the concept of a master (Data Communincations Equipment (DCE)) and a slave (Data Terminal Equipment (DTE)) where the DCE sent both data and clock and was the master of the clocking speed, and for syncrhonous communications there was an actual clocking signal that transmitted the DCE's clock to the DTE and the DTE then used that clock to receive data from the DCE and also send data back to the DCE based on that clock. That way everybody was in sync.&lt;/P&gt;&lt;FONT face="Arial" size="2"&gt;abartky&lt;/FONT&gt;&lt;/DIV&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 31 Oct 2007 00:54:46 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Other-NXP-Products/MC68302-HDLC-problem/m-p/159573#M801</guid>
      <dc:creator>abartky</dc:creator>
      <dc:date>2007-10-31T00:54:46Z</dc:date>
    </item>
  </channel>
</rss>

