<?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: LPUART RX getting TX values. in S32K</title>
    <link>https://community.nxp.com/t5/S32K/LPUART-RX-getting-TX-values/m-p/1060304#M7110</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello Jose,&lt;/P&gt;&lt;P&gt;Do you monitor the bus with a logic analyzer?&lt;/P&gt;&lt;P&gt;Is there a difference between the RX signal on the bus and the RX data from the DATA register?&amp;nbsp;&lt;/P&gt;&lt;P&gt;The DATA register cannot return TX data, unless there is a HW issue or the LPUART module is in this LOOP mode:&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="pastedImage_1.png"&gt;&lt;img src="https://community.nxp.com/t5/image/serverpage/image-id/112228iC16278BA4A34270E/image-size/large?v=v2&amp;amp;px=999" role="button" title="pastedImage_1.png" alt="pastedImage_1.png" /&gt;&lt;/span&gt;&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;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Mon, 08 Jun 2020 14:45:11 GMT</pubDate>
    <dc:creator>danielmartynek</dc:creator>
    <dc:date>2020-06-08T14:45:11Z</dc:date>
    <item>
      <title>LPUART RX getting TX values.</title>
      <link>https://community.nxp.com/t5/S32K/LPUART-RX-getting-TX-values/m-p/1060301#M7107</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 the following issue with the UART driver from the S32DS platform:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I'm working on an application in which my S32K116 is the master in an UART communication with an LMM (TPS92662A, for your reference). To write messages, I just follow the LMM-specific UART commands and can succesfully control it. On the other hand, when asking the LMM which is its current status (SC,OC, OT...), I need to send a message through UART and right away listen to the LMM response which carries its status.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;When&amp;nbsp;I&amp;nbsp;send &lt;STRONG&gt;or&lt;/STRONG&gt; receive a UART message, &lt;STRONG&gt;the&lt;/STRONG&gt; &lt;STRONG&gt;same&lt;/STRONG&gt; IRQ is triggered. This IRQ checks for receive data full interrupt or transmit buffer empty. &lt;STRONG&gt;Both&lt;/STRONG&gt; cases are checked and they &lt;STRONG&gt;both&lt;/STRONG&gt; access to the LPUART register called DATA.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;When I call the function to receive data, that function does two things: sets the buffer I send to it as the receive buffer and enables the &lt;STRONG&gt;receive data full&lt;/STRONG&gt; interrupt. If this interrupt is not activated, we will not receive any message. &amp;nbsp;See image below:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="UARTISSUE1.png"&gt;&lt;img src="https://community.nxp.com/t5/image/serverpage/image-id/112022iA8372B51D8308732/image-size/large?v=v2&amp;amp;px=999" role="button" title="UARTISSUE1.png" alt="UARTISSUE1.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;On the image, arrow points to the part where my buffer is set as the receive buffer and underlined instruction is where the interrupt receive data full is enabled. Same process is applied to the send message function.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="UARTISSUE2.png"&gt;&lt;img src="https://community.nxp.com/t5/image/serverpage/image-id/112023i8DEC862EA6D761B3/image-size/large?v=v2&amp;amp;px=999" role="button" title="UARTISSUE2.png" alt="UARTISSUE2.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If the receive &lt;STRONG&gt;OR&lt;/STRONG&gt; the send interrupt is triggered, both go to the same IRQ. This IRQ does the following:&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;&amp;nbsp;If the receive data full interrupt is enabled, we get the value from the sub-register DATA of the register LPUART and put it into our receive buffer.&lt;/LI&gt;&lt;LI&gt;If the send data empty interrupt is enabled, we put the values from the send buffer to the sub-register DATA of the LPUART register.&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Since these cases are not exclusive, if we need communication where we are the masters and our slave responds to our commands, there is a high chance of us &lt;STRONG&gt;getting the values that we are sending into our receive buffer&lt;/STRONG&gt;, since we need to listen to the information our slave is going to send to us &lt;STRONG&gt;right after we send our message.&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="UARTISSUE3.png"&gt;&lt;img src="https://community.nxp.com/t5/image/serverpage/image-id/112024iB0DAC2045495A3C4/image-size/large?v=v2&amp;amp;px=999" role="button" title="UARTISSUE3.png" alt="UARTISSUE3.png" /&gt;&lt;/span&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="UARTISSUE4.png"&gt;&lt;img src="https://community.nxp.com/t5/image/serverpage/image-id/112025iC90F7D27A7B8963C/image-size/large?v=v2&amp;amp;px=999" role="button" title="UARTISSUE4.png" alt="UARTISSUE4.png" /&gt;&lt;/span&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I divided the above function into two screenshots to avoid having a font size too small to read. These if-statements are both in the same IRQ. And we are having the problem I just described:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The data we are sending is being picked up by our receive buffer, making it nearly impossible to know where is the data I need from my slave. As I said&amp;nbsp;before, both access the same &lt;STRONG&gt;DATA&lt;/STRONG&gt; sub-register of the &lt;STRONG&gt;LPUART&lt;/STRONG&gt; register.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="UARTISSUE5.png"&gt;&lt;img src="https://community.nxp.com/t5/image/serverpage/image-id/112026i6D9A93F52ADA38D9/image-size/large?v=v2&amp;amp;px=999" role="button" title="UARTISSUE5.png" alt="UARTISSUE5.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;The screenshot above was directly taken from the S32K reference manual.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="UARTISSUE6.png"&gt;&lt;img src="https://community.nxp.com/t5/image/serverpage/image-id/112027i25F4B7310E7E39FD/image-size/large?v=v2&amp;amp;px=999" role="button" title="UARTISSUE6.png" alt="UARTISSUE6.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="UARTISSUE7.png"&gt;&lt;img src="https://community.nxp.com/t5/image/serverpage/image-id/112028i47DE1E10BF0F990D/image-size/large?v=v2&amp;amp;px=999" role="button" title="UARTISSUE7.png" alt="UARTISSUE7.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;As it can be seen&amp;nbsp;on the images above, &lt;STRONG&gt;RX and TX&lt;/STRONG&gt; access the same register. So, my question is:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Am I&amp;nbsp;missing something to avoid this from happening?&amp;nbsp;Is there a way to avoid/stop the receive buffer from picking up data that is being &lt;STRONG&gt;sent and not received&lt;/STRONG&gt;?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thank you beforehand for your assistance and sorry for the long&amp;nbsp;post.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 05 Jun 2020 01:39:19 GMT</pubDate>
      <guid>https://community.nxp.com/t5/S32K/LPUART-RX-getting-TX-values/m-p/1060301#M7107</guid>
      <dc:creator>joseponc</dc:creator>
      <dc:date>2020-06-05T01:39:19Z</dc:date>
    </item>
    <item>
      <title>Re: LPUART RX getting TX values.</title>
      <link>https://community.nxp.com/t5/S32K/LPUART-RX-getting-TX-values/m-p/1060302#M7108</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Jose,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The LPUART_DATA register consists of two registers.&lt;/P&gt;&lt;P&gt;The RX register is a read-only register and the TX register is a write-only register.&lt;/P&gt;&lt;P&gt;A read from this DATA register cannot return the TX data but always the RX data.&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="pastedImage_1.png"&gt;&lt;img src="https://community.nxp.com/t5/image/serverpage/image-id/112197iCB1FFEE81012FB61/image-size/large?v=v2&amp;amp;px=999" role="button" title="pastedImage_1.png" alt="pastedImage_1.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Daniel&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 08 Jun 2020 07:50:59 GMT</pubDate>
      <guid>https://community.nxp.com/t5/S32K/LPUART-RX-getting-TX-values/m-p/1060302#M7108</guid>
      <dc:creator>danielmartynek</dc:creator>
      <dc:date>2020-06-08T07:50:59Z</dc:date>
    </item>
    <item>
      <title>Re: LPUART RX getting TX values.</title>
      <link>https://community.nxp.com/t5/S32K/LPUART-RX-getting-TX-values/m-p/1060303#M7109</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello Daniel, thanks for your response.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I also got to read that part of the reference manual, but I didn't quite understand what made the difference between the RX and the TX buffer, since software seems to be accessing the same address for both, LPUART0 base address -&amp;gt; DATA.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;How does the software make a difference between both buffers, since&amp;nbsp;it is accessing the same address for TX and RX and our software is showing&amp;nbsp;TX&amp;nbsp;data in our&amp;nbsp;RX buffer?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks and regards&lt;/P&gt;&lt;P&gt;Jose.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 08 Jun 2020 14:23:36 GMT</pubDate>
      <guid>https://community.nxp.com/t5/S32K/LPUART-RX-getting-TX-values/m-p/1060303#M7109</guid>
      <dc:creator>joseponc</dc:creator>
      <dc:date>2020-06-08T14:23:36Z</dc:date>
    </item>
    <item>
      <title>Re: LPUART RX getting TX values.</title>
      <link>https://community.nxp.com/t5/S32K/LPUART-RX-getting-TX-values/m-p/1060304#M7110</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello Jose,&lt;/P&gt;&lt;P&gt;Do you monitor the bus with a logic analyzer?&lt;/P&gt;&lt;P&gt;Is there a difference between the RX signal on the bus and the RX data from the DATA register?&amp;nbsp;&lt;/P&gt;&lt;P&gt;The DATA register cannot return TX data, unless there is a HW issue or the LPUART module is in this LOOP mode:&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="pastedImage_1.png"&gt;&lt;img src="https://community.nxp.com/t5/image/serverpage/image-id/112228iC16278BA4A34270E/image-size/large?v=v2&amp;amp;px=999" role="button" title="pastedImage_1.png" alt="pastedImage_1.png" /&gt;&lt;/span&gt;&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;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 08 Jun 2020 14:45:11 GMT</pubDate>
      <guid>https://community.nxp.com/t5/S32K/LPUART-RX-getting-TX-values/m-p/1060304#M7110</guid>
      <dc:creator>danielmartynek</dc:creator>
      <dc:date>2020-06-08T14:45:11Z</dc:date>
    </item>
    <item>
      <title>Re: LPUART RX getting TX values.</title>
      <link>https://community.nxp.com/t5/S32K/LPUART-RX-getting-TX-values/m-p/1060305#M7111</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Daniel, thank you for your response.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I checked with a logic analyzer the status of my communication, and I got the following result:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="UART_TX_RX.PNG"&gt;&lt;img src="https://community.nxp.com/t5/image/serverpage/image-id/112390i86B3D4884BBF10DA/image-size/large?v=v2&amp;amp;px=999" role="button" title="UART_TX_RX.PNG" alt="UART_TX_RX.PNG" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;My setup uses the CAN transceiver&amp;nbsp;TJA1057GTK, which I believe is also from NXP.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;As you can see on the screenshot, TX pin shows TX data and RX pin shows TX+RX data. Is there a way to configure the UART driver or the CAN Transceiver (in case it is indeed from NXP and you know how to do it) so that my reception ignores TX data?&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;It could be easily filtered if it was behaving as good as the screenshot shows. My software is getting mixed data, sometimes it shows the communication frames as good as the logic analyzer did and some other times I get weird data mixes.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 09 Jun 2020 19:41:03 GMT</pubDate>
      <guid>https://community.nxp.com/t5/S32K/LPUART-RX-getting-TX-values/m-p/1060305#M7111</guid>
      <dc:creator>joseponc</dc:creator>
      <dc:date>2020-06-09T19:41:03Z</dc:date>
    </item>
    <item>
      <title>Re: LPUART RX getting TX values.</title>
      <link>https://community.nxp.com/t5/S32K/LPUART-RX-getting-TX-values/m-p/1060306#M7112</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Jose,&lt;/P&gt;&lt;P&gt;The&amp;nbsp;&lt;SPAN style="color: #51626f; background-color: #ffffff;"&gt;TJA1057GTK&amp;nbsp;&lt;SPAN&gt;CAN transceiver simply&amp;nbsp;translates the CAN_H/L signal (including everything the TJA1057 is transmitting) to RXD - t&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;SPAN style="color: #51626f; background-color: #ffffff;"&gt;&lt;SPAN&gt;his can't be disabled.&amp;nbsp;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Could you elaborate on the last sentence?&lt;/P&gt;&lt;P&gt;Do you mean the LPUART RX FIFO reads different data than the logic analyzer shows?&lt;/P&gt;&lt;P&gt;Or the does the logic analyzer show wrong RXD signal? If so, please measure the differential CANH/L signal as well.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;BR, Daniel&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="pastedImage_1.png"&gt;&lt;img src="https://community.nxp.com/t5/image/serverpage/image-id/112456iA4643618296A50A2/image-size/large?v=v2&amp;amp;px=999" role="button" title="pastedImage_1.png" alt="pastedImage_1.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 10 Jun 2020 11:12:17 GMT</pubDate>
      <guid>https://community.nxp.com/t5/S32K/LPUART-RX-getting-TX-values/m-p/1060306#M7112</guid>
      <dc:creator>danielmartynek</dc:creator>
      <dc:date>2020-06-10T11:12:17Z</dc:date>
    </item>
    <item>
      <title>Re: LPUART RX getting TX values.</title>
      <link>https://community.nxp.com/t5/S32K/LPUART-RX-getting-TX-values/m-p/1060307#M7113</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello Daniel, thank you for your response.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;What I wanted to say is: My application is, as you see, physically receiving TX+RX, which could be easily filtered if we were reading those values as the logic analyzer shows, but that's not the case. My RX is the one that is not reading correctly.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;After some testing, we found out that our RX buffer wasn't behaving as it should (reading the exact same values that reach physically the RX pin, shown in the logic analyzer screenshot) because of our baud rate. We are working on an application&amp;nbsp;in which we need to have a baud rate of 500 Kbps, which gives a byte time of 16us.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Since the UART driver works triggering an interruption each time we receive a byte, it is being triggered way too fast and frequent when we receive an UART message. That's why I wanted to disable this transceiver echo.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I want to try using the FIFO, but it might also get overrun since it can only hold 4 data words.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;To use the FIFO, do I only change the FIFO and the RXWATER and that's it? Same receive process?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Another thing that might be even better is to use the DMA, which can be faster and hold as many bytes as we want it to receive, right? Is this correct?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks again for your help.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards, Jose.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 10 Jun 2020 13:35:01 GMT</pubDate>
      <guid>https://community.nxp.com/t5/S32K/LPUART-RX-getting-TX-values/m-p/1060307#M7113</guid>
      <dc:creator>joseponc</dc:creator>
      <dc:date>2020-06-10T13:35:01Z</dc:date>
    </item>
    <item>
      <title>Re: LPUART RX getting TX values.</title>
      <link>https://community.nxp.com/t5/S32K/LPUART-RX-getting-TX-values/m-p/1060308#M7114</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello Jose,&lt;/P&gt;&lt;P&gt;Please read the error flags in the LPUART_STAT register (OR, NF, FE, PF).&lt;/P&gt;&lt;P&gt;If there is no error reported, the data must&amp;nbsp;be correct.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regarding FIFO/DMA,&amp;nbsp;I don't think there is a simple answer.&lt;/P&gt;&lt;P&gt;If RXWATER is high, the FIFO can overflow anyway.&lt;/P&gt;&lt;P&gt;But with DMA, I would use&amp;nbsp;&lt;SPAN&gt;RXWATER&amp;nbsp;= 0 and transfer it by single bytes.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;BR, Daniel&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 11 Jun 2020 11:29:35 GMT</pubDate>
      <guid>https://community.nxp.com/t5/S32K/LPUART-RX-getting-TX-values/m-p/1060308#M7114</guid>
      <dc:creator>danielmartynek</dc:creator>
      <dc:date>2020-06-11T11:29:35Z</dc:date>
    </item>
  </channel>
</rss>

