<?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: UART Byte receive Problem. in S32K</title>
    <link>https://community.nxp.com/t5/S32K/UART-Byte-receive-Problem/m-p/1075216#M7498</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Why do not you use the code from example if it is working for you?&lt;/P&gt;&lt;P&gt;I have changed the baudrate to 19200 and select &lt;SPAN&gt;SOSCDIV2_CLK&amp;nbsp;&lt;/SPAN&gt;in the example and it is working well. (attached)&lt;/P&gt;&lt;P&gt;I'm not sure which clock you are using because this code select the FIRCDIV2_CLK, but your comment says&amp;nbsp;SOSCDIV2_CLK&lt;/P&gt;&lt;P&gt;P&lt;SPAN style="color: #51626f; background-color: #ffffff;"&gt;CC-&amp;gt;PCCn[PCC_LPUART0_INDEX] |= PCC_PCCn_PCS(0b011)&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Could you try it? But I'm using PTC6 and PTC7.&lt;/P&gt;&lt;P&gt;Also, have you checked LPUART-&amp;gt; STAT register?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Note: the example code is created in the S32 Design Studio for ARM ver 2.2&amp;nbsp;&lt;/P&gt;&lt;P&gt;Best regards,&lt;/P&gt;&lt;P&gt;Diana&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 28 May 2020 07:15:14 GMT</pubDate>
    <dc:creator>dianabatrlova</dc:creator>
    <dc:date>2020-05-28T07:15:14Z</dc:date>
    <item>
      <title>UART Byte receive Problem.</title>
      <link>https://community.nxp.com/t5/S32K/UART-Byte-receive-Problem/m-p/1075215#M7497</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I have a problem with UART Receiving byte.&lt;/P&gt;&lt;P&gt;First, I have run UART example program on S32K142EVB. It is working with no problem. Both receive and transmit demo is working as it should be.&lt;/P&gt;&lt;P&gt;Then I write code for the real application board. I am not using interrupt or DMA, just simple pooling method. Baud rate is 19200. The&amp;nbsp;&lt;SPAN&gt;PutChar function is working well (MCU to PC data send, captured in PuTTY or RealTerm). But GetChar function is not working (PC to MCU). I have checked first invoke to the function is working properly, but then it stuck&amp;nbsp;at&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;&amp;gt;&amp;gt; while((pUART-&amp;gt;STAT &amp;amp; LPUART_STAT_RDRF_MASK)&amp;gt;&amp;gt;LPUART_STAT_RDRF_SHIFT==0)&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Any idea please?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The code is as follow:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;void UART_pin_settings(void)&lt;/P&gt;&lt;P&gt;{&lt;BR /&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;PCC-&amp;gt;PCCn[PCC_PORTC_INDEX ]|=PCC_PCCn_CGC_MASK; /* Enable clock for PORTC */&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;/* enable the UART port for the UART of S32K142 */&lt;BR /&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;PORTC-&amp;gt;PCR[3]|=PORT_PCR_MUX(4); /* Port C3: MUX = ALT4, UART0 TX */&lt;BR /&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;PORTC-&amp;gt;PCR[2]|=PORT_PCR_MUX(4); /* Port C2: MUX = ALT4, UART0 RX */&lt;BR /&gt;}&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;void UART_Init(LPUART_Type *pUART, uint32_t u32SysClk, uint32_t u32Baud)&lt;BR /&gt;{&lt;BR /&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;uint16_t u16Sbr;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;/* Enable the clock to the selected UART */ &lt;BR /&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;if (pUART == LPUART0)&lt;BR /&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;{&lt;BR /&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;PCC-&amp;gt;PCCn[PCC_LPUART0_INDEX] |= PCC_PCCn_PCS(0b011) /* Clock Src= 1 (SOSCDIV2_CLK) */&lt;BR /&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;|PCC_PCCn_CGC_MASK; /* Enable clock for LPUART1 regs */&lt;BR /&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;}&lt;BR /&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;else if (pUART == LPUART1)&lt;BR /&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;{&lt;BR /&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;PCC-&amp;gt;PCCn[PCC_LPUART1_INDEX] |= PCC_PCCn_PCS(0b011) /* Clock Src= 1 (SOSCDIV2_CLK) */&lt;BR /&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;|PCC_PCCn_CGC_MASK; /* Enable clock for LPUART1 regs */&lt;BR /&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;}&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;/* Make sure that the transmitter and receiver are disabled while we&lt;BR /&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;* change settings.&lt;BR /&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;*/&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;pUART-&amp;gt;CTRL &amp;amp;= ~(LPUART_CTRL_TE_MASK | LPUART_CTRL_RE_MASK);&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;/* Configure the UART for 8-bit mode, no parity */&lt;BR /&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;pUART-&amp;gt;CTRL &amp;amp;= ~(LPUART_CTRL_M7_MASK | LPUART_CTRL_M_MASK | LPUART_CTRL_R8T9_MASK | &amp;nbsp;&amp;nbsp;&amp;nbsp;LPUART_CTRL_R9T8_MASK);&lt;/P&gt;&lt;P&gt;&lt;BR /&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;/* Calculate baud settings */&lt;BR /&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;pUART-&amp;gt;BAUD |= LPUART_BAUD_OSR(15);&lt;BR /&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;u16Sbr = (u32SysClk/u32Baud)/16;&lt;BR /&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;pUART-&amp;gt;BAUD |= LPUART_BAUD_SBR(u16Sbr);&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;/* Enable receiver and transmitter */&lt;BR /&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;pUART-&amp;gt;CTRL |= LPUART_CTRL_TE_MASK | LPUART_CTRL_RE_MASK;&lt;BR /&gt;}&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;uint8_t UART_GetChar(LPUART_Type *pUART)&lt;BR /&gt;{&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;/* Wait until character has been received */&lt;BR /&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;while((pUART-&amp;gt;STAT &amp;amp; LPUART_STAT_RDRF_MASK)&amp;gt;&amp;gt;LPUART_STAT_RDRF_SHIFT==0);&lt;BR /&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;/* Return the 8-bit data from the receiver */&lt;BR /&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;return pUART-&amp;gt;DATA;&lt;BR /&gt;}&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;void UART_PutChar(LPUART_Type *pUART, uint8_t u8Char)&lt;BR /&gt;{ &lt;BR /&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;/* Wait until space is available in the FIFO */&lt;BR /&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;while((pUART-&amp;gt;STAT &amp;amp; LPUART_STAT_TDRE_MASK)&amp;gt;&amp;gt;LPUART_STAT_TDRE_SHIFT==0);&lt;BR /&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;/* Send the character */&lt;BR /&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;pUART-&amp;gt;DATA = (uint8_t)u8Char;&lt;BR /&gt;}&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 26 May 2020 10:36:38 GMT</pubDate>
      <guid>https://community.nxp.com/t5/S32K/UART-Byte-receive-Problem/m-p/1075215#M7497</guid>
      <dc:creator>dipak</dc:creator>
      <dc:date>2020-05-26T10:36:38Z</dc:date>
    </item>
    <item>
      <title>Re: UART Byte receive Problem.</title>
      <link>https://community.nxp.com/t5/S32K/UART-Byte-receive-Problem/m-p/1075216#M7498</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Why do not you use the code from example if it is working for you?&lt;/P&gt;&lt;P&gt;I have changed the baudrate to 19200 and select &lt;SPAN&gt;SOSCDIV2_CLK&amp;nbsp;&lt;/SPAN&gt;in the example and it is working well. (attached)&lt;/P&gt;&lt;P&gt;I'm not sure which clock you are using because this code select the FIRCDIV2_CLK, but your comment says&amp;nbsp;SOSCDIV2_CLK&lt;/P&gt;&lt;P&gt;P&lt;SPAN style="color: #51626f; background-color: #ffffff;"&gt;CC-&amp;gt;PCCn[PCC_LPUART0_INDEX] |= PCC_PCCn_PCS(0b011)&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Could you try it? But I'm using PTC6 and PTC7.&lt;/P&gt;&lt;P&gt;Also, have you checked LPUART-&amp;gt; STAT register?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Note: the example code is created in the S32 Design Studio for ARM ver 2.2&amp;nbsp;&lt;/P&gt;&lt;P&gt;Best regards,&lt;/P&gt;&lt;P&gt;Diana&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 28 May 2020 07:15:14 GMT</pubDate>
      <guid>https://community.nxp.com/t5/S32K/UART-Byte-receive-Problem/m-p/1075216#M7498</guid>
      <dc:creator>dianabatrlova</dc:creator>
      <dc:date>2020-05-28T07:15:14Z</dc:date>
    </item>
    <item>
      <title>Re: UART Byte receive Problem.</title>
      <link>https://community.nxp.com/t5/S32K/UART-Byte-receive-Problem/m-p/1075217#M7499</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Diana,&lt;/P&gt;&lt;P&gt;Thank you for your reply.&lt;/P&gt;&lt;P&gt;Yes, I am using &lt;SPAN style="color: #51626f; background-color: #ffffff;"&gt;FIRCDIV2_CLK. Sorry for the wrong comment.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #51626f; background-color: #ffffff;"&gt;I think the clock is not a issue here. Because I can transmit data without any problem. Problem is in receiving. I am summarizing my actions.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #51626f; background-color: #ffffff;"&gt;I tested on Evaluation board (Both pooling and interrupt mode). Transmit and Receive both working good.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #51626f; background-color: #ffffff;"&gt;The same code I&amp;nbsp;run in Application board (changed the pin configuration only to fit the application design). Now, I am able to transmit only, reception of data failed. I have tested both pooling and interrupt mode, but only transmit is successful, no reception in the application board!&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #51626f; background-color: #ffffff;"&gt;Hope, I am able to clear my scenario.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #51626f; background-color: #ffffff;"&gt;Regards&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #51626f; background-color: #ffffff;"&gt;Dipak Kumar&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 29 May 2020 02:12:40 GMT</pubDate>
      <guid>https://community.nxp.com/t5/S32K/UART-Byte-receive-Problem/m-p/1075217#M7499</guid>
      <dc:creator>dipak</dc:creator>
      <dc:date>2020-05-29T02:12:40Z</dc:date>
    </item>
    <item>
      <title>Re: UART Byte receive Problem.</title>
      <link>https://community.nxp.com/t5/S32K/UART-Byte-receive-Problem/m-p/1075218#M7500</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thank you for your clarification. Have you measured with an analyzer or oscilloscope the signal on the RX pin to disprove the possibility of a wrong connection on the application board?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Best regards,&lt;/P&gt;&lt;P&gt;Diana&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 01 Jun 2020 11:35:38 GMT</pubDate>
      <guid>https://community.nxp.com/t5/S32K/UART-Byte-receive-Problem/m-p/1075218#M7500</guid>
      <dc:creator>dianabatrlova</dc:creator>
      <dc:date>2020-06-01T11:35:38Z</dc:date>
    </item>
    <item>
      <title>Re: UART Byte receive Problem.</title>
      <link>https://community.nxp.com/t5/S32K/UART-Byte-receive-Problem/m-p/1075219#M7501</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;Thank you for your suggestions.&lt;/P&gt;&lt;P&gt;The problem is identified and solved. You are right, it was h/w issue. When I measured with oscilloscope, found that RX pin routing was wrong.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Best regards&lt;/P&gt;&lt;P&gt;Dipak Kumar&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 02 Jun 2020 01:14:10 GMT</pubDate>
      <guid>https://community.nxp.com/t5/S32K/UART-Byte-receive-Problem/m-p/1075219#M7501</guid>
      <dc:creator>dipak</dc:creator>
      <dc:date>2020-06-02T01:14:10Z</dc:date>
    </item>
  </channel>
</rss>

