Spark Logic

Atmel AT89C52 pinout

Pinout, electrical limits and connections for the Atmel AT89C52, an MCS-51-compatible controller with 8 KiB Flash, 256 bytes of RAM and three 16-bit timer/counters.

PDIP-40 40 contacts
PLCC-44 44 contacts
TQFP-44 44 contacts

PQFP-44

44 contacts Current package

Atmel · 44Q, 0.80 mm lead pitch, 12.95–13.45 mm lead span and 2.45 mm maximum height. Ordering suffix Q.

Up to 24 MHz, 4.0–6.0 V. AT89C52-24QC: 0–70 °C. AT89C52-24QI: −40–85 °C. 8 KiB Flash and 256 B RAM.

PQFP-44 pinout

PQFP-44
Top view, index corner at upper left. Pin 1 is the topmost lead on the left edge. Scroll the map to reach all contacts.
Selected pin details

9 · P3.3

Bidirectional · Bidirectional

Quasi-bidirectional I/O with internal pull-up. A latch value of 1 releases the pin for input. INT1 accepts external interrupt 1 and can gate Timer 1. Keep the corresponding latch bit at 1 for the alternate function.

After reset · Latch = 1. Pulled HIGH when the pin is unloaded and used as GPIO.

Atmel 0313H–02/00, pp. 1, 3–5

Electrical limits · Link to this pin

All 44 pins

