<?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>MPC5xxxのトピックRe: LINFlex Initialization</title>
    <link>https://community.nxp.com/t5/MPC5xxx/LINFlex-Initialization/m-p/618121#M5306</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 have tested attached code on the MPC5604B EVB and I do not see any issue after initialization. Bytes are normally transmitted into PC. On-board transceiver is used. When I used external RS232 to USB cable, then sometimes first few bytes was corrupted.&lt;/P&gt;&lt;P&gt;Could this be a reason? What is your HW and how do you test the case?&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>Tue, 01 Nov 2016 14:33:04 GMT</pubDate>
    <dc:creator>PetrS</dc:creator>
    <dc:date>2016-11-01T14:33:04Z</dc:date>
    <item>
      <title>LINFlex Initialization</title>
      <link>https://community.nxp.com/t5/MPC5xxx/LINFlex-Initialization/m-p/618120#M5305</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi!&lt;/P&gt;&lt;P style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have a strange problem when initializing the LINFlex controller in MPC5602B. It seems like whenever doing this or changing the baudrate &amp;nbsp;setting in the controller it requires a delay before the controller can be used. A small delay of 50 ms seems to be enough.&lt;/P&gt;&lt;P style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Here is the initialization code:&lt;/P&gt;&lt;P style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;void InitUart(const tUartId uartNr, const tBaudRate baud, tBuffer *const rxBuffer, tBuffer *const txBuffer)&lt;BR /&gt;{&lt;BR /&gt; tUartSettings * uart = &amp;amp;uarts[uartNr];&lt;BR /&gt; &lt;BR /&gt; &lt;BR /&gt; // configuration of LINLFEX periphial&lt;BR /&gt; uart-&amp;gt;linflex-&amp;gt;LINCR1.B.SLEEP = 0; // Disable LINFLEX sleep mode&lt;/P&gt;&lt;P&gt;uart-&amp;gt;linflex-&amp;gt;LINCR1.B.INIT = 1; // LINFLEX in init mode&lt;BR /&gt; &lt;BR /&gt; // UART settings&lt;BR /&gt; uart-&amp;gt;linflex-&amp;gt;UARTCR.B.UART = 1; // Run LINFLEX in UART mode&lt;BR /&gt; uart-&amp;gt;linflex-&amp;gt;UARTCR.B.TDFL = 0; // 1byte buffer &lt;BR /&gt; uart-&amp;gt;linflex-&amp;gt;UARTCR.B.RDFL = 0; // 1byte buffer&lt;BR /&gt; uart-&amp;gt;linflex-&amp;gt;UARTCR.B.RXEN = 1; // rx enable&lt;BR /&gt; uart-&amp;gt;linflex-&amp;gt;UARTCR.B.TXEN = 1; // tx enable&lt;BR /&gt; uart-&amp;gt;linflex-&amp;gt;UARTCR.B.PCE = 0; // no Parity&lt;BR /&gt; uart-&amp;gt;linflex-&amp;gt;UARTCR.B.WL = 1; // 8bit data&lt;BR /&gt; &lt;BR /&gt; // Baudrate configuration&lt;BR /&gt; uart-&amp;gt;linflex-&amp;gt;LINIBRR.B.DIV_M = baudMantissa[baud];&lt;BR /&gt; uart-&amp;gt;linflex-&amp;gt;LINFBRR.B.DIV_F = baudFraction[baud];&lt;/P&gt;&lt;P&gt;// Enable interupts&lt;BR /&gt; uart-&amp;gt;linflex-&amp;gt;LINIER.B.DRIE=1;&lt;BR /&gt; uart-&amp;gt;linflex-&amp;gt;LINIER.B.DTIE=1;&lt;BR /&gt; &lt;BR /&gt; // start Linflex&lt;BR /&gt; uart-&amp;gt;linflex-&amp;gt;LINCR1.B.INIT = 0; // LINFLEX in run mode&lt;BR /&gt; &lt;BR /&gt; //TODO: £R1 £F4 Check if I/Os needs to be configured as fast. &lt;BR /&gt; // Configure I/O pins pins&lt;BR /&gt; SIU.PCR[uart-&amp;gt;txPcr].B.OBE = setBit; // Set pin as output&lt;BR /&gt; SIU.PCR[uart-&amp;gt;txPcr].B.PA = uart-&amp;gt;txPadAlterntaiveMode;&lt;/P&gt;&lt;P&gt;SIU.PCR[uart-&amp;gt;rxPcr].B.IBE = setBit; // Set pin as input&lt;BR /&gt; SIU.PCR[uart-&amp;gt;rxPcr].B.WPE = setBit; // Enable weak pulling device&lt;BR /&gt; SIU.PCR[uart-&amp;gt;rxPcr].B.WPS = setBit; // Set to pull up&lt;BR /&gt; &lt;BR /&gt; uart-&amp;gt;txBuffer = rxBuffer;&lt;BR /&gt; uart-&amp;gt;rxBuffer = txBuffer;&lt;/P&gt;&lt;P&gt;// Install interupt handlers&lt;BR /&gt; INTC_InstallINTCInterruptHandler(UartRxIntHandler,uart-&amp;gt;rxInt,8); &lt;BR /&gt; INTC_InstallINTCInterruptHandler(UartTxIntHandler,uart-&amp;gt;txInt,8); &lt;BR /&gt; &lt;BR /&gt; &lt;BR /&gt; uart-&amp;gt;status = idle;&lt;BR /&gt;}&lt;/P&gt;&lt;P style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Here is the routine changing the baudrate.&amp;nbsp;&lt;/P&gt;&lt;P style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;void ChangeBaudRate(const tUartId uartNr, const tBaudRate baud)&lt;BR /&gt;{&lt;BR /&gt; tUartSettings * uart = &amp;amp;uarts[uartNr];&lt;BR /&gt; &lt;BR /&gt; uart-&amp;gt;linflex-&amp;gt;LINCR1.B.INIT = 1; // LINFLEX in init mode&lt;BR /&gt; &lt;BR /&gt; // Baudrate configuration&lt;BR /&gt; uart-&amp;gt;linflex-&amp;gt;LINIBRR.B.DIV_M = baudMantissa[baud];&lt;BR /&gt; uart-&amp;gt;linflex-&amp;gt;LINFBRR.B.DIV_F = baudFraction[baud];&lt;BR /&gt; &lt;BR /&gt; // start Linflex&lt;BR /&gt; uart-&amp;gt;linflex-&amp;gt;LINCR1.B.INIT = 0; // LINFLEX in run mode&lt;BR /&gt; &lt;BR /&gt;}&lt;/P&gt;&lt;P style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;P&gt;Bengt&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 31 Oct 2016 15:15:34 GMT</pubDate>
      <guid>https://community.nxp.com/t5/MPC5xxx/LINFlex-Initialization/m-p/618120#M5305</guid>
      <dc:creator>bengtandersson</dc:creator>
      <dc:date>2016-10-31T15:15:34Z</dc:date>
    </item>
    <item>
      <title>Re: LINFlex Initialization</title>
      <link>https://community.nxp.com/t5/MPC5xxx/LINFlex-Initialization/m-p/618121#M5306</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 have tested attached code on the MPC5604B EVB and I do not see any issue after initialization. Bytes are normally transmitted into PC. On-board transceiver is used. When I used external RS232 to USB cable, then sometimes first few bytes was corrupted.&lt;/P&gt;&lt;P&gt;Could this be a reason? What is your HW and how do you test the case?&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>Tue, 01 Nov 2016 14:33:04 GMT</pubDate>
      <guid>https://community.nxp.com/t5/MPC5xxx/LINFlex-Initialization/m-p/618121#M5306</guid>
      <dc:creator>PetrS</dc:creator>
      <dc:date>2016-11-01T14:33:04Z</dc:date>
    </item>
    <item>
      <title>Re: LINFlex Initialization</title>
      <link>https://community.nxp.com/t5/MPC5xxx/LINFlex-Initialization/m-p/618122#M5307</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;This might be the reason to my problem. Is "few bytes corrupted" really OK?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I'm communicating with an onboard radio module (Digi XBee 868 LP). The "test" is simply when I try to send something to the radio directly after InitUart() this will not work. But when inserting a delay of 50 ms between InitUart() and the first "send" on UART it will work fine. See example from my code below.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #33cccc;"&gt;&amp;nbsp;InitUart(radioUart, baud9600, &amp;amp;radioRxBuffer, &amp;amp;radioTxBuffer);&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="color: #33cccc;"&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="color: #33cccc;"&gt;&amp;nbsp;// A small delay here seems to be necessary&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="color: #33cccc;"&gt;&amp;nbsp;DelayMs(delayAfterBaudRateChange);&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="color: #33cccc;"&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="color: #33cccc;"&gt;&amp;nbsp;// The radio should now be ready to communicate at speed 9600 Baud so a change to API mode is made&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="color: #33cccc;"&gt;&amp;nbsp;ChangeFromTransparentToApiMode();&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Best Regards&lt;/P&gt;&lt;P&gt;Bengt&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 03 Nov 2016 09:26:37 GMT</pubDate>
      <guid>https://community.nxp.com/t5/MPC5xxx/LINFlex-Initialization/m-p/618122#M5307</guid>
      <dc:creator>bengtandersson</dc:creator>
      <dc:date>2016-11-03T09:26:37Z</dc:date>
    </item>
  </channel>
</rss>

