Upgrade to Pro — share decks privately, control downloads, hide ads and more …

Introduction to Microcontroller

Avatar for Anjali Magdum Anjali Magdum
September 03, 2026
0

Introduction to Microcontroller

Introduction to Microcontroller, architecture overview of 8051, SFR,PSW

Avatar for Anjali Magdum

Anjali Magdum

September 03, 2026

Transcript

  1. • • • • • • • • • •

    • • • • • • • • All Blocks of 8051 Microcontroller with Block-wise Pin Functions Block Diagram of 8051 Microcontroller 8051 MICROCONTROLLER CPU (ALU, CU, Registers) Program Memory (ROM/Flash) Data Memory (RAM) Timers/Counters (T0, T1) Serial Port (UART) Interrupt Controller I/O Ports (P0, P1, P2, P3) Oscillator & Clock Reset Circuit
  2. • CPU (Central Processing Unit) • Function • The CPU

    is the brain of the microcontroller. It fetches, decodes, and executes instructions. • Components • ALU (Arithmetic Logic Unit) • Control Unit • Accumulator (A) • B Register • Program Counter (PC) • Stack Pointer (SP) • Program Status Word (PSW) • Instruction Decoder •
  3. • • • • • • • • • •

    • • • • • Pins Associated with CPU Pin Function XTAL1 Clock input to CPU XTAL2 Clock output RST Resets CPU and registers 2. Program Memory (ROM/Flash) Function Stores the user program permanently. Pins Pin Function EA (External Access) EA = 1 uses internal ROM, EA = 0 uses external ROM PSEN Enables external program memory Port 0 Lower address/data bus (A0–A7 / D0–D7) Port 2 Higher address bus (A8–A15)
  4. • • • • • • • • • •

    • • 3. Data Memory (RAM) Function Stores temporary data, variables, stack, and register banks. Pins No dedicated pins. RAM is accessed internally by the CPU. 4. Input/Output (I/O) Ports The 8051 has 32 I/O pins divided into four 8-bit ports. Port 0 (P0.0–P0.7) Pins P0.0 P0.1P0.2 P0.3 P0.4 P0.5 P0.6P0.7 Functions General-purpose I/O Multiplexed Address/Data bus (AD0–AD7)
  5. • Requires external pull-up resistors • • • • •

    • • • • • • • • Port 1 (P1.0–P1.7) Pins P1.0 P1.1 P1.2 P1.3 P1.4 P1.5 P1.6 P1.7 Functions General-purpose I/O Internal pull-up resistors provided No alternate functions in standard 8051 Port 2 (P2.0–P2.7) Pins P2.0 P2.1 P2.2 P2.3 P2.4 P2.5 P2.6 P2.7 Functions General-purpose I/O Higher address bus (A8–A15) during external memory access
  6. • Port 3 (P3.0–P3.7) • Pin Alternate Function • P3.0

    RXD (Serial Receive) • P3.1TXD (Serial Transmit) • P3.2INT0 (External Interrupt 0) • P3.3INT1 (External Interrupt 1) • P3.4T0 (Timer 0 Input) • P3.5T1 (Timer 1 Input) • P3.6 WR (External Memory Write) • P3.7 RD (External Memory Read)
  7. • • • • • • • • • •

    • 5. Timers/Counters Function Used for: Time delay generation Event counting Baud rate generation Pulse measurement Pins Pin Function P3.4Timer 0 external input (T0) P3.5Timer 1 external input (T1)
  8. • • • • • • • • • •

    • • • • • • • • . Serial Communication (UART) Function Provides serial communication with PCs and other devices. Pins Pin Function P3.0 RXD (Receive Data) P3.1TXD (Transmit Data) 7. Interrupt Controller Function Responds to external and internal interrupt requests. Pins Pin Function P3.2External Interrupt 0 (INT0) P3.3External Interrupt 1 (INT1) Internal interrupt sources: Timer 0 Timer 1 Serial Port 6
  9. • • • • • • • • • •

    • • • • • • • • • 8. Oscillator and Clock Circuit Function Generates the clock signal required for instruction execution. Pins Pin Function XTAL1 Crystal oscillator input XTAL2 Crystal oscillator output Typically, an 11.0592 MHz or 12 MHz crystal is connected between XTAL1 and XTAL2. 9. Reset Circuit Function Initializes the microcontroller and starts program execution from address 0000H. Pin Function RST Active-high reset input; keep high for at least two machine cycles 10. External Memory Interface Function Allows interfacing with external ROM and RAM. Pins Pin Function ALE Address Latch Enable (demultiplexes Port 0 address/data bus)
  10. • • • • • • • • • •

    • • • • • • 10. External Memory Interface Function Allows interfacing with external ROM and RAM. Pins Pin Function ALE Address Latch Enable (demultiplexes Port 0 address/data bus) PSEN Program Store Enable (reads external program memory) EA Selects internal/external program memory WR External RAM Write RD External RAM Read Port 0 Address/Data bus (AD0–AD7) Port 2 Address bus (A8–A15) 11. Power Supply Block Function Provides power to the microcontroller
  11. • • • • • • • • • •

    • • • • • • • PinsPin Function VCC +5 V power supply GND Ground (0 V reference) Summary of Important 8051 Pins Pin Function VCC +5 V supply , GND Ground XTAL1 Oscillator input , XTAL2 Oscillator output RST Reset , EA Internal/External ROM select ALE Address Latch Enable PSEN External Program Memory Enable P0.0–P0.7 I/O or AD0–AD7 P1.0–P1.7 General-purpose I/O P2.0–P2.7 I/O or A8–A15 P3.0 RXD ,P3.1TXD P3.2INT0,P3.3INT1 P3.4T0 ,P3.5T1 P3.6 WR ,P3.7 RD