UART transmitter complete interrupt timing

キャンセル
次の結果を表示 
表示  限定  | 次の代わりに検索 
もしかして: 

UART transmitter complete interrupt timing

ソリューションへジャンプ
2,515件の閲覧回数
masatsuguyamada
Contributor II

Hi,
We are using i.MX6 (MCIMX6Q7CVT08AC) on custom board, and trying to make RS-485 communication for Modbus RTU.

RTS pin of RS-485 transceiver (externally attached, ADM2485) is connected to i.MX6 GPIO, and we control the GPIO for half duplex send / receive change.

Controlling GPIO from user process were not stable for real-time use, so we are trying to control GPIO (RS-485 transceiver / RTS) from Linux kernel space, using UART send interrupt.

From our trial, using interrupt handler imx_txint() of i.MX6 serial driver (driver/tty/serial/imx.c), we could see two interrupt by oscilloscope,

(a) Transmit Buffer FIFO empty (UARTx_USR2 / TXEF)
         --> The interrupt was 2 byte earlier from complete sending.

(b) Transmitter Complete (UARTx_USR2 / TXDC)
         --> The interrupt was observed 1.6~4.4ms after complete sending.
               Unfortunately our external Modbus device sends response before this
               interrupt, so RTS control by this interrupt doesn't meet deadline.

***(a)(b)
http://www.nxp.com/assets/documents/data/en/reference-manuals/IMX6DQRM.pdf
p.5263

TXDC_interrupt_timing.png

My question is,
(1) Is there any trigger that we can notice complete transmitting UART data?
      TXDC interrupt corresponds to that?
(2) Can the delay of TXDC (observed 1.6~4.4ms) be shorten by some register setting?


Thanks in advance,
Yamada

ラベル(1)
0 件の賞賛
返信
1 解決策
1,953件の閲覧回数
masatsuguyamada
Contributor II

Hi Yuri,

Thanks for the advice, I understand the TXDC is the expected trigger,
also I have considered using timer IC for RTS control, so your advice was very helpful.

Regards,
Yamada

元の投稿で解決策を見る

0 件の賞賛
返信
2 返答(返信)
1,953件の閲覧回数
Yuri
NXP Employee
NXP Employee

Hello,

  Please look at my comments below.

1.

  Yes, TXDC (Transmitter Complete) bit indicates that the transmit buffer (TxFIFO) and Shift Register is empty;
therefore the transmission is complete.

2.

  I think the scheme You use - with GPIO control under Linux - hardly can meet Modbus requirements.

There are a lot RS232-RS485 automatic converters. These converters contains a fast automatic TX enable

circuit.

Have a great day,
Yuri

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

0 件の賞賛
返信
1,954件の閲覧回数
masatsuguyamada
Contributor II

Hi Yuri,

Thanks for the advice, I understand the TXDC is the expected trigger,
also I have considered using timer IC for RTS control, so your advice was very helpful.

Regards,
Yamada

0 件の賞賛
返信