<?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 Single-wire UART on KL26Z ??? in Processor Expert Software</title>
    <link>https://community.nxp.com/t5/Processor-Expert-Software/Single-wire-UART-on-KL26Z/m-p/344787#M2616</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I'm trying to use single-wire half-duplex UART mode on a FRDM-KL26Z board.&amp;nbsp; The KL16Z reference manual indicates there are a few relevant fields in the UART control register 1 to enable this functionality:&lt;/P&gt;&lt;P style="padding-left: 30px;"&gt;&lt;STRONG&gt;LOOPS Loop Mode Select&lt;/STRONG&gt;&lt;BR /&gt;Selects between loop back modes and normal 2-pin full-duplex modes. When LOOPS is set, the transmitter output is internally connected to the receiver input.&lt;BR /&gt;0 = Normal operation - UART_RX and UART_TX use separate pins.&lt;BR /&gt;1 = Loop mode or single-wire mode where transmitter outputs are internally connected to receiver input. (See RSRC bit.) UART_RX pin is not used by UART.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P style="padding-left: 30px;"&gt;&lt;STRONG&gt;RSRC Receiver Source Select&lt;/STRONG&gt;&lt;BR /&gt;This bit has no meaning or effect unless the LOOPS bit is set to 1. When LOOPS is set, the receiver input is internally connected to the UART_TX pin and RSRC determines whether this connection is also&lt;BR /&gt;connected to the transmitter output.&lt;BR /&gt;0 = Provided LOOPS is set, RSRC is cleared, selects internal loop back mode and the UART does not use the UART_RX pins.&lt;BR /&gt;1 = Single-wire UART mode where the UART_TX pin is connected to the transmitter output and receiver input.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I'd like to use a single-wire on the TxD pin for both sending and receiving data.&amp;nbsp; I think this corresponds to LOOPS = 1 and RSRC = 1.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;In Processor Expert, I've added a Serial_LDD from the component library to my project.&amp;nbsp; The only setting which I can see which relates to single-wire mode is "Loop mode" which has four options:&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;Normal&lt;/LI&gt;&lt;LI&gt;Automatic Echo&lt;/LI&gt;&lt;LI&gt;Local loop-back&lt;/LI&gt;&lt;LI&gt;Remote loop-back&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Out of these, only Normal and Local Loop-back are available.&amp;nbsp; If I try to select the other two, PE reports that "The device doesn't support the selected loop mode".&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;It's not really clear how these Loop Mode options relate to the register settings.&amp;nbsp; Is "Normal" equivalent to LOOPS = 0 and RSRC = 0, with Local Loop-back equivalent to LOOPS = 1 and RSRC = 0 ?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If so, is there a way (other than writing to registers directly and not using PE) to enable LOOPS = 1 and RSRC = 1 ???&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 25 Sep 2014 08:32:02 GMT</pubDate>
    <dc:creator>geoffs</dc:creator>
    <dc:date>2014-09-25T08:32:02Z</dc:date>
    <item>
      <title>Single-wire UART on KL26Z ???</title>
      <link>https://community.nxp.com/t5/Processor-Expert-Software/Single-wire-UART-on-KL26Z/m-p/344787#M2616</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I'm trying to use single-wire half-duplex UART mode on a FRDM-KL26Z board.&amp;nbsp; The KL16Z reference manual indicates there are a few relevant fields in the UART control register 1 to enable this functionality:&lt;/P&gt;&lt;P style="padding-left: 30px;"&gt;&lt;STRONG&gt;LOOPS Loop Mode Select&lt;/STRONG&gt;&lt;BR /&gt;Selects between loop back modes and normal 2-pin full-duplex modes. When LOOPS is set, the transmitter output is internally connected to the receiver input.&lt;BR /&gt;0 = Normal operation - UART_RX and UART_TX use separate pins.&lt;BR /&gt;1 = Loop mode or single-wire mode where transmitter outputs are internally connected to receiver input. (See RSRC bit.) UART_RX pin is not used by UART.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P style="padding-left: 30px;"&gt;&lt;STRONG&gt;RSRC Receiver Source Select&lt;/STRONG&gt;&lt;BR /&gt;This bit has no meaning or effect unless the LOOPS bit is set to 1. When LOOPS is set, the receiver input is internally connected to the UART_TX pin and RSRC determines whether this connection is also&lt;BR /&gt;connected to the transmitter output.&lt;BR /&gt;0 = Provided LOOPS is set, RSRC is cleared, selects internal loop back mode and the UART does not use the UART_RX pins.&lt;BR /&gt;1 = Single-wire UART mode where the UART_TX pin is connected to the transmitter output and receiver input.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I'd like to use a single-wire on the TxD pin for both sending and receiving data.&amp;nbsp; I think this corresponds to LOOPS = 1 and RSRC = 1.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;In Processor Expert, I've added a Serial_LDD from the component library to my project.&amp;nbsp; The only setting which I can see which relates to single-wire mode is "Loop mode" which has four options:&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;Normal&lt;/LI&gt;&lt;LI&gt;Automatic Echo&lt;/LI&gt;&lt;LI&gt;Local loop-back&lt;/LI&gt;&lt;LI&gt;Remote loop-back&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Out of these, only Normal and Local Loop-back are available.&amp;nbsp; If I try to select the other two, PE reports that "The device doesn't support the selected loop mode".&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;It's not really clear how these Loop Mode options relate to the register settings.&amp;nbsp; Is "Normal" equivalent to LOOPS = 0 and RSRC = 0, with Local Loop-back equivalent to LOOPS = 1 and RSRC = 0 ?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If so, is there a way (other than writing to registers directly and not using PE) to enable LOOPS = 1 and RSRC = 1 ???&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 25 Sep 2014 08:32:02 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Processor-Expert-Software/Single-wire-UART-on-KL26Z/m-p/344787#M2616</guid>
      <dc:creator>geoffs</dc:creator>
      <dc:date>2014-09-25T08:32:02Z</dc:date>
    </item>
    <item>
      <title>Re: Single-wire UART on KL26Z ???</title>
      <link>https://community.nxp.com/t5/Processor-Expert-Software/Single-wire-UART-on-KL26Z/m-p/344788#M2617</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello Geoff,&lt;/P&gt;&lt;P&gt;The Serial_LDD component does not support the single wire mode now. You can use the SetLoopMode PDD macro that implements the&amp;nbsp; UART0_PDD_LOOP_MODE_RX_TO_TX_PIN loop mode value (single wire operation). See for example the code of UART0_PDD.h below:&lt;/P&gt;&lt;P&gt;. . .&lt;/P&gt;&lt;P&gt;/* Loop mode */&lt;BR /&gt;#define UART0_PDD_LOOP_MODE_NORMAL&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 0U&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; /**&amp;lt; Normal operation mode. No loopback selected. */&lt;BR /&gt;#define UART0_PDD_LOOP_MODE_LOCAL_LOOP&amp;nbsp;&amp;nbsp; 0x1U&amp;nbsp;&amp;nbsp;&amp;nbsp; /**&amp;lt; Local loopback mode. */&lt;BR /&gt;#define UART0_PDD_LOOP_MODE_RX_TO_TX_PIN 0x2U&amp;nbsp;&amp;nbsp;&amp;nbsp; /**&amp;lt; Receiver input connected to TXD pin (single wire operation) */&lt;/P&gt;&lt;P&gt;. . .&lt;/P&gt;&lt;P&gt;/* ----------------------------------------------------------------------------&lt;BR /&gt;&amp;nbsp;&amp;nbsp; -- SetLoopMode&lt;BR /&gt;&amp;nbsp;&amp;nbsp; ---------------------------------------------------------------------------- */&lt;/P&gt;&lt;P&gt;/**&lt;BR /&gt; * @brief Selects the loop mode operation.&lt;BR /&gt; * @param PeripheralBase Pointer to a peripheral registers structure (peripheral&lt;BR /&gt; *&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; base address). You can use the constant defined in the registers&lt;BR /&gt; *&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; definition header file (&amp;lt;peripheral&amp;gt;_BASE_PTR) or the constant defined in&lt;BR /&gt; *&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; the peripheral initialization component header file&lt;BR /&gt; *&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; (&amp;lt;component_name&amp;gt;_DEVICE).&lt;BR /&gt; * @param LoopMode Loop mode. This parameter is of "Loop mode" type.&lt;BR /&gt; * @return Returns a value of void type.&lt;BR /&gt; * @remarks The macro accesses the following registers: UART0_C1.&lt;BR /&gt; * @par Example:&lt;BR /&gt; *&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; @code&lt;BR /&gt; *&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; UART0_PDD_SetLoopMode(&amp;lt;peripheral&amp;gt;_BASE_PTR,&lt;BR /&gt; *&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; UART0_PDD_LOOP_MODE_NORMAL);&lt;BR /&gt; *&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; @endcode&lt;BR /&gt; */&lt;BR /&gt;#define UART0_PDD_SetLoopMode(PeripheralBase, LoopMode) ( \&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; ((LoopMode) == UART0_PDD_LOOP_MODE_NORMAL) ? ( \&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; UART0_C1_REG(PeripheralBase) &amp;amp;= \&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; (uint8_t)(( \&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; (uint8_t)(~(uint8_t)UART0_C1_LOOPS_MASK)) &amp;amp; ( \&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; (uint8_t)(~(uint8_t)UART0_C1_RSRC_MASK)))) : (((LoopMode) == UART0_PDD_LOOP_MODE_LOCAL_LOOP) ? ( \&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; UART0_C1_REG(PeripheralBase) = \&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; (uint8_t)(( \&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; (uint8_t)(UART0_C1_REG(PeripheralBase) | UART0_C1_LOOPS_MASK)) &amp;amp; ( \&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; (uint8_t)(~(uint8_t)UART0_C1_RSRC_MASK)))) : ( \&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; UART0_C1_REG(PeripheralBase) |= \&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; (uint8_t)(UART0_C1_LOOPS_MASK | UART0_C1_RSRC_MASK)) \&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; ) \&lt;BR /&gt;&amp;nbsp; )&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Best Regards,&lt;/P&gt;&lt;P&gt;Marek Neuzil&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 30 Sep 2014 09:17:13 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Processor-Expert-Software/Single-wire-UART-on-KL26Z/m-p/344788#M2617</guid>
      <dc:creator>marek_neuzil</dc:creator>
      <dc:date>2014-09-30T09:17:13Z</dc:date>
    </item>
  </channel>
</rss>

