This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

8051 is half duplex or full duplex

8051 is half duplex or full duplex while communicating serially..if its half duplex then can we configure it to function as a full duplex

Parents Reply Children
  • How else would you do it?

    Think about how the hardware - any hardware - has to work:

    You need one register to supply data to the transmitter;
    You need one register to retreive data from the receiver.

    That's inherently two registers, isn't it?!

    Some products give them distinct names - so one is read-only and the other is write-only;
    The 8051 gives them both the same name - they are distinguished by the read or write operation.

    In processors with a limited address space, it would be a waste to give them separate addresses!

  • I do not think you have spent any time trying to understand earlier posts. You write:

    "[...] when you can do only one operation when external hardware is connected?"

    The UART (and all of it's hardware) is duplex. If you connect the 8051 UART (or any other UART, be it standalone or built into any other uC) directly to a PC, the dedicated rx and tx lines from the UART to the PC will give you a fully duplex connection. RX + TX + GND means that the serial cable must have at least three wires. Since the UART is fully duplex, it has to have separate registers for transmission and reception.

    It is only if the user decides to build and connect hardware that transmits and receives on the same two wires (+data, -data) or (data and GND) that the user must limit THE SOFTWARE to switch between transmit and receive. The UART will still be fully duplex-capable, but any data you send will loopback so the transmitted data will be sent to the other side AND your own UART. Because of this, THE SOFTWARE has to be adapted to make sure that it does not try to send at the same time as any other UART connected on the same wire/bus tries to send. In some situations, such bus solutions has a single master that sends an addressed query, and the addressed slave sends an answer. But it is possible to have multiple masters, as long as the masters have a way of arbitration, i.e. either know when it is safe to send, or to identify collissions and stop sending.

    But whatever you do, the UART is always duplex, even if the specific connection may make the full system being half duplex.

  • "But whatever you do, the UART is always [full] duplex, even if the specific connection may make the full system being half duplex."

    Even with a a hardware connection capapble of full-duplex (ie, completely separate transmit & receive paths), you might use a half-duplex software protocol over the link.

    eg, XMODEM will not transmit its next packet until the previous one has been acknowledged...