PinSignalDirectionFunction
1P1.5 BidirectionalBidirectional Quasi-bidirectional I/O with internal pull-up. A latch value of 1 releases the pin for input.
2P1.6 BidirectionalBidirectional Quasi-bidirectional I/O with internal pull-up. A latch value of 1 releases the pin for input.
3P1.7 BidirectionalBidirectional Quasi-bidirectional I/O with internal pull-up. A latch value of 1 releases the pin for input.
4RST InputInput Active-high reset. Hold HIGH for at least two machine cycles after the oscillator is running. A valid reset starts code at 0000h.
5P3.0 BidirectionalBidirectional Quasi-bidirectional I/O with internal pull-up. A latch value of 1 releases the pin for input. RXD receives UART data in asynchronous modes and carries serial data in shift-register mode. Keep the corresponding latch bit at 1 for the alternate function.
6NC NoneNone No connection in the package pinout. Leave this lead unconnected.
7P3.1 BidirectionalBidirectional Quasi-bidirectional I/O with internal pull-up. A latch value of 1 releases the pin for input. TXD sends UART data in asynchronous modes and supplies shift clock in mode 0. Keep the corresponding latch bit at 1 for the alternate function.
8P3.2 BidirectionalBidirectional Quasi-bidirectional I/O with internal pull-up. A latch value of 1 releases the pin for input. INT0 accepts external interrupt 0 and can gate Timer 0. Keep the corresponding latch bit at 1 for the alternate function.
9P3.3 BidirectionalBidirectional Quasi-bidirectional I/O with internal pull-up. A latch value of 1 releases the pin for input. INT1 accepts external interrupt 1 and can gate Timer 1. Keep the corresponding latch bit at 1 for the alternate function.
10P3.4 BidirectionalBidirectional Quasi-bidirectional I/O with internal pull-up. A latch value of 1 releases the pin for input. T0 accepts external Timer 0 count pulses. Keep the corresponding latch bit at 1 for the alternate function.
11P3.5 BidirectionalBidirectional Quasi-bidirectional I/O with internal pull-up. A latch value of 1 releases the pin for input. T1 accepts external Timer 1 count pulses. Keep the corresponding latch bit at 1 for the alternate function.
12P3.6 BidirectionalBidirectional Quasi-bidirectional I/O with internal pull-up. A latch value of 1 releases the pin for input. /WR strobes writes to external data memory. Keep the corresponding latch bit at 1 for the alternate function.
13P3.7 BidirectionalBidirectional Quasi-bidirectional I/O with internal pull-up. A latch value of 1 releases the pin for input. /RD strobes reads from external data memory. Keep the corresponding latch bit at 1 for the alternate function.
14XTAL2 OutputOutput Oscillator-amplifier output. Leave unconnected when driving XTAL1 from an external clock.
15XTAL1 InputInput Oscillator-amplifier input. Apply an external clock here when using the external-drive configuration.
16GND ReferenceReference Circuit ground and return for the supply, clock and logic signals.
17NC NoneNone No connection in the package pinout. Leave this lead unconnected.
18P2.0 BidirectionalBidirectional Quasi-bidirectional I/O with internal pull-up. A latch value of 1 releases the pin for input. Outputs A8 during external code fetches and 16-bit external data accesses. For MOVX @Ri it outputs the P2 latch value.
19P2.1 BidirectionalBidirectional Quasi-bidirectional I/O with internal pull-up. A latch value of 1 releases the pin for input. Outputs A9 during external code fetches and 16-bit external data accesses. For MOVX @Ri it outputs the P2 latch value.
20P2.2 BidirectionalBidirectional Quasi-bidirectional I/O with internal pull-up. A latch value of 1 releases the pin for input. Outputs A10 during external code fetches and 16-bit external data accesses. For MOVX @Ri it outputs the P2 latch value.
21P2.3 BidirectionalBidirectional Quasi-bidirectional I/O with internal pull-up. A latch value of 1 releases the pin for input. Outputs A11 during external code fetches and 16-bit external data accesses. For MOVX @Ri it outputs the P2 latch value.
22P2.4 BidirectionalBidirectional Quasi-bidirectional I/O with internal pull-up. A latch value of 1 releases the pin for input. Outputs A12 during external code fetches and 16-bit external data accesses. For MOVX @Ri it outputs the P2 latch value.
23P2.5 BidirectionalBidirectional Quasi-bidirectional I/O with internal pull-up. A latch value of 1 releases the pin for input. Outputs A13 during external code fetches and 16-bit external data accesses. For MOVX @Ri it outputs the P2 latch value.
24P2.6 BidirectionalBidirectional Quasi-bidirectional I/O with internal pull-up. A latch value of 1 releases the pin for input. Outputs A14 during external code fetches and 16-bit external data accesses. For MOVX @Ri it outputs the P2 latch value.
25P2.7 BidirectionalBidirectional Quasi-bidirectional I/O with internal pull-up. A latch value of 1 releases the pin for input. Outputs A15 during external code fetches and 16-bit external data accesses. For MOVX @Ri it outputs the P2 latch value.
26PSEN OutputOutput Active-low external program-memory read strobe. It enables instruction bytes onto Port 0 during external fetches.
27ALE OutputOutput Address Latch Enable (ALE/PROG). It strobes the low address byte into the external latch. Bit 0 at SFR 8Eh suppresses idle ALE pulses during internal execution. PROG is a separate Flash programming mode.
28NC NoneNone No connection in the package pinout. Leave this lead unconnected.
29EA InputInput External Access (EA/VPP). Strap HIGH for internal Flash at 0000h–1FFFh or LOW for external code from 0000h. The 12 V programming level applies only to the documented programming mode.
30P0.7 BidirectionalBidirectional Open-drain GPIO. Latch 1 releases the output, so add an external pull-up when a driven HIGH is required. AD7 carries the multiplexed low address bit and data bit during external memory cycles, with an internal pull-up for bus operation.
31P0.6 BidirectionalBidirectional Open-drain GPIO. Latch 1 releases the output, so add an external pull-up when a driven HIGH is required. AD6 carries the multiplexed low address bit and data bit during external memory cycles, with an internal pull-up for bus operation.
32P0.5 BidirectionalBidirectional Open-drain GPIO. Latch 1 releases the output, so add an external pull-up when a driven HIGH is required. AD5 carries the multiplexed low address bit and data bit during external memory cycles, with an internal pull-up for bus operation.
33P0.4 BidirectionalBidirectional Open-drain GPIO. Latch 1 releases the output, so add an external pull-up when a driven HIGH is required. AD4 carries the multiplexed low address bit and data bit during external memory cycles, with an internal pull-up for bus operation.
34P0.3 BidirectionalBidirectional Open-drain GPIO. Latch 1 releases the output, so add an external pull-up when a driven HIGH is required. AD3 carries the multiplexed low address bit and data bit during external memory cycles, with an internal pull-up for bus operation.
35P0.2 BidirectionalBidirectional Open-drain GPIO. Latch 1 releases the output, so add an external pull-up when a driven HIGH is required. AD2 carries the multiplexed low address bit and data bit during external memory cycles, with an internal pull-up for bus operation.
36P0.1 BidirectionalBidirectional Open-drain GPIO. Latch 1 releases the output, so add an external pull-up when a driven HIGH is required. AD1 carries the multiplexed low address bit and data bit during external memory cycles, with an internal pull-up for bus operation.
37P0.0 BidirectionalBidirectional Open-drain GPIO. Latch 1 releases the output, so add an external pull-up when a driven HIGH is required. AD0 carries the multiplexed low address bit and data bit during external memory cycles, with an internal pull-up for bus operation.
38VCC SupplySupply Connect to the regulated positive supply. Place the bypass capacitor close to VCC and ground.
39NC NoneNone No connection in the package pinout. Leave this lead unconnected.
40P1.0 BidirectionalBidirectional Quasi-bidirectional I/O with internal pull-up. A latch value of 1 releases the pin for input. T2 is the Timer 2 external count input or clock output in the corresponding Timer 2 mode.
41P1.1 BidirectionalBidirectional Quasi-bidirectional I/O with internal pull-up. A latch value of 1 releases the pin for input. T2EX is the Timer 2 capture/reload trigger or up/down direction control in the corresponding Timer 2 mode.
42P1.2 BidirectionalBidirectional Quasi-bidirectional I/O with internal pull-up. A latch value of 1 releases the pin for input.
43P1.3 BidirectionalBidirectional Quasi-bidirectional I/O with internal pull-up. A latch value of 1 releases the pin for input.
44P1.4 BidirectionalBidirectional Quasi-bidirectional I/O with internal pull-up. A latch value of 1 releases the pin for input.

