i.MX6: What does the DTE/DCE in i.MX6's UART do and how are RTS and CTS affected by the UARTxUFCR[DTEDCE] bit?

cancel
Showing results for 
Search instead for 
Did you mean: 

i.MX6: What does the DTE/DCE in i.MX6's UART do and how are RTS and CTS affected by the UARTxUFCR[DTEDCE] bit?

i.MX6: What does the DTE/DCE in i.MX6's UART do and how are RTS and CTS affected by the UARTxUFCR[DTEDCE] bit?

Question:

What exactly does the DTE/DCE interface in the i.MX6's UART module do and how are RTS and CTS affected by the UARTxUFCR[DTEDCE] bit?

In i.MX6 RM, revision 1:

Sections 64.2.1.2.1  (CTS) and 64.2.1.2.2 (RTS) both state that CTS and RTS change direction between DCE and DTE modes.  However, sections 64.4.3.1 (RTS_B) and 64.4.3.8 (CTS_B) state they do not change functions.  Is this a documentation error, or is there a difference between CTS/RTS and CTS_B/RTS_B?

It appears that some of this is covered in the IOMUX daisy chain by switching which pins are connected to CTS and RTS.

Answer:

Example 1: UART1 in DTE mode. RTS is an output from the UART IP block so it must be routed to a CTS pin.
Therefore, the SELECT_INPUT register could only use settings 00 or 10.

Example 2: UART1 in DCE mode. RTS is an input to the UART IP block so it must be routed to an RTS pin.

Therefore, the SELECT_INPUT register could only be set to 01 or 11.

At this point, we have assumed that the internal signals connected to the UART block do not change direction.  We believe that DCEDTE from the UART block connects into the IOMUX logic and controls the direction of the PAD.  Then, the IOMUX INPUT_SELECT mux is used to choose one of four pads to connect to the UART inputs while the IMOUX MUX_CTRL connects the output path.  Further, we assume it is an error to connect the UART input to a pad configured as an output or a UART output to a pad configured as an input.

The attached shows our assumptions

For the Uart IP, the CTS_B is always an output and RTS_B always an input. But the RTS_B &CTS_B IO will be swapped  when UART operates in different DTE or DCE mode. 

IO port

DTE mode

DCE mode

direction

Uart IP port(internal)

direction

Uart IP port(internal)

UART_CTS_B

O

CTS_B

I

RTS_B

UART_RTS_B

I

RTS_B

O

CTS_B

UART_TXD

O

TXD

I

RXD

UART_RXD

I

RXD

O

TXD

Regarding how to configure the IOMUX, please see the attached PDF.

Labels (1)
Attachments
Comments

This is very useful information.

But it seems that there is a typo in your table. In my opinion, DCE/DTE text in your table must be swapped.

DCE mode is selected if DCEDTE bit=0, according to iMX6 Dual/Quad Reference Manual, Rev.1, 04/2013,

page 5239, and your example text and UART MUX.pdf file says the same.


If DCEDTE=0, then UART_RTS_B is input, UART_CTS_B is output, UART_TXD is output and UART_RXD is input.

If DCEDTE=1, then UART_RTS_B is output, UART_CTS_B is input, UART_TXD is input and UART_RXD is output.


Here is the updated table:


IO Port

DCE Mode (DCEDTE=0)

DTE Mode (DCEDTE=1)

IO Direction

UART IP port

IO Direction

UART IP port

UART_CTS_B

O

CTS_B

I

RTS_B

UART_RTS_B

I

RTS_B

O

CTS_B

UART_TXD

O

TXD

I

RXD

UART_RXD

I

RXD

O

TXD

UART IP ports have always fixed direction for RxD/TxD and RTS/CTS, but the associated iMX6 IO ports have not.

Please correct me if I'm wrong.

Best Regards,

Martin.

Martin,

you are right

If normal dce mode, then UART_RTS_B is input, UART_CTS_B is output, UART_TXD is output and UART_RXD is input.

If dte-mode, then UART_RTS_B is output, UART_CTS_B is input, UART_TXD is input and UART_RXD is output.

Does this mean that regardless of whether you configure a pinmux as DTE_RX or DCE_TX that pin will be used as the transmit for the iMX uart interface corresponding to it.

I'm bringing up a board where one of the peripheral's UARTs was connected in reverse by mistake, and I was hoping to use the pin mux to compensate for this in software but it seems that's not possible. Is that correct?

