<?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: Implementing UART RX/TX polarity inversion on MKE02Z64VLH4 in Kinetis Software Development Kit</title>
    <link>https://community.nxp.com/t5/Kinetis-Software-Development-Kit/Implementing-UART-RX-TX-polarity-inversion-on-MKE02Z64VLH4/m-p/953843#M7974</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello Alexander,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks for sharing with us how you solved the issue by using RXINV and TXINV bits configuration.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;In addition, I recommend you to use our latest version of the SDK (2.6.0). You can download it from the following link.&lt;/P&gt;&lt;P&gt;&lt;A href="https://mcuxpresso.nxp.com/en/welcome"&gt;https://mcuxpresso.nxp.com/en/welcome&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Best regards,&lt;/P&gt;&lt;P&gt;Felipe&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 22 Aug 2019 21:01:52 GMT</pubDate>
    <dc:creator>FelipeGarcia</dc:creator>
    <dc:date>2019-08-22T21:01:52Z</dc:date>
    <item>
      <title>Implementing UART RX/TX polarity inversion on MKE02Z64VLH4</title>
      <link>https://community.nxp.com/t5/Kinetis-Software-Development-Kit/Implementing-UART-RX-TX-polarity-inversion-on-MKE02Z64VLH4/m-p/953842#M7973</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I am using MCUExpresso IDE 11 with MKE02Z64 SDK 2.4.1.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;My application requires active high RX/TX operation.&amp;nbsp; It appears that in addition to the peripheral UART driver, KSDK 1.x also included low level HAL&amp;nbsp;driver (&lt;EM&gt;fsl_uart_hal)&lt;/EM&gt;&amp;nbsp;which permitted setting UART inversion using the example code below.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;void UART_HAL_SetTxRxInversionCmd(uint32_t baseAddr, bool rxInvertEnable, bool txInvertEnable)&lt;BR /&gt;{&lt;BR /&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;/* 0 - receive data not inverted, 1 - receive data inverted */&lt;BR /&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;BW_UART_S2_RXINV(baseAddr, (uint8_t)rxInvertEnable);&lt;BR /&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;/* 0 - transmit data not inverted, 1 - transmit data inverted*/&lt;BR /&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;BW_UART_C3_TXINV(baseAddr, (uint8_t)txInvertEnable);&lt;BR /&gt;}&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Unfortunately, this is no longer accessible.&amp;nbsp; After doing a little digging around in MKE02Z4.h in my KSDK 2.4.1, it appears there are applicable UART control registers which seemingly allow to accomplish what I need:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;#define UART_S2_RXINV_MASK (0x10U)&lt;BR /&gt;#define UART_S2_RXINV_SHIFT (4U)&lt;BR /&gt;#define UART_S2_RXINV(x) (((uint8_t)(((uint8_t)(x)) &amp;lt;&amp;lt; UART_S2_RXINV_SHIFT)) &amp;amp; UART_S2_RXINV_MASK)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;#define UART_C3_TXINV_MASK (0x10U)&lt;BR /&gt;#define UART_C3_TXINV_SHIFT (4U)&lt;BR /&gt;#define UART_C3_TXINV(x) (((uint8_t)(((uint8_t)(x)) &amp;lt;&amp;lt; UART_C3_TXINV_SHIFT)) &amp;amp; UART_C3_TXINV_MASK)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Please advise on the best way to implement the control in the main application, and if such control needs to be assigned prior to each transmission / reception or only once upon initialization of the UART peripheral.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;AGS&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;***EDIT****&lt;/P&gt;&lt;P&gt;I was able to accomplish what I needed by implementing the following in my UART initialization routine:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;((UART_Type *)UART2_BASE)-&amp;gt;C3 |= (1&amp;lt;&amp;lt;4);&lt;BR /&gt;((UART_Type *)UART2_BASE)-&amp;gt;S2 |= (1&amp;lt;&amp;lt;4);&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 21 Aug 2019 13:11:40 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Software-Development-Kit/Implementing-UART-RX-TX-polarity-inversion-on-MKE02Z64VLH4/m-p/953842#M7973</guid>
      <dc:creator>AlexanderSammo1</dc:creator>
      <dc:date>2019-08-21T13:11:40Z</dc:date>
    </item>
    <item>
      <title>Re: Implementing UART RX/TX polarity inversion on MKE02Z64VLH4</title>
      <link>https://community.nxp.com/t5/Kinetis-Software-Development-Kit/Implementing-UART-RX-TX-polarity-inversion-on-MKE02Z64VLH4/m-p/953843#M7974</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello Alexander,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks for sharing with us how you solved the issue by using RXINV and TXINV bits configuration.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;In addition, I recommend you to use our latest version of the SDK (2.6.0). You can download it from the following link.&lt;/P&gt;&lt;P&gt;&lt;A href="https://mcuxpresso.nxp.com/en/welcome"&gt;https://mcuxpresso.nxp.com/en/welcome&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Best regards,&lt;/P&gt;&lt;P&gt;Felipe&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 22 Aug 2019 21:01:52 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Software-Development-Kit/Implementing-UART-RX-TX-polarity-inversion-on-MKE02Z64VLH4/m-p/953843#M7974</guid>
      <dc:creator>FelipeGarcia</dc:creator>
      <dc:date>2019-08-22T21:01:52Z</dc:date>
    </item>
  </channel>
</rss>