Signal assignments

Asynchronous UART

Fixed mapping. P3.0/RXD is input and P3.1/TXD is output. Set both P3 latch bits to 1. For mode 1 with reception enabled, set SCON = 50h and configure the baud generator before use.

Synchronous serial

Fixed mapping. In serial mode 0, RXD is bidirectional shift data and TXD outputs the shift clock. Set SM0 = 0 and SM1 = 0 in SCON, and leave both P3 latch bits at 1.

External interrupts

P3.2/INT0 and P3.3/INT1 are independent active-low inputs. Keep both latch bits high. IT0 and IT1 in TCON select low-level (0) or falling-edge (1) operation. Set the respective EX bit and global EA in IE to enable the interrupt.

Timer 0 and 1 inputs

P3.4/T0 and P3.5/T1 accept external counts when the respective C/T bit in TMOD is 1. The corresponding INT pin is a separate gate input when GATE is set. Keep each used port latch bit at 1.

Timer 2

P1.0/T2 is the external counter input when T2CON.C/T2 = 1. In clock-output mode it is the output when T2MOD.T2OE = 1 and C/T2 = 0. P1.1/T2EX can trigger capture or reload when enabled, or control the direction in up/down mode.

Parallel Flash programming

P1 carries A0–A7 and P2.0–P2.4 carry A8–A12. P0 carries the data byte. P2.6, P2.7, P3.6 and P3.7 select programming or verify mode with RST high and PSEN low. ALE/PROG receives the write pulse and P3.4 reports ready/busy. Match the EA/VPP mode to the actual top-side marking and signature in the datasheet.

Electrical limits