In other words, these two configurations do not affect which pin the iMx listens and transmits on?

        MX6UL_PAD_UART5_TX_DATA__UART5_DTE_RX    0x000010B0
        MX6UL_PAD_GPIO1_IO05__UART5_DTE_TX       0x000010B0

        MX6UL_PAD_UART5_TX_DATA__UART5_DCE_TX    0x000010B0
        MX6UL_PAD_GPIO1_IO05__UART5_DCE_RX       0x000010B0

Don't forget to set "fsl,dte-mode" in the device tree also.

Hi all,

I try to achieve the following configuration (on UART4):

IO portDirection
CSI0_DATA12 (ALT3, UART4_TX_DATA)O
CSI0_DATA13 (ALT3, UART4_RX_DATA)I
CSI0_DATA16 (ALT3, UART4_RTS_B)O :smileyalert:
CSI0_DATA17 (ALT3, UART4_CTS_B)I :smileyalert:

So, basically I want to cross only the CTS and RTS signals, being the UART4_CTS_B be the input, just as in DTE mode, but keep TX and RX direction as in DCE.

I have found the Select Input Register IOMUXC_UART4_UART_RTS_B_SELECT_INPUT (reg offset 0x910) what has the following description (which I admit is confusing to me):

(bit 0):
Input Select (DAISY) Field
Selecting Pads Involved in Daisy Chain.
Route RTS_B signal to pad when UART is in DCE mode. Route CTS_B signal to pad when UART is in
DTE mode.
0 CSI0_DATA16_ALT3 — Selecting ALT3 mode of pad CSI0_DAT16 for UART4_RTS_B.
1 CSI0_DATA17_ALT3 — Selecting ALT3 mode of pad CSI0_DAT17 for UART4_CTS_B.

Based on that I assumed that I am able to cross only the RTS/CTS pins, but I was not able to succeed.

I have found that imx6dl-pinfunc.h uses this register, and defines the seemingly needed pin functions:

#define MX6QDL_PAD_CSI0_DAT16__UART4_RTS_B 0x064 0x378 0x910 0x3 0x0
#define MX6QDL_PAD_CSI0_DAT16__UART4_CTS_B 0x064 0x378 0x000 0x3 0x0

[...]

#define MX6QDL_PAD_CSI0_DAT17__UART4_CTS_B 0x068 0x37c 0x000 0x3 0x0
#define MX6QDL_PAD_CSI0_DAT17__UART4_RTS_B 0x068 0x37c 0x910 0x3 0x1

So, I tried the following dts:

+ uart4 {
+ pinctrl_uart4: uart4grp {
+ fsl,pins = <
+ MX6QDL_PAD_CSI0_DAT12__UART4_TX_DATA 0x1b0b1
+ MX6QDL_PAD_CSI0_DAT13__UART4_RX_DATA 0x1b0b1
+ MX6QDL_PAD_CSI0_DAT16__UART4_CTS_B 0x1b0b1
+ MX6QDL_PAD_CSI0_DAT17__UART4_RTS_B 0x1b0b1
+ >;
+ };
+ };

[...]

+&uart4 {
+ pinctrl-names = "default";
+ pinctrl-0 = <&pinctrl_uart4>;
+ fsl,uart-has-rtscts;
+ status = "okay";
+};

Unfortunately, it seems that it is not working as I would expect. The TX pin is ok, if I switch off crtscts, I can send out bytes on the TX, but it seems that the uart still reads the RTS pin as input flow control (I am not 100% sure, but as that pin is not connected and I cannot send bytes when crtscts is enabled, I guess that is the reason).

What am I getting wrong? Is it possible to implement this configuration? Or it should work like I wish, so I should double check my hw?

Thanks in advance:

Ferenc

hi,

 I too struck up with that, If you resolves that issue kindly reply me.

Hello Ferec,

I am also stuck in the same problem.

Did you get any solution?

Thanks,

Shreyans

What document does the diagram in the "UART MUX.pdf" attachment come from?  Can someone provide a link?  I haven't been able to find an "IMX6 RM" anywhere.  There are reference manuals for IMX6UL, etc.

I'd be interested to see the same picture expanded to include TXD and RXD pins in addition to CTS_B and RTS_B.  There seems to be some confusion (me included) whether DCEDTE swaps those as well, which could be cleared up via a diagram with all the UART pins and muxes.

See also this thread
i.MX6: how to use RTS/CTS properly using UART (DTE/DCE) 

--

Marco Cavallini | KOAN sas | Bergamo - Italia
embedded software engineering
https://KoanSoftware.com

Version history
Revision #:
1 of 1
Last update:
‎10-14-2013 08:41 PM
Updated by: