<?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 MPC5746C LIN Master Slave in MPC5xxx</title>
    <link>https://community.nxp.com/t5/MPC5xxx/MPC5746C-LIN-Master-Slave/m-p/879960#M12950</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I am having an issue setting up the LIN Master Slave.&lt;/P&gt;&lt;P&gt;It seems that I am not the only one having issues.&amp;nbsp;&lt;A href="https://community.nxp.com/thread/454713"&gt;LINflexd transmission issue&lt;/A&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I tried following the example Martin Kovar suggested in this post&amp;nbsp;&lt;A href="https://community.nxp.com/thread/387671"&gt;Problem with LINFlexD LIN frame transmit&lt;/A&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I tried both LINFlexD_0 and LINFlexD_1.&lt;/P&gt;&lt;P&gt;It's still not working and don't know what else to try.&lt;/P&gt;&lt;P&gt;It gets stuck at&amp;nbsp;&lt;SPAN&gt;while(0 == LINFlexD_0.LINSR.B.DTF)&amp;nbsp;with LINFlexD_0.LINESR.B.BEF = 1&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;Hopefully somebody knows whats going on.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;The rest is code. It's practically identical to the example.&amp;nbsp;&lt;A href="https://community.nxp.com/docs/DOC-339878"&gt;https://community.nxp.com/docs/DOC-339878&lt;/A&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;// Pin initialization is pretty standard. LINFlexD_0&amp;nbsp;works in&amp;nbsp;UART&amp;nbsp;and DMA mode, so I know the pins are correct.&lt;/P&gt;&lt;P&gt;// I'm not terribly sure about Pull-ups or Drain, but I don't think they matter at this point.&lt;/P&gt;&lt;P&gt;void LIN_lin0_pins_config(void)&lt;BR /&gt;{&lt;BR /&gt; SIUL2.MSCR[PB2].R = 0; // Initialize Register&lt;BR /&gt; SIUL2.MSCR[PB2].B.PUS = 1; // Pullup Selected&lt;BR /&gt; SIUL2.MSCR[PB2].B.PUE = 1; // Pullup Enable&lt;/P&gt;&lt;P&gt;SIUL2.MSCR[PB2].B.SSS = 1; // Source signal is LIN0_TX&lt;BR /&gt; SIUL2.MSCR[PB2].B.OBE = 1; // Output Buffer Enabled&lt;BR /&gt; SIUL2.MSCR[PB2].B.ODE = 1; // Output Drain Enabled&lt;BR /&gt; SIUL2.MSCR[PB2].B.SRC = 3; // Full strength slew rate&lt;/P&gt;&lt;P&gt;SIUL2.MSCR[PB3].B.IBE = 1; // Input Buffer Enabled&lt;BR /&gt; SIUL2.IMCR[712-512].B.SSS = 2; // Source signal is LIN0_RX&lt;BR /&gt;}&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;//The initialization of LINFlexD_0 for LIN mode seems pretty easy. (Not showing baud rate)&lt;/P&gt;&lt;P&gt;LINFlexD_0.LINCR2.R = 0x0;&lt;BR /&gt; LINFlexD_0.LINTCSR.R = 0x0; // LIN timeout mode, no idle on timeout&lt;BR /&gt; LINFlexD_0.LINCR2.B.IOBE = 1; // IOBE Enabled&lt;BR /&gt; LINFlexD_0.LINCR1.B.MBL = 0x3; // 13-bit LIN Master break length&lt;BR /&gt; LINFlexD_0.LINCR1.B.BF = 1; // An RX interrupt is generated on identifier not matching any filter&lt;BR /&gt; LINFlexD_0.LINCR1.B.MME = 1; // Master Mode Enabled&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;// This is pretty much the same as in the example.&lt;/P&gt;&lt;P&gt;void LIN_0_xmt_frame(const unsigned short _bidr_value)&lt;BR /&gt;{&lt;/P&gt;&lt;P&gt;// Store the data in the message buffer BDR&lt;BR /&gt; LINFlexD_0.BDRL.B.DATA0 = 'H';&lt;BR /&gt; LINFlexD_0.BDRL.B.DATA1 = 'e';&lt;BR /&gt; LINFlexD_0.BDRL.B.DATA2 = 'l';&lt;BR /&gt; LINFlexD_0.BDRL.B.DATA3 = 'l';&lt;/P&gt;&lt;P&gt;LINFlexD_0.BDRM.B.DATA4 = 'o';&lt;BR /&gt; LINFlexD_0.BDRM.B.DATA5 = '!';&lt;BR /&gt; LINFlexD_0.BDRM.B.DATA6 = '!';&lt;BR /&gt; LINFlexD_0.BDRM.B.DATA7 = '!';&lt;/P&gt;&lt;P&gt;// Set BIDR Register&lt;BR /&gt; LINFlexD_0.BIDR.R = 0; // Reset the Register&lt;BR /&gt; LINFlexD_0.BIDR.B.ID = 0x35; // The ID&lt;BR /&gt; LINFlexD_0.BIDR.B.CCS = 0; // (0: Enhance. Cover data and Identifier.)( 1: Classic. Only covers data. )&lt;BR /&gt; LINFlexD_0.BIDR.B.DIR = 1; // (0: Receive)(1: Transmit)&lt;BR /&gt; LINFlexD_0.BIDR.B.DFL = 0x7; // Number of data bytes - 1&lt;/P&gt;&lt;P&gt;// Trigger Frame transmission&lt;BR /&gt; LINFlexD_0.LINCR2.B.HTRQ = 1;&lt;/P&gt;&lt;P&gt;// wait until Master response to the LIN header has been sent successfully&lt;BR /&gt; while(0 == LINFlexD_0.LINSR.B.DTF)&lt;BR /&gt; {&lt;BR /&gt; ; //Do nothing&lt;BR /&gt; }&lt;/P&gt;&lt;P&gt;LINFlexD_0.LINSR.B.DTF = 1; // clear the DTF bit&lt;/P&gt;&lt;P&gt;}&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 04 Apr 2019 20:06:26 GMT</pubDate>
    <dc:creator>cholland</dc:creator>
    <dc:date>2019-04-04T20:06:26Z</dc:date>
    <item>
      <title>MPC5746C LIN Master Slave</title>
      <link>https://community.nxp.com/t5/MPC5xxx/MPC5746C-LIN-Master-Slave/m-p/879960#M12950</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I am having an issue setting up the LIN Master Slave.&lt;/P&gt;&lt;P&gt;It seems that I am not the only one having issues.&amp;nbsp;&lt;A href="https://community.nxp.com/thread/454713"&gt;LINflexd transmission issue&lt;/A&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I tried following the example Martin Kovar suggested in this post&amp;nbsp;&lt;A href="https://community.nxp.com/thread/387671"&gt;Problem with LINFlexD LIN frame transmit&lt;/A&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I tried both LINFlexD_0 and LINFlexD_1.&lt;/P&gt;&lt;P&gt;It's still not working and don't know what else to try.&lt;/P&gt;&lt;P&gt;It gets stuck at&amp;nbsp;&lt;SPAN&gt;while(0 == LINFlexD_0.LINSR.B.DTF)&amp;nbsp;with LINFlexD_0.LINESR.B.BEF = 1&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;Hopefully somebody knows whats going on.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;The rest is code. It's practically identical to the example.&amp;nbsp;&lt;A href="https://community.nxp.com/docs/DOC-339878"&gt;https://community.nxp.com/docs/DOC-339878&lt;/A&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;// Pin initialization is pretty standard. LINFlexD_0&amp;nbsp;works in&amp;nbsp;UART&amp;nbsp;and DMA mode, so I know the pins are correct.&lt;/P&gt;&lt;P&gt;// I'm not terribly sure about Pull-ups or Drain, but I don't think they matter at this point.&lt;/P&gt;&lt;P&gt;void LIN_lin0_pins_config(void)&lt;BR /&gt;{&lt;BR /&gt; SIUL2.MSCR[PB2].R = 0; // Initialize Register&lt;BR /&gt; SIUL2.MSCR[PB2].B.PUS = 1; // Pullup Selected&lt;BR /&gt; SIUL2.MSCR[PB2].B.PUE = 1; // Pullup Enable&lt;/P&gt;&lt;P&gt;SIUL2.MSCR[PB2].B.SSS = 1; // Source signal is LIN0_TX&lt;BR /&gt; SIUL2.MSCR[PB2].B.OBE = 1; // Output Buffer Enabled&lt;BR /&gt; SIUL2.MSCR[PB2].B.ODE = 1; // Output Drain Enabled&lt;BR /&gt; SIUL2.MSCR[PB2].B.SRC = 3; // Full strength slew rate&lt;/P&gt;&lt;P&gt;SIUL2.MSCR[PB3].B.IBE = 1; // Input Buffer Enabled&lt;BR /&gt; SIUL2.IMCR[712-512].B.SSS = 2; // Source signal is LIN0_RX&lt;BR /&gt;}&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;//The initialization of LINFlexD_0 for LIN mode seems pretty easy. (Not showing baud rate)&lt;/P&gt;&lt;P&gt;LINFlexD_0.LINCR2.R = 0x0;&lt;BR /&gt; LINFlexD_0.LINTCSR.R = 0x0; // LIN timeout mode, no idle on timeout&lt;BR /&gt; LINFlexD_0.LINCR2.B.IOBE = 1; // IOBE Enabled&lt;BR /&gt; LINFlexD_0.LINCR1.B.MBL = 0x3; // 13-bit LIN Master break length&lt;BR /&gt; LINFlexD_0.LINCR1.B.BF = 1; // An RX interrupt is generated on identifier not matching any filter&lt;BR /&gt; LINFlexD_0.LINCR1.B.MME = 1; // Master Mode Enabled&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;// This is pretty much the same as in the example.&lt;/P&gt;&lt;P&gt;void LIN_0_xmt_frame(const unsigned short _bidr_value)&lt;BR /&gt;{&lt;/P&gt;&lt;P&gt;// Store the data in the message buffer BDR&lt;BR /&gt; LINFlexD_0.BDRL.B.DATA0 = 'H';&lt;BR /&gt; LINFlexD_0.BDRL.B.DATA1 = 'e';&lt;BR /&gt; LINFlexD_0.BDRL.B.DATA2 = 'l';&lt;BR /&gt; LINFlexD_0.BDRL.B.DATA3 = 'l';&lt;/P&gt;&lt;P&gt;LINFlexD_0.BDRM.B.DATA4 = 'o';&lt;BR /&gt; LINFlexD_0.BDRM.B.DATA5 = '!';&lt;BR /&gt; LINFlexD_0.BDRM.B.DATA6 = '!';&lt;BR /&gt; LINFlexD_0.BDRM.B.DATA7 = '!';&lt;/P&gt;&lt;P&gt;// Set BIDR Register&lt;BR /&gt; LINFlexD_0.BIDR.R = 0; // Reset the Register&lt;BR /&gt; LINFlexD_0.BIDR.B.ID = 0x35; // The ID&lt;BR /&gt; LINFlexD_0.BIDR.B.CCS = 0; // (0: Enhance. Cover data and Identifier.)( 1: Classic. Only covers data. )&lt;BR /&gt; LINFlexD_0.BIDR.B.DIR = 1; // (0: Receive)(1: Transmit)&lt;BR /&gt; LINFlexD_0.BIDR.B.DFL = 0x7; // Number of data bytes - 1&lt;/P&gt;&lt;P&gt;// Trigger Frame transmission&lt;BR /&gt; LINFlexD_0.LINCR2.B.HTRQ = 1;&lt;/P&gt;&lt;P&gt;// wait until Master response to the LIN header has been sent successfully&lt;BR /&gt; while(0 == LINFlexD_0.LINSR.B.DTF)&lt;BR /&gt; {&lt;BR /&gt; ; //Do nothing&lt;BR /&gt; }&lt;/P&gt;&lt;P&gt;LINFlexD_0.LINSR.B.DTF = 1; // clear the DTF bit&lt;/P&gt;&lt;P&gt;}&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 04 Apr 2019 20:06:26 GMT</pubDate>
      <guid>https://community.nxp.com/t5/MPC5xxx/MPC5746C-LIN-Master-Slave/m-p/879960#M12950</guid>
      <dc:creator>cholland</dc:creator>
      <dc:date>2019-04-04T20:06:26Z</dc:date>
    </item>
    <item>
      <title>Re: MPC5746C LIN Master Slave</title>
      <link>https://community.nxp.com/t5/MPC5xxx/MPC5746C-LIN-Master-Slave/m-p/879961#M12951</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;have you checked the&amp;nbsp;&lt;A _jive_internal="true" href="https://community.nxp.com/docs/DOC-341822"&gt;https://community.nxp.com/docs/DOC-341822&lt;/A&gt;&amp;nbsp;too?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The code looks normal, sets LINFlex0 to LIN master mode and transmit frame. Open drain with weak pull up on TX line is not needed, but it should work too.&lt;/P&gt;&lt;P&gt;There could be issue with transceiver. Is it properly powered? On the EVB it is powered from the bus. Do you use EVB too?&amp;nbsp;&lt;/P&gt;&lt;P&gt;To test master transmit you can simply connect TX/RX pin together without transceiver, to know pins are properly set.&lt;/P&gt;&lt;P&gt;You should see full frame on this loopback connection.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;BR, Petr&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 05 Apr 2019 04:37:21 GMT</pubDate>
      <guid>https://community.nxp.com/t5/MPC5xxx/MPC5746C-LIN-Master-Slave/m-p/879961#M12951</guid>
      <dc:creator>PetrS</dc:creator>
      <dc:date>2019-04-05T04:37:21Z</dc:date>
    </item>
    <item>
      <title>Re: MPC5746C LIN Master Slave</title>
      <link>https://community.nxp.com/t5/MPC5xxx/MPC5746C-LIN-Master-Slave/m-p/879962#M12952</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I haven't had time to come back to this issue. When I do, I will let you know what happened. Thanks&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 03 May 2019 17:11:38 GMT</pubDate>
      <guid>https://community.nxp.com/t5/MPC5xxx/MPC5746C-LIN-Master-Slave/m-p/879962#M12952</guid>
      <dc:creator>cholland</dc:creator>
      <dc:date>2019-05-03T17:11:38Z</dc:date>
    </item>
  </channel>
</rss>

