Opens in a new tab

AT89S51

8-bit 8051 MCU, 4KB ISP Flash, 128B RAM, 32 I/O, 2 timers, UART, watchdog timer, dual DPTR, 33MHz, ISP programming, PDIP-40, Atmel AT89S51.

15000

Effective Inventory

Image for reference only

Manufacturer Part:

AT89S51

Package:

PDIP-40 / TQFP-44 / PLCC-44

Quality Commitment

Shipping & Payment

Service & Packaging

Product Manual

Description

Product Overview

The AT89S51 is a low-power, high-performance CMOS 8-bit microcontroller from Atmel (now Microchip) featuring 4KB of In-System Programmable (ISP) Flash memory. As an enhanced successor to the classic AT89C51, the AT89S51 maintains full compatibility with the 80C51 instruction set and pinout while adding significant improvements including serial ISP programming, a watchdog timer, dual data pointers, and a power-off flag. The device integrates 128 bytes of internal RAM, 32 general-purpose I/O lines, two 16-bit timer/counters, a full-duplex UART serial port, and six interrupt sources with two priority levels. With a maximum operating frequency of 33MHz, the AT89S51 delivers approximately 3 MIPS of throughput. The ISP feature allows programming the Flash memory in-circuit via a simple SPI-compatible serial interface (MOSI/MISO/SCK on Port 1 pins 5/6/7), eliminating the need for a separate high-voltage parallel programmer. The device supports low-power Idle and Power-down modes, with Power-down mode supporting interrupt recovery. The AT89S51 is available in PDIP-40, TQFP-44, and PLCC-44 packages, making it suitable for both through-hole prototyping and surface-mount production. This device is still in production status and is widely used in cost-sensitive embedded control applications.

Key Specifications

Parameter Conditions Min Typ Max Unit
Core Architecture 8-bit 80C51 (MCS-51 compatible)
Operating Voltage (VCC) 4.0 5.0 5.5 V
Clock Frequency 0 Hz to max 0 33 MHz
Flash Program Memory In-System Programmable 4 KB (4096 bytes)
Flash Endurance Write/Erase cycles 1000 cycles
Flash Data Retention 10 years
Internal RAM 128 x 8-bit (128 bytes)
External Memory Code + Data 64KB each (addressable)
Program Memory Lock 3-level lock bits
I/O Pins 4 ports x 8 bits 32 programmable I/O lines
Timer/Counter 0 16-bit 16-bit Timer/Counter (4 modes)
Timer/Counter 1 16-bit 16-bit Timer/Counter (4 modes)
Total Timers Two 16-bit timer/counters
Serial Port (UART) Full duplex 1 UART (Mode 0/1/2/3)
Interrupt Sources 6 interrupt sources, 2 priority levels
Watchdog Timer (WDT) Yes, built-in
Dual Data Pointer Yes (DPTR0, DPTR1)
Power-off Flag Yes (POF flag)
In-System Programming (ISP) Serial via SPI pins Yes (MOSI/MISO/SCK on P1.5/6/7)
ISP Mode Byte mode and Page mode
Oscillator External crystal / RC oscillator
Idle Mode Current mA
Power-down Mode Current μA
Power-down Recovery Interrupt and hardware reset wake-up
Operating Temperature -40 +85 °C
Package PDIP-40, TQFP-44, PLCC-44

Features

  • Compatible with MCS-51 (80C51) products – instruction set and pinout
  • 4KB bytes of In-System Programmable (ISP) Flash memory
  • 1,000 write/erase cycles endurance
  • 128 x 8-bit internal RAM
  • Three-level program memory lock
  • 32 programmable I/O lines
  • Two 16-bit timer/counters (T0, T1)
  • Six interrupt sources with two priority levels
  • Full-duplex UART serial channel
  • Watchdog Timer (WDT) with on-chip oscillator
  • Dual Data Pointer (DPTR0, DPTR1) for efficient memory access
  • Power-off Flag (POF) for brown-out detection
  • Interrupt recovery from Power-down mode
  • Fully static operation: 0 Hz to 33 MHz
  • Low-power Idle and Power-down modes
  • On-chip oscillator and clock circuitry
  • Fast programming time
  • Flexible ISP programming (byte and page mode)
  • ISP interface on P1.5 (MOSI), P1.6 (MISO), P1.7 (SCK)
  • Available in PDIP-40, TQFP-44, PLCC-44 packages
  • Industrial temperature range (-40 to +85°C)

Applications

  • Embedded control systems
  • Industrial automation
  • Consumer electronics
  • Home appliances
  • IoT and smart sensors
  • LED lighting control
  • Motor control
  • Security systems
  • Development boards and education
  • Battery chargers
  • Toys and games
  • Power supply controllers
Product Introduction: AT89S51 Product Introduction

The AT89S51 is an enhanced 8-bit microcontroller from Atmel (now Microchip Technology), based on the classic 80C51 architecture with added features including In-System Programmable (ISP) Flash, watchdog timer, and dual data pointers. It provides 4KB of ISP Flash program memory that can be programmed in-circuit via a simple serial interface (MOSI/MISO/SCK on P1.5/6/7 pins), eliminating the need for removal from the circuit board or a high-voltage parallel programmer. The device includes 128 bytes of internal RAM, 32 general-purpose I/O lines organized into four 8-bit ports, two 16-bit timer/counters with four operating modes each, a full-duplex UART, and six interrupt sources with two priority levels. Key enhancements over the older AT89C51 include: a built-in watchdog timer for system reliability, dual data pointers (DPTR0/DPTR1) for more efficient memory block operations, a power-off flag for detecting brown-out conditions, and interrupt recovery from power-down mode. With a maximum clock frequency of 33MHz, the AT89S51 achieves approximately 3 MIPS throughput. The device supports two power-saving modes: Idle mode stops the CPU while maintaining RAM, timers, serial port, and interrupt system; Power-down mode saves RAM contents while halting the oscillator, consuming minimal power and can be awakened by external interrupt or hardware reset. The AT89S51 is still in active production and is available in PDIP-40, TQFP-44, and PLCC-44 packages, serving a wide range of cost-sensitive embedded control applications from industrial automation to consumer electronics.

Working Principle: AT89S51 Working Principle

The AT89S51 is based on the standard 80C51 Harvard architecture with separate program and data memory spaces, featuring 12 clock cycles per machine cycle. The CPU fetches instructions from the 4KB Flash program memory through an 8-bit program memory bus, executing them with an 8-bit ALU. A key improvement over the AT89C51 is the dual data pointer feature (DPTR0 and DPTR1), which allows fast switching between two 16-bit data pointers for efficient memory block copy and table lookup operations via the AUXR1 register. The watchdog timer (WDT) is a 14-bit counter with a 3-bit prescaler that generates a reset if not periodically refreshed by software, providing system fail-safe protection. The ISP programming feature allows reprogramming the Flash memory while the chip remains in the target circuit: when RST is held high, a serial programming interface on P1.5 (MOSI), P1.6 (MISO), and P1.7 (SCK) is activated, supporting both byte-level and page-level programming operations. The maximum ISP clock frequency is 1/16 of the system clock. Power-down mode can be exited by either a hardware reset or an external interrupt — a significant improvement over the AT89C51 which only supported reset wake-up. The power-off flag (POF) in the PCON register is set by hardware when VCC drops below the power-off threshold, enabling software to detect and handle brown-out conditions. Port 0 is open-drain and serves as the multiplexed low address/data bus for external memory access, requiring external pull-up resistors when used as general-purpose I/O.

Pin Description: AT89S51 Pin Definition and Functions

PDIP-40 pinout (through-hole package):

Pin No. Name Type Description
1-4 P1.0 – P1.3 I/O Port 1 bits 0-3 (general purpose I/O with internal pull-ups)
5 P1.4 I/O Port 1 bit 4
6 P1.5 / MOSI I/O Port 1 bit 5 / ISP MOSI input
7 P1.6 / MISO I/O Port 1 bit 6 / ISP MISO output
8 P1.7 / SCK I/O Port 1 bit 7 / ISP SCK clock input
9 RST Input Reset input (active high)
10 P3.0 / RXD I/O Port 3 bit 0 / UART receive
11 P3.1 / TXD I/O Port 3 bit 1 / UART transmit
12 P3.2 / INT0 I/O Port 3 bit 2 / External interrupt 0
13 P3.3 / INT1 I/O Port 3 bit 3 / External interrupt 1
14 P3.4 / T0 I/O Port 3 bit 4 / Timer 0 input
15 P3.5 / T1 I/O Port 3 bit 5 / Timer 1 input
16 P3.6 / WR I/O Port 3 bit 6 / External RAM write strobe
17 P3.7 / RD I/O Port 3 bit 7 / External RAM read strobe
18 XTAL2 Output Oscillator output (crystal connection)
19 XTAL1 Input Oscillator input / external clock input
20 GND Power Ground (0V)
21-28 P2.0 – P2.7 I/O Port 2 bits 0-7 / High address byte (A8-A15) for external memory
29 PSEN Output Program Store Enable, active low (external code read)
30 ALE/PROG Output Address Latch Enable output / Programming pulse (ISP)
31 EA/VPP Input External Access enable (high = internal Flash first)
32-39 P0.0 – P0.7 I/O Port 0 bits 0-7 / Multiplexed address/data bus (AD0-AD7), open-drain
40 VCC Power Supply voltage (+4.0V to +5.5V)
Application Scenarios: In which products and applications is AT89S51 used
  • Industrial automation and process control
  • Consumer electronics and home appliances
  • IoT sensor nodes and smart devices
  • LED lighting and display control
  • DC motor and stepper motor control
  • Security and access control systems
  • Battery chargers and power management
  • Educational platforms and training kits
  • Hobbyist projects and prototyping
  • White goods control
  • Automotive aftermarket accessories
  • Simple data acquisition systems
Alternative Models: What chips are recommended as replacements for AT89S51
Model Manufacturer Key Difference
AT89S52 Atmel/Microchip 8KB Flash, 256B RAM, 3 timers, Timer 2 (bigger brother)
AT89C51 Atmel Classic version, no ISP, no WDT (parallel programming only)
STC89C52RC STC Chinese 8051 with ISP, 8KB Flash, enhanced features
AT89LP51 Atmel Enhanced single-cycle 8051 core, lower power
STC15W408AS STC Enhanced 8051, 1T architecture, 8KB Flash

Recommend Parts

ISO1176TDWR

Isolated RS-485 transceiver, 40Mbps, integrated transformer driver, SOIC-16

Brand: TI

Package: SOIC-16 (DW, wide-body, 10.3 x 10.3 mm)

IN STOCK: 6874pcs

Cargo cycle: 3-7 Days

The minimum order is 1

IRFB4020PBF

200V N-Channel HEXFET Power MOSFET, 31A, 68 mΩ RDS(on), TO-220AB

Brand: infineon

Package: TO-220AB

IN STOCK: 14149pcs

Cargo cycle: 3-7 Days

The minimum order is 1

NRF52832-QFAA-T

Nordic BLE SoC, ARM Cortex-M4 @ 64MHz, 64KB Flash, 32KB RAM, QFN-48

Package: See datasheet

IN STOCK: 10958pcs

Cargo cycle: 3-7 Days

The minimum order is 1

UCC28740DR

CVCC Flyback Controller, 700V startup, opto feedback, <10mW no-load, SOIC-7

Brand: TI

Package: SOIC-7 (4.9 x 3.9 x 1.75 mm)

IN STOCK: 4840pcs

Cargo cycle: 3-7 Days

The minimum order is 1

MMUN2211LT1G

NPN digital transistor, R1=10kΩ R2=10kΩ, 50V, 100mA, SOT-23-3, pre-biased BRT switch

Brand: Onsemi

Package: SOT-23-3 (TO-236, SC-59)

IN STOCK: 8500pcs

Cargo cycle: 3-7 Days

The minimum order is 1

TMS320F2810PBKA

C2000 Delfino DSP controller, 150MHz, 128KB Flash, BGA-179

Brand: TI

Package: BGA-179 (16 x 16 mm, PBK package)

IN STOCK: 3124pcs

Cargo cycle: 3-7 Days

The minimum order is 1