Page 1
The on-chip Flash allows the program memory to be reprogrammed in-system or by a conventional nonvolatile memory programmer. By combining a versatile 8-bit CPU AT89C52 with Flash on a monolithic chip, the Atmel AT89C52 is a powerful microcomputer which provides a highly flexible and cost effective solution to many embedded control applications.
TMP2 TMP1 INCREMENTER INTERRUPT, SERIAL PORT, AND TIMER BLOCKS PROGRAM COUNTER PSEN TIMING ALE/PROG INSTRUCTION DPTR REGISTER CONTROL EA / V PORT 1 PORT 3 LATCH LATCH PORT 1 DRIVERS PORT 3 DRIVERS P1.0 - P1.7 P3.0 - P3.7 AT89C52...
The Port 2 output buffers can sink/source four TTL inputs. circuitry. In addition, the AT89C52 is designed with static When 1s are written to Port 2 pins, they are pulled high by logic for operation down to zero frequency and supports the internal pullups and can be used as inputs.
Page 4
Input to the inverting oscillator amplifier and input to the gram memory. internal clock operating circuit. When the AT89C52 is executing code from external pro- XTAL2 gram memory, PSEN is activated twice each machine cy- Output from the inverting oscillator amplifier.
Data Memory For example, the following direct addressing instruction accesses the SFR at location 0A0H (which is P2). The AT89C52 implements 256 bytes of on-chip RAM. The MOV 0A0H, #data upper 128 bytes occupy a parallel address space to the Instructions that use indirect addressing access the upper Special Function Registers.
Page 6
The new count value appears in the Timer 0 and Timer 1 in the AT89C52 operate the same register during S3P1 of the cycle following the one in way as Timer 0 and Timer 1 in the AT89C51.
Page 7
AT89C52 Auto-Reload (Up or Down Counter) (Continued) overflow also causes the timer registers to be reloaded RCAP2H and RCAP2L to be reloaded into the timer regis- with the 16-bit value in RCAP2H and RCAP2L. The values ters, TH2 and TL2, respectively.
Page 8
NOTE: OSC. FREQ. IS DIVIDED BY 2, NOT 12 SMOD1 ÷ C/T2 = 0 "1" "0" RCLK CLOCK CONTROL ÷ C/T2 = 1 "1" "0" T2 PIN TCLK RCAP2H RCAP2L CLOCK TRANSITION ÷ DETECTOR TIMER 2 T2EX PIN EXF2 INTERRUPT CONTROL EXEN2 AT89C52...
Page 9
AT89C52 however, it increments every state time (at 1/2 the oscilla- Baud Rate Generator tor frequency). The baud rate formula is given below. Timer 2 is selected as the baud rate generator by setting Modes 1 and 3 Oscillator Frequency TCLK and/or RCLK in T2CON (Table 2).
Page 10
External interrupt 0 enable bit. UART User software should never write 1s to unimplemented bits, because they may be used in future AT89 products. The UART in the AT89C52 operates the same way as the UART in the AT89C51. Figure 6. Interrupt Sources Interrupts...
AT89C52 Oscillator Characteristics Figure 7. Oscillator Connections XTAL1 and XTAL2 are the input and output, respectively, of an inverting amplifier that can be configured for use as XTAL2 an on-chip oscillator, as shown in Figure 7. Either a quartz crystal or ceramic resonator may be used. To drive the...
Page 12
Program Memory Lock Bits The AT89C52 has three lock bits that can be left unpro- powered up without a reset, the latch initializes to a ran- grammed (U) or can be programmed (P) to obtain the ad- dom value and holds that value until reset is activated. The ditional features listed in the following table.
All major programming vendors offer worldwide support ten with all 1s. The chip erase operation must be executed for the Atmel microcontroller series. Please contact your before the code memory can be reprogrammed. local programming vendor for the appropriate software re- Reading the Signature Bytes: The signature bytes are vision.
Pins are not guaranteed to sink Maximum I per 8-bit port: current greater than the listed test conditions. Port 0:26 mA 2. Minimum V for Power Down is 2 V. Ports 1,2, 3:15 mA AT89C52...
Page 17
AT89C52 A.C. Characteristics Under operating conditions, load capacitance for Port 0, ALE/PROG, and PSEN = 100 pF; load capacitance for all other outputs = 80 pF. External Program and Data Memory Characteristics 12 MHz Oscillator Variable Oscillator Symbol Parameter Units...
Page 18
AVLL RLAZ RHDX A0 - A7 FROM RI OR DPL DATA IN A0 - A7 FROM PCL INSTR IN PORT 0 AVWL AVDV PORT 2 P2.0 - P2.7 OR A8 - A15 FROM DPH A8 - A15 FROM PCH AT89C52...
AT89C52 External Data Memory Cycle LHLL WHLH PSEN LLWL WLWH LLAX QVWX WHQX AVLL QVWH PORT 0 A0 - A7 FROM RI OR DPL DATA OUT A0 - A7 FROM PCL INSTR IN AVWL PORT 2 P2.0 - P2.7 OR A8 - A15 FROM DPH...
Page 20
100-mV change from load voltage occurs. A urements are made at V min. for a logic 1 and port pin begins to float when a 100-mV change from max. for a logic 0. the loaded V level occurs. AT89C52...
Need help?
Do you have a question about the AT89C52 and is the answer not in the manual?
Questions and answers