This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts

UART RTS signal behavior when STARTRX

Hi Nordic guys,

we are using uart for communication with another MCU and flow control is used. Beside the uart communication itself we have out of band signals (on gpio) used to indicates to other MCU if each side would communicate over uart or not (it is a power handshaking logic). When nobody wants to talk both sides will disable uart (on Nordic side we just STOPRX/TX task.

Now when Nordic set to H the RTS due to 4 byte left in uart fifo, the other side will avoid sending out a byte (it is just polling the RTS and acts consequently), and retries a little later. During this time power handshaking let sleep uart on both side.

Note that in one specific case the app on nordic will deactivate interupt for received byte on uart since it won't be able to process it and would intentionally blocks the uart traffic letting RTS be triggered.

So on Nordic we are in this situation:

  1. app disable RXDRDY interrupt in INTENCLR;

  2. RXD fifo contains 2 bytes so RTS is set to H;

  3. other MCU set idle state for uart and so Nordic will STOPRX (here RTS will be deactivated.. but it is already to H on step 2)

  4. other MCU waits a while and 'wake' uart so Nordic STARTRX task

The question is: what is the expectation for the RTS signal? The Reference manual shows in the diagram that RTS goes L when STARTRX. Is it always true regardless the status of RXD fifo? Elsewhere in manual it is written that "RTS signal will first activated again when the FIFO has been emptied".

Is an OR logic implemented for above conditions (RTS goes L if "STARTRX" or "rx fifo empty") are an AND one?

Could you clarify it? As per our test is seems that RTS is activated every time at STARTRX regardless status of RX fifo.

Thanks

Parents
  • Hi Roberto,

    Good questions, I have just talked to the engineer who designed the UART.

    The contents of the FIFO are not flushed when you STOPRX and STARTRX. The RTS line will always be linked to the contents of FIFO (before and after STARTRX/STOPRX).

    RTS will be set from H to L only when

    • UARTRX is started AND
    • UART RX FIFO is empty

    which means RTS goes L at "STARTRX" is true only when the FIFO is empty.

    RTS will be set from L to H only when

    • UARTRX is stopped OR
    • UART RX FIFO has received the second unread byte.
  • Hi Aryan,

    thanks for feedback; here my comments:

    • actually as said our test show that RTS is NOT kept H when STARTRX with a fifo of 2 byte (or at least that let trigger an RTS to H before; we will do more test to confirm;
    • so if RTS is set to L only if UARTRX is started AND RX fifo is empty, what about the corner case STOPRX is called when only one byte (so no need to set RTS to H here) then for any reason STARTRX with 1 byte left in there? is RTS kept H since fifo not empty?

    thanks

Reply
  • Hi Aryan,

    thanks for feedback; here my comments:

    • actually as said our test show that RTS is NOT kept H when STARTRX with a fifo of 2 byte (or at least that let trigger an RTS to H before; we will do more test to confirm;
    • so if RTS is set to L only if UARTRX is started AND RX fifo is empty, what about the corner case STOPRX is called when only one byte (so no need to set RTS to H here) then for any reason STARTRX with 1 byte left in there? is RTS kept H since fifo not empty?

    thanks

Children
No Data
Related