<?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 LPUART LIN baudrate deviation issue in S32K</title>
    <link>https://community.nxp.com/t5/S32K/LPUART-LIN-baudrate-deviation-issue/m-p/1426316#M14364</link>
    <description>&lt;P&gt;Hi, I am using LPUART1 as an instance for using s32k sdk LIN STACK with baud rate = 19200bps and Im having the following issue:&lt;BR /&gt;&lt;BR /&gt;The LPUART module seems to have 2 different divisors for the input clock configured for this peripheral:&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="riglesias2021_0-1646930549879.png" style="width: 400px;"&gt;&lt;img src="https://community.nxp.com/t5/image/serverpage/image-id/173094iF8AEB657DCE2F8BB/image-size/medium?v=v2&amp;amp;px=400" role="button" title="riglesias2021_0-1646930549879.png" alt="riglesias2021_0-1646930549879.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;The BAUD divider (sbr), which is just&amp;nbsp;a modulo divide rate, and the OSR divider (osr), which is an oversampling ratio for the baud rate generated.&lt;BR /&gt;&lt;BR /&gt;I´m trying to improve the accuracy of the baud rate generated for the LIN communication, so i´m trying different clock configurations, because reference manual says that FIRC and SIRC clock have different deviation accross temperature:&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="riglesias2021_1-1646930815301.png" style="width: 400px;"&gt;&lt;img src="https://community.nxp.com/t5/image/serverpage/image-id/173096iC2AC54BA9D7CC306/image-size/medium?v=v2&amp;amp;px=400" role="button" title="riglesias2021_1-1646930815301.png" alt="riglesias2021_1-1646930815301.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;Following this image, i was expecting that using FIRC clock with this peripheral, the baud rate accuracy will improve, but my results are showing the following:&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="riglesias2021_2-1646930946379.png" style="width: 400px;"&gt;&lt;img src="https://community.nxp.com/t5/image/serverpage/image-id/173097i7A8531278AB056D7/image-size/medium?v=v2&amp;amp;px=400" role="button" title="riglesias2021_2-1646930946379.png" alt="riglesias2021_2-1646930946379.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;Notes:&lt;/P&gt;&lt;P&gt;(CalculatedBaud = lpuartSourceClock / (osr*sbr)&lt;/P&gt;&lt;P&gt;CANoe error = baud rate deviation reported by CANoe in percentage of 100 (%)&lt;/P&gt;&lt;P&gt;The best accuracy i could achieve, is 0.5% deviation respect LIN master baud rate, using SIRC and 8Mhz for the clock, but in the other configurations with the FIRC, which is suppossed to be more precise, i could only achieve 2% of desviation.&amp;nbsp;&lt;/P&gt;&lt;P&gt;I reviewed the osr and sbr parameters calculated by the NXP lin stack and they seem to be OK, so at this point i dont understand why the baud rate generated is not that good as the obtained with the SIRC...&lt;BR /&gt;&lt;BR /&gt;Hope the explanation is clear enough and thank you for the help &lt;LI-EMOJI id="lia_slightly-smiling-face" title=":slightly_smiling_face:"&gt;&lt;/LI-EMOJI&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Fri, 11 Mar 2022 10:57:29 GMT</pubDate>
    <dc:creator>riglesias2021</dc:creator>
    <dc:date>2022-03-11T10:57:29Z</dc:date>
    <item>
      <title>LPUART LIN baudrate deviation issue</title>
      <link>https://community.nxp.com/t5/S32K/LPUART-LIN-baudrate-deviation-issue/m-p/1426316#M14364</link>
      <description>&lt;P&gt;Hi, I am using LPUART1 as an instance for using s32k sdk LIN STACK with baud rate = 19200bps and Im having the following issue:&lt;BR /&gt;&lt;BR /&gt;The LPUART module seems to have 2 different divisors for the input clock configured for this peripheral:&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="riglesias2021_0-1646930549879.png" style="width: 400px;"&gt;&lt;img src="https://community.nxp.com/t5/image/serverpage/image-id/173094iF8AEB657DCE2F8BB/image-size/medium?v=v2&amp;amp;px=400" role="button" title="riglesias2021_0-1646930549879.png" alt="riglesias2021_0-1646930549879.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;The BAUD divider (sbr), which is just&amp;nbsp;a modulo divide rate, and the OSR divider (osr), which is an oversampling ratio for the baud rate generated.&lt;BR /&gt;&lt;BR /&gt;I´m trying to improve the accuracy of the baud rate generated for the LIN communication, so i´m trying different clock configurations, because reference manual says that FIRC and SIRC clock have different deviation accross temperature:&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="riglesias2021_1-1646930815301.png" style="width: 400px;"&gt;&lt;img src="https://community.nxp.com/t5/image/serverpage/image-id/173096iC2AC54BA9D7CC306/image-size/medium?v=v2&amp;amp;px=400" role="button" title="riglesias2021_1-1646930815301.png" alt="riglesias2021_1-1646930815301.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;Following this image, i was expecting that using FIRC clock with this peripheral, the baud rate accuracy will improve, but my results are showing the following:&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="riglesias2021_2-1646930946379.png" style="width: 400px;"&gt;&lt;img src="https://community.nxp.com/t5/image/serverpage/image-id/173097i7A8531278AB056D7/image-size/medium?v=v2&amp;amp;px=400" role="button" title="riglesias2021_2-1646930946379.png" alt="riglesias2021_2-1646930946379.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;Notes:&lt;/P&gt;&lt;P&gt;(CalculatedBaud = lpuartSourceClock / (osr*sbr)&lt;/P&gt;&lt;P&gt;CANoe error = baud rate deviation reported by CANoe in percentage of 100 (%)&lt;/P&gt;&lt;P&gt;The best accuracy i could achieve, is 0.5% deviation respect LIN master baud rate, using SIRC and 8Mhz for the clock, but in the other configurations with the FIRC, which is suppossed to be more precise, i could only achieve 2% of desviation.&amp;nbsp;&lt;/P&gt;&lt;P&gt;I reviewed the osr and sbr parameters calculated by the NXP lin stack and they seem to be OK, so at this point i dont understand why the baud rate generated is not that good as the obtained with the SIRC...&lt;BR /&gt;&lt;BR /&gt;Hope the explanation is clear enough and thank you for the help &lt;LI-EMOJI id="lia_slightly-smiling-face" title=":slightly_smiling_face:"&gt;&lt;/LI-EMOJI&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 11 Mar 2022 10:57:29 GMT</pubDate>
      <guid>https://community.nxp.com/t5/S32K/LPUART-LIN-baudrate-deviation-issue/m-p/1426316#M14364</guid>
      <dc:creator>riglesias2021</dc:creator>
      <dc:date>2022-03-11T10:57:29Z</dc:date>
    </item>
    <item>
      <title>Re: LPUART LIN baudrate deviation issue</title>
      <link>https://community.nxp.com/t5/S32K/LPUART-LIN-baudrate-deviation-issue/m-p/1426847#M14383</link>
      <description>&lt;P&gt;Hello &lt;a href="https://community.nxp.com/t5/user/viewprofilepage/user-id/182339"&gt;@riglesias2021&lt;/a&gt; ,&lt;/P&gt;
&lt;P&gt;I haven't calculated it yet, however, the equestion that you use is not correct:&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="danielmartynek_0-1646996551001.png" style="width: 400px;"&gt;&lt;img src="https://community.nxp.com/t5/image/serverpage/image-id/173220iEB00F78EF385D2B5/image-size/medium?v=v2&amp;amp;px=400" role="button" title="danielmartynek_0-1646996551001.png" alt="danielmartynek_0-1646996551001.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;Can you double-check?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thanks,&lt;/P&gt;
&lt;P&gt;BR, Daniel&lt;/P&gt;</description>
      <pubDate>Fri, 11 Mar 2022 11:03:29 GMT</pubDate>
      <guid>https://community.nxp.com/t5/S32K/LPUART-LIN-baudrate-deviation-issue/m-p/1426847#M14383</guid>
      <dc:creator>danielmartynek</dc:creator>
      <dc:date>2022-03-11T11:03:29Z</dc:date>
    </item>
    <item>
      <title>Re: LPUART LIN baudrate deviation issue</title>
      <link>https://community.nxp.com/t5/S32K/LPUART-LIN-baudrate-deviation-issue/m-p/1426887#M14389</link>
      <description>&lt;P&gt;Thats the same formula i used, the difference is the NXP Lin stack decrements the OSR before setting it to the LPUART registers, so the result is the same &lt;LI-EMOJI id="lia_slightly-smiling-face" title=":slightly_smiling_face:"&gt;&lt;/LI-EMOJI&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 11 Mar 2022 12:32:27 GMT</pubDate>
      <guid>https://community.nxp.com/t5/S32K/LPUART-LIN-baudrate-deviation-issue/m-p/1426887#M14389</guid>
      <dc:creator>riglesias2021</dc:creator>
      <dc:date>2022-03-11T12:32:27Z</dc:date>
    </item>
    <item>
      <title>Re: LPUART LIN baudrate deviation issue</title>
      <link>https://community.nxp.com/t5/S32K/LPUART-LIN-baudrate-deviation-issue/m-p/1426979#M14393</link>
      <description>&lt;P&gt;Hi &lt;a href="https://community.nxp.com/t5/user/viewprofilepage/user-id/182339"&gt;@riglesias2021&lt;/a&gt;,&lt;/P&gt;
&lt;P&gt;I just tested it with the S32K118 EVB and lpuart_echo_s32k118 (RTM 4.0.2) example.&lt;/P&gt;
&lt;P&gt;Only changes:&lt;/P&gt;
&lt;UL&gt;
&lt;LI&gt;PTC3 as TX&lt;/LI&gt;
&lt;LI&gt;FIRC_DIV2 48MHz LPUART functional clock&lt;/LI&gt;
&lt;LI&gt;SBR 0x64 = 100, OSR = 0x18 = 24&lt;/LI&gt;
&lt;/UL&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="danielmartynek_0-1647012439670.png" style="width: 400px;"&gt;&lt;img src="https://community.nxp.com/t5/image/serverpage/image-id/173241iB3FD65ECC7704D83/image-size/medium?v=v2&amp;amp;px=400" role="button" title="danielmartynek_0-1647012439670.png" alt="danielmartynek_0-1647012439670.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;And the TX signal looks correct:&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="danielmartynek_1-1647012523802.png" style="width: 722px;"&gt;&lt;img src="https://community.nxp.com/t5/image/serverpage/image-id/173243iDFD374B17C7415BE/image-dimensions/722x111?v=v2" width="722" height="111" role="button" title="danielmartynek_1-1647012523802.png" alt="danielmartynek_1-1647012523802.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Can you please scope the following:&lt;/P&gt;
&lt;UL&gt;
&lt;LI&gt;TX signal&lt;/LI&gt;
&lt;LI&gt;LIN signal&lt;/LI&gt;
&lt;LI&gt;FIRCDIV2 at CLKOUT&lt;/LI&gt;
&lt;/UL&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thanks,&lt;/P&gt;
&lt;P&gt;BR, Daniel&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 11 Mar 2022 15:30:08 GMT</pubDate>
      <guid>https://community.nxp.com/t5/S32K/LPUART-LIN-baudrate-deviation-issue/m-p/1426979#M14393</guid>
      <dc:creator>danielmartynek</dc:creator>
      <dc:date>2022-03-11T15:30:08Z</dc:date>
    </item>
    <item>
      <title>Re: LPUART LIN baudrate deviation issue</title>
      <link>https://community.nxp.com/t5/S32K/LPUART-LIN-baudrate-deviation-issue/m-p/1427594#M14415</link>
      <description>&lt;P&gt;Hello, thank you for the reply.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;From my side it seems that the FIRC precission was corrected after enabling the "FIRC Regulator". I cant find too much information about this regulator in the s32k118 reference manual, but it seems that this feature improves the clock deviation so my issue was corrected after enabling this feature.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thank you. &lt;LI-EMOJI id="lia_slightly-smiling-face" title=":slightly_smiling_face:"&gt;&lt;/LI-EMOJI&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 14 Mar 2022 08:34:48 GMT</pubDate>
      <guid>https://community.nxp.com/t5/S32K/LPUART-LIN-baudrate-deviation-issue/m-p/1427594#M14415</guid>
      <dc:creator>riglesias2021</dc:creator>
      <dc:date>2022-03-14T08:34:48Z</dc:date>
    </item>
    <item>
      <title>Re: LPUART LIN baudrate deviation issue</title>
      <link>https://community.nxp.com/t5/S32K/LPUART-LIN-baudrate-deviation-issue/m-p/1427622#M14417</link>
      <description>&lt;P&gt;Hello &lt;a href="https://community.nxp.com/t5/user/viewprofilepage/user-id/182339"&gt;@riglesias2021&lt;/a&gt;,&lt;/P&gt;
&lt;P&gt;Thanks for the updated.&lt;/P&gt;
&lt;P&gt;This seems to be correct.&lt;/P&gt;
&lt;P&gt;Answer from the design team:&lt;/P&gt;
&lt;P&gt;"The FIRCREGOFF bit is used to control an internal regulator used by the FIRC internal circuit. In order to guarantee the operation frequency of the FIRC, the application must make sure to set this bit. Otherwise, FIRC operational frequency may get out of spec."&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Regards,&lt;/P&gt;
&lt;P&gt;Daniel&lt;/P&gt;</description>
      <pubDate>Mon, 14 Mar 2022 09:10:51 GMT</pubDate>
      <guid>https://community.nxp.com/t5/S32K/LPUART-LIN-baudrate-deviation-issue/m-p/1427622#M14417</guid>
      <dc:creator>danielmartynek</dc:creator>
      <dc:date>2022-03-14T09:10:51Z</dc:date>
    </item>
  </channel>
</rss>

