Embedded

SBUF Register in 8051

By CourseTron Team ·  1 min read ·  Updated Oct 2026 💬 𝕏 in f
Table of Contents

    8051 SERIAL COMMUNICATION

    SBUF Register in 8051

    SBUF is the serial buffer register used by the 8051 UART; writing to SBUF starts transmission and reading SBUF retrieves received serial data.

    Quick answer

    SBUF is the serial buffer register used by the 8051 UART; writing to SBUF starts transmission and reading SBUF retrieves received serial data.

    Key points to remember

    • SBUF handles UART data transfer.
    • TI flag indicates transmit completion.
    • RI flag indicates received data is ready.

    How SBUF works

    SBUF is accessed at one address in software, but internally the transmit and receive buffers are separate. A write loads the transmit buffer, while a read returns received data. The TI and RI flags in SCON indicate transmit complete and receive complete events.

    Common mistakes

    Beginners often forget to configure TMOD, TH1, SCON, and TR1 for baud rate generation before using SBUF. Another common mistake is not clearing TI or RI after handling serial events, which causes repeated or missed status checks.

    FAQ

    Is SBUF one register or two?

    Software sees one SBUF address, but the 8051 uses separate internal transmit and receive buffers.

    Which register controls SBUF operation?

    SCON controls serial mode and status flags, while Timer 1 is commonly used for baud rate generation.

    Advertisement