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

  • The UART hardware supports full duplex.

    Check it out in the so-called "bible" for the 8051:

    Chapter 1 - 80C51 Family Architecture:
    www.nxp.com/.../80C51_FAM_ARCH_1.pdf

    Chapter 2 - 80C51 Family Programmer's Guide and Instruction Set:
    www.nxp.com/.../80C51_FAM_PROG_GUIDE_1.pdf

    Chapter 3 - 80C51 Family Hardware Description:
    www.nxp.com/.../80C51_FAM_HARDWARE_1.pdf

  • The UART hardware supports full duplex.

    In simple words it also means that 8051 supports full duplex...How?
    What Changes do we need to make?
    As there is only one SBUF, how can it support Full Duplex?

  • No there is one SBUF write register and one SBUF read register. The two registers shares the same address.

    The UART is _always_ full duplex. It is only when you connect external hardware that connects the rx and tx signals (such as in some current loops) that your software must switch between sending and receiving, to make sure that your transmissions doesn't garble any data you want to receive on the single transfer line.

  • "It is only when you connect external hardware..."

    Without connecting external hardware, how am i going to communicate serially??

  • "Without connecting external hardware, how am i going to communicate serially??"

    Of course, you can't!

    But you entirely missed Per's point!
    What he said in full was:

    "It is only when you connect external hardware that connects the rx and tx signals..."

    In other words, the 8051 is full duplex.
    But, if you want your system to be full duplex, then you have to ensure that all parts of it can support full duplex - including your external hardware and your software.

  • "What Changes do we need to make?"

    Changes to what?
    Without knowing what you already have, how can anyone possible know how it might need to be changed?!

    "As there is only one SBUF"

    No, there isn't.
    You didn't read the documents, did you?
    You need to study those documents to be able to understand issues like this!

    Look at Figures 13 to 16 in the Hardware Description and you will see clrealy that there are, indeed, two SBUF registers!

  • From the operational point of view, whats the advantage of having separate SBUF registers for read and write when you can do only one operation when external hardware is connected?

  • 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...