Half-Duplex Transmit
In a half-duplex application, the UxTX and UxRX lines are shorted together; this allows a reduction in wire count. However, control is needed to avoid both devices transmitting at the same time. Setting the HALFDPLX bit (UxCON[24]) configures the UxTX pin to only drive the line during a byte transmission and is tri-stated at all other times. In UART systems, tri-state is not a permissible state, so it is important that the user enable a weak pull-up on the UART pad when such half-duplex systems are used. The RCIDL bit (UxSTAT[19]) can be read to determine if the line is Idle and a byte can be sent. However, a collision can still occur during the transmission. The Transmit Collision Interrupt Flag bit, TXCIF (UxSTAT[0]), can be read to determine if the byte was transmitted successfully. The receiver has to remain enabled for the transmission collision to be detected. If TXCIE (UxSTAT[8]) is set, the receive watermark interrupt will not be generated when TXCIF (UxSTAT[0]) is set.