ParameterLimitConditions and source
VCC operating range4.0–6.0 V4.0–6.0 V Referenced to GND. Commercial codes are specified at 0–70 °C, industrial codes at −40–85 °C. Atmel AT89C52, 0313H–02/00, pp. 17, 22
Oscillator frequency0 Hz to marked speed grade0 Hz to marked speed grade 12, 16, 20 or 24 MHz maximum depending on ordering code. Clock stopped at 0 Hz cannot advance the reset sequencer. Atmel AT89C52, 0313H–02/00, pp. 1, 20, 22
Digital inputsVIL ≤ 0.2 × VCC − 0.1 V, VIH ≥ 0.2 × VCC + 0.9 VVIL ≤ 0.2 × VCC − 0.1 V, VIH ≥ 0.2 × VCC + 0.9 V General digital pins. For EA, VIL ≤ 0.2 × VCC − 0.3 V. For XTAL1 and RST, VIH ≥ 0.7 × VCC. Atmel AT89C52, 0313H–02/00, p. 17
Output LOW≤ 0.45 V≤ 0.45 V At 1.6 mA sink for P1–P3 and 3.2 mA for P0, ALE and PSEN. Larger loads can raise VOL. Atmel AT89C52, 0313H–02/00, p. 17
Output HIGH≥ 2.4 V≥ 2.4 V VCC = 4.5–5.5 V. At 60 µA source for P1–P3, ALE and PSEN. At 800 µA for P0 in external-bus mode. P0 GPIO HIGH is set by its external pull-up. Atmel AT89C52, 0313H–02/00, p. 17
Steady-state sink current ceilings10 mA/pin, 26 mA P0, 15 mA each P1–P3, 71 mA total10 mA/pin, 26 mA P0, 15 mA each P1–P3, 71 mA total Design for the lower VOL test currents when the specified logic LOW is required. Atmel AT89C52, 0313H–02/00, p. 17 note 1
ResetRST HIGH for ≥ 24 oscillator periodsRST HIGH for ≥ 24 oscillator periods After the clock is running. PC restarts at 0000h, port latches become FFh. RST has a 50–300 kΩ internal pulldown. Atmel AT89C52, 0313H–02/00, pp. 3–4, 17
Active supply current25 mA maximum25 mA maximum At 12 MHz, DC characteristics. Budget separately for external loads and oscillator circuitry. Atmel AT89C52, 0313H–02/00, p. 17

Models and documents

This reference resolves the abbreviated 89C52 name to Atmel’s AT89C52, document 0313H. It covers all four package drawings and the listed 12/16/20/24 MHz speed grades. Check the full marking on parts from other manufacturers. The AT89S52 uses its own programming interface and datasheet.

AT89C52-12
Up to 12 MHz, 4.0–6.0 V. AT89C52-12QC: 0–70 °C. AT89C52-12QI: −40–85 °C. 8 KiB Flash and 256 B RAM.
AT89C52-16
Up to 16 MHz, 4.0–6.0 V. AT89C52-16QC: 0–70 °C. AT89C52-16QI: −40–85 °C. 8 KiB Flash and 256 B RAM.
AT89C52-20
Up to 20 MHz, 4.0–6.0 V. AT89C52-20QC: 0–70 °C. AT89C52-20QI: −40–85 °C. 8 KiB Flash and 256 B RAM.
AT89C52-24
Up to 24 MHz, 4.0–6.0 V. AT89C52-24QC: 0–70 °C. AT89C52-24QI: −40–85 °C. 8 KiB Flash and 256 B RAM.
  • Datasheet for AT89C52· Atmel 0313H–02/00, February 2000. Pin configurations p. 1, pin descriptions pp. 3–4, SFR reset p. 5, Timer 2 pp. 6–10, oscillator p. 12, DC p. 17, clock drive p. 20, ordering and package drawings pp. 22–23. SHA-256 f8d392b5cc25322766180e74d323b5c8abd647c98f9d4fbfc6f99a7d1f89e4bd.
  • Intel MCS-51 Family User’s Manual· Intel 272383-002, February 1994, chapter 3. Core operation, port latches and serial interface. The AT89C52 datasheet governs its own electrical limits and Timer 2 extensions.