Back to the 2021 paper

Module 5: External Communication Interface

20217m

Assume you are determined to use mode 0 as a communication mode from one 8051 to another. Outline a system of hardware and software that would allow this.

Worked SolutionAI Assisted

System to Use Mode 0 Between Two 8051s (Synchronous Shift Register)

Mode 0 is 8-bit synchronous shift register via RxD (data) and TxD (shift clock). To interconnect two 8051s:

Hardware: Cross-connect: Master’s RxD (P3.0) ↔ Slave’s RxD? Actually Mode 0: TX and RX share same pin RxD for data, TxD outputs clock. Connect:

  • Master TxD (clock) → Slave TxD (clock) (both open-drain, need common clock source – mode 0 is half-duplex, so only one side generates clock).
  • Master RxD → Slave RxD (data line) bidirectional via buffer.
    Better: Use extra handshaking lines (P3.2/3.3) for direction control because clock is only generated during transmission by the sender.

Software: Master config: SCON=0x00 (mode0), sender loads SBUF, hardware clocks 8 bits; slave also SCON=0x00 with REN=1 to receive. Poll TI/RI or interrupt. Add protocol: Master asserts handshake line → slave prepares, then Master writes SBUF, waits TI, Slave reads SBUF after RI, acknowledge. Bit rate = Fosc/12. Direction reversal requires swapping master/slave role.

Limitations: Not full-duplex; need external direction control and synchronization; suitable for short distance board-to-board; for robust, prefer modes 1-3.

Similar questions

AI LearningWeb Platform

Coursify — Personal AI Course Generator

Struggling with a difficult subject or concept? Turn any engineering topic into a structured course with interactive lessons, quizzes, and research-backed explanations.