Single-wire UART on KL26Z ?

cancel
Showing results for 
Search instead for 
Did you mean: 

Single-wire UART on KL26Z ?

Jump to solution
907 Views
geoffs
Contributor I

I'm trying to use single-wire half-duplex UART mode on a FRDM-KL26Z board.  The KL16Z reference manual indicates there are a few relevant fields in the UART control register 1 to enable this functionality:

LOOPS Loop Mode Select
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.
0 = Normal operation - UART_RX and UART_TX use separate pins.
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.

RSRC Receiver Source Select
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
connected to the transmitter output.
0 = Provided LOOPS is set, RSRC is cleared, selects internal loop back mode and the UART does not use the UART_RX pins.
1 = Single-wire UART mode where the UART_TX pin is connected to the transmitter output and receiver input.

I'd like to use a single-wire on the TxD pin for both sending and receiving data.  I think this corresponds to LOOPS = 1 and RSRC = 1.

In Processor Expert, I've added a Serial_LDD from the component library to my project.  The only setting which I can see which relates to single-wire mode is "Loop mode" which has four options:

  • Normal
  • Automatic Echo
  • Local loop-back
  • Remote loop-back

Out of these, only Normal and Local Loop-back are available.  If I try to select the other two, PE reports that "The device doesn't support the selected loop mode".

It's not really clear how these Loop Mode options relate to the register settings.  Is "Normal" equivalent to LOOPS = 0 and RSRC = 0, with Local Loop-back equivalent to LOOPS = 1 and RSRC = 0 ?

If so, is there a way (other than writing to registers directly and not using PE) to enable LOOPS = 1 and RSRC = 1 ???

0 Kudos
1 Solution
532 Views
Kan_Li
NXP TechSupport
NXP TechSupport

Hi Geoff,

Please try to use the PE component shown as below:

1.png

Hope that helps,


Have a great day,
Kan

-----------------------------------------------------------------------------------------------------------------------
Note: If this post answers your question, please click the Correct Answer button. Thank you!
-----------------------------------------------------------------------------------------------------------------------

View solution in original post

0 Kudos
2 Replies
533 Views
Kan_Li
NXP TechSupport
NXP TechSupport

Hi Geoff,

Please try to use the PE component shown as below:

1.png

Hope that helps,


Have a great day,
Kan

-----------------------------------------------------------------------------------------------------------------------
Note: If this post answers your question, please click the Correct Answer button. Thank you!
-----------------------------------------------------------------------------------------------------------------------

0 Kudos
532 Views
geoffs
Contributor I

Thanks Kan.  Am I correct in thinking that using the Init_UART peripheral initialization component means I can not then use a higher-level Processor Expert component (eg Serial_LDD or AsynchroSerial) ?

0 Kudos