at89s52-33sc ATMEL Corporation, at89s52-33sc Datasheet
![no-image](/images/manufacturer_photos/0/0/79/atmel_corporation_sml.jpg)
at89s52-33sc
Related parts for at89s52-33sc
at89s52-33sc Summary of contents
Page 1
... RAM, 32 I/O lines, Watchdog timer, two data pointers, three 16-bit timer/counters, a six-vector two-level interrupt architecture, a full duplex serial port, on-chip oscillator, and clock circuitry. In addition, the AT89S52 is designed with static logic for operation down to zero frequency and supports two software selectable power saving modes. ...
Page 2
... GND 20 21 2.2 44-lead TQFP (MOSI) P1.5 1 (MISO) P1.6 2 (SCK) P1.7 3 RST 4 (RXD) P3 (TXD) P3.1 7 (INT0) P3.2 8 (INT1) P3.3 9 (T0) P3.4 10 (T1) P3.5 11 AT89S52 2 2.3 44-lead PLCC VCC P0.0 (AD0) P0.1 (AD1) P0.2 (AD2) P0.3 (AD3) P0.4 (AD4) P0.5 (AD5) P0.6 (AD6) P0.7 (AD7) EA/VPP ALE/PROG PSEN P2.7 (A15) P2.6 (A14) P2.5 (A13) P2.4 (A12) P2.3 (A11) P2.2 (A10) P2.1 (A9) P2.0 (A8) 2.4 42-lead PDIP 33 P0.4 (AD4 ...
Page 3
... RAM LATCH ACC TMP2 TMP1 ALU INTERRUPT, SERIAL PORT, AND TIMER BLOCKS PSW PORT 3 LATCH PORT 3 DRIVERS P3.0 - P3.7 P2.0 - P2.7 PORT 2 DRIVERS FLASH LATCH PROGRAM STACK ADDRESS POINTER REGISTER BUFFER PC INCREMENTER PROGRAM COUNTER DUAL DPTR PORT 1 ISP PROGRAM LATCH PORT LOGIC PORT 1 DRIVERS P1.0 - P1.7 AT89S52 3 ...
Page 4
... Port 2 uses strong internal pull-ups when emitting 1s. During accesses to external data memory that use 8-bit addresses (MOVX @ RI), Port 2 emits the contents of the P2 Special Function Register. Port 2 also receives the high-order address bits and some control signals during Flash program- ming and verification. AT89S52 4 ) because of the internal pull-ups. IL Alternate Functions ...
Page 5
... As inputs, Port 3 pins that are externally being pulled low will source current (I Port 3 receives some control signals for Flash programming and verification. Port 3 also serves the functions of various special features of the AT89S52, as shown in the fol- lowing table. Port Pin P3 ...
Page 6
... PSEN Program Store Enable (PSEN) is the read strobe to external program memory. When the AT89S52 is executing code from external program memory, PSEN is activated twice each machine cycle, except that two PSEN activations are skipped during each access to exter- nal data memory. 4.10 EA/VPP External Access Enable ...
Page 7
... Table 5-1. AT89S52 SFR Map and Reset Values 0F8H B 0F0H 00000000 0E8H ACC 0E0H 00000000 0D8H PSW 0D0H 00000000 T2CON T2MOD 0C8H 00000000 XXXXXX00 0C0H IP 0B8H XX000000 P3 0B0H 11111111 IE 0A8H 0X000000 P2 0A0H 11111111 SCON SBUF 98H 00000000 XXXXXXXX P1 90H 11111111 TCON TMOD ...
Page 8
... Capture/Reload select. CP/RL2 = 1 causes captures to occur on negative transitions at T2EX if EXEN2 = 1. CP/RL2 = 0 CP/RL2 causes automatic reloads to occur when Timer 2 overflows or negative transitions occur at T2EX when EXEN2 = 1. When either RCLK or TCLK = 1, this bit is ignored and the timer is forced to auto-reload on Timer 2 overflow. AT89S52 8 RCLK TCLK ...
Page 9
... DPS 0 Selects DPTR Registers DP0L, DP0H 1 Selects DPTR Registers DP1L, DP1H 1919C–MICRO–3/05 – – WDIDLE DISRTO – – – – AT89S52 Reset Value = XXX00XX0B – – DISALE Reset Value = XXXXXXX0B – – DPS ...
Page 10
... Data Memory The AT89S52 implements 256 bytes of on-chip RAM. The upper 128 bytes occupy a parallel address space to the Special Function Registers. This means that the upper 128 bytes have the same addresses as the SFR space but are physically separate from SFR space. ...
Page 11
... For further information on the UART operation, please click on the document link below: http://www.atmel.com/dyn/resources/prod_documents/DOC4316.PDF 9. Timer 0 and 1 Timer 0 and Timer 1 in the AT89S52 operate the same way as Timer 0 and Timer 1 in the AT89C51 and AT89C52. For further information on the timers’ operation, please click on the document link below: http://www.atmel.com/dyn/resources/prod_documents/DOC4316.PDF 1919C– ...
Page 12
... Timer 2 can be programmed to count up or down when configured in its 16-bit auto-reload mode. This feature is invoked by the DCEN (Down Counter Enable) bit located in the SFR T2MOD (see count up. When DCEN is set, Timer 2 can count up or down, depending on the value of the T2EX pin. AT89S52 12 Timer 2 Operating Modes CP/RL2 0 ...
Page 13
... C/ TH2 CONTROL TR2 C/ CAPTURE RCAP2H CONTROL EXEN2 – – – shows Timer 2 automatically counting up when DCEN = 0. In this mode, two options AT89S52 TL2 TF2 OVERFLOW RCAP2L TIMER 2 INTERRUPT EXF2 Reset Value = XXXX XX00B – T2OE DCEN Figure 10-2. In this ...
Page 14
... Figure 10-2. Timer 2 Auto Reload Mode (DCEN = 0) ÷12 OSC T2 PIN TRANSITION DETECTOR T2EX PIN Figure 10-3. Timer 2 Auto Reload Mode (DCEN = 1) ÷ OSC PIN AT89S52 14 C/ TH2 CONTR OL TR2 C/ RELO AD RCAP2H CONTROL EXEN2 (DOWN COUNTING RELOAD VALUE) 0FFH 0FFH TH2 TL2 ...
Page 15
... The timer should be turned off (clear TR2) before accessing the Timer 2 or RCAP2 registers. 1919C–MICRO–3/05 Timer 2 Overflow Rate Modes 1 and 3 Baud Rates = ----------------------------------------------------------- - Modes 1 and 3 Oscillator Frequency -------------------------------------- - = ------------------------------------------------------------------------------------- - Baud Rate 32 x [65536-RCAP2H,RCAP2L)] Figure AT89S52 Figure 11-1. 16 11-1. This figure is valid only if RCLK or (Table 15 ...
Page 16
... Timer 2 is used as a baud-rate generator possible to use Timer baud-rate gen- erator and a clock generator simultaneously. Note, however, that the baud-rate and clock-out frequencies cannot be determined independently from one another since they both use RCAP2H and RCAP2L. AT89S52 16 TH2 TL2 ...
Page 17
... DETECTOR P1.1 (T2EX) 13. Interrupts The AT89S52 has a total of six interrupt vectors: two external interrupts (INT0 and INT1), three timer interrupts (Timers 0, 1, and 2), and the serial port interrupt. These interrupts are all shown in Figure Each of these interrupt sources can be individually enabled or disabled by setting or clearing a bit in Special Function Register IE ...
Page 18
... EX1 IE.2 ET0 IE.1 EX0 IE.0 User software should never write 1s to reserved bits, because they may be used in future AT89 products. Figure 13-1. Interrupt Sources AT89S52 18 (LSB) ET2 ES ET1 Function Disables all interrupts interrupt is acknowledged each interrupt source is individually enabled or disabled by setting or clearing its enable bit. ...
Page 19
... Figure 16-1. Oscillator Connections Note: 1919C–MICRO–3/ C1 ± for Crystals = 40 pF ± for Ceramic Resonators AT89S52 Figure 16-1. Either a quartz crystal or Figure 16-2. There are no is restored to CC XTAL2 XTAL1 ...
Page 20
... Table 16-1. Mode Idle Idle Power-down Power-down 17. Program Memory Lock Bits The AT89S52 has three lock bits that can be left unprogrammed (U) or can be programmed (P) to obtain the additional features listed in Table 17- When lock bit 1 is programmed, the logic level at the EA pin is sampled and latched during reset. ...
Page 21
... Data Polling: The AT89S52 features Data Polling to indicate the end of a byte write cycle. Dur- ing a write cycle, an attempted read of the last byte written will result in the complement of the written data on P0 ...
Page 22
... XTAL1 and XTAL2. The maximum serial clock (SCK) frequency should be less than 1/16 of the crystal frequency. With a 33 MHz oscillator clock, the maximum SCK frequency is 2 MHz. 20. Serial Programming Algorithm To program and verify the AT89S52 in the serial programming mode, the following sequence is recommended: 1. Power-up sequence: a. Apply power between VCC and GND pins. ...
Page 23
... L L (3) L 12V H H (3) L 12V H H (3) L 12V (1) L 12V AT89S52 P2.4-0 P0.7-0 P3.3 P3.6 P3.7 Data A12 A12-8 OUT P0. P0.3, P0 ...
Page 24
... Figure 22-1. Programming the Flash Memory (Parallel Mode) Figure 22-2. Verifying the Flash Memory (Parallel Mode) AT89S52 24 AT89S52 ADDR. P1.0-P1.7 0000H/1FFFH P2 A12 P2.6 P2.7 SEE FLASH P3.3 PROGRAMMING MODES TABLE P3.6 P3.7 XTAL2 3-33 MHz XTAL1 GND PSEN AT89S52 ADDR. P1.0-P1.7 0000H/1FFFH P2 A12 P2.6 P2.7 SEE FLASH P3.3 PROGRAMMING MODES TABLE P3.6 P3.7 XTAL 2 3-33 MHz XTAL1 GND PSEN ...
Page 25
... CLCL 48 t CLCL 48 t CLCL 48 t CLCL 48 t CLCL CLCL 48 t CLCL CLCL 1.0 50 VERIFICATION ADDRESS t AVQV DATA OUT t GHAX t GHSL LOGIC 1 LOGIC EHQZ ELQV BUSY READY t WC AT89S52 Units MHz µs µs µs µs µs 25 ...
Page 26
... Figure 23-2. Flash Memory Serial Downloading 24. Flash Programming and Verification Waveforms – Serial Mode Figure 24-1. Serial Programming Waveforms AT89S52 26 AT89S52 INSTRUCTION P1.5/MOSI INPUT P1.6/MISO DATA OUTPUT P1.7/SCK CLOCK IN XTAL2 3-33 MHz XTAL1 GND RST 1919C–MICRO–3/05 ...
Page 27
... Byte 0 xxx Byte 0 } Each of the lock bit modes needs to be activated sequentially before Mode 4 can be executed. AT89S52 Byte 4 Operation xxxx xxxx 0110 1001 Enable Serial Programming (Output on while RST is high MISO) xxxx xxxx Chip Erase Flash memory ...
Page 28
... MOSI Setup to SCK High OVSH t MOSI Hold after SCK High SHOX t SCK Low to MISO Valid SLIV t Chip Erase Instruction Cycle Time ERASE t Serial Byte Write Cycle Time SWC AT89S52 OVSH SHOX SCK t SHSL = -40°C to 85° Min CLCL ...
Page 29
... Exposure to absolute maximum rating conditions for extended periods may affect device reliability. = 4.0V to 5.5V, unless otherwise noted. CC Min -0.5 0.2 V -0.5 0.2 V 0 2 2 AT89S52 Max Units - 0. -50 µA -300 µA ± ...
Page 30
... Address Low AVWL t Data Valid to WR Transition QVWX t Data Valid to WR High QVWH t Data Hold After WR WHQX t RD Low to Address Float RLAZ High to ALE High WHLH AT89S52 30 12 MHz Oscillator Variable Oscillator Min Max Min 0 127 2t -40 CLCL 43 t -25 CLCL 48 ...
Page 31
... LLDV t RLRH t LLWL t LLAX t RLDV t AVLL t RLAZ FROM RI OR DPL DATA IN t AVWL t AVDV P2 A15 FROM DPH t PLPH t LLIV t PLIV t PXAV t PXIZ t PXIX INSTR A15 t WHLH t RHDZ t RHDX FROM PCL INSTR A15 FROM PCH AT89S52 31 ...
Page 32
... External Clock Drive Symbol Parameter 1/t Oscillator Frequency CLCL t Clock Period CLCL t High Time CHCX t Low Time CLCX t Rise Time CLCH t Fall Time CHCL AT89S52 32 t LHLL t t LLWL WLWH t LLAX t t QVWX AVLL t QVWH DATA OUT t AVWL P2 A15 FROM DPH t ...
Page 33
... Variable Oscillator Max Min Max 12 t CLCL 10 t -133 CLCL 2 t -80 CLCL 0 700 10 t CLCL SET TI VALID VALID VALID VALID SET RI min. for a logic 1 and V max. for a logic 0. 0.1V OL AT89S52 Units µ -133 VALID 33 ...
Page 34
... Ordering Code AT89S52-24AC AT89S52-24JC AT89S52-24PC AT89S52-24SC 24 4.0V to 5.5V AT89S52-24AI AT89S52-24JI AT89S52-24PI AT89S52-24SI AT89S52-33AC 4.5V to 5.5V AT89S52-33JC 33 AT89S52-33PC AT89S52-33SC 38.2 Green Package Option (Pb/Halide-free) Speed Power (MHz) Supply Ordering Code AT89S52-24AU 24 4.0V to 5.5V AT89S52-24JU AT89S52-24PU 44A 44-lead, Thin Plastic Gull Wing Quad Flatpack (TQFP) 44J 44-lead, Plastic J-leaded Chip Carrier (PLCC) 40P6 40-pin, 0.600" ...
Page 35
... Body Size, 1.0 mm Body Thickness, 0.8 mm Lead Pitch, Thin Profile Plastic Quad Flat Package (TQFP COMMON DIMENSIONS (Unit of Measure = mm) MIN NOM SYMBOL A – – A1 0.05 – A2 0.95 1.00 D 11.75 12.00 D1 9.90 10.00 E 11.75 12.00 E1 9.90 10.00 B 0.30 – C 0.09 – L 0.45 – e 0.80 TYP DRAWING NO. AT89S52 MAX NOTE 1.20 0.15 1.05 12.25 10.10 Note 2 12.25 10.10 Note 2 0.45 0.20 0.75 10/5/2001 REV. 44A B 35 ...
Page 36
... Allowable protrusion is .010"(0.254 mm) per side. Dimension D1 and E1 include mold mismatch and are measured at the extreme material condition at the upper or lower parting line. 3. Lead coplanarity is 0.004" (0.102 mm) maximum. 2325 Orchard Parkway San Jose, CA 95131 R AT89S52 36 1.14(0.045) X 45˚ PIN NO. 1 IDENTIFIER E1 E ...
Page 37
... A1 0.381 – D 52.070 – E 15.240 – E1 13.462 – B 0.356 – B1 1.041 – L 3.048 – C 0.203 – eB 15.494 – e 2.540 TYP DRAWING NO. AT89S52 MAX NOTE 4.826 – 52.578 Note 2 15.875 13.970 Note 2 0.559 1.651 3.556 0.381 17.526 09/28/01 REV. 40P6 B 37 ...
Page 38
... SEATING PLANE Notes: 1. This package conforms to JEDEC reference MS-011, Variation AC. 2. Dimensions D and E1 do not include mold Flash or Protrusion. Mold Flash or Protrusion shall not exceed 0.25 mm (0.010"). 2325 Orchard Parkway San Jose, CA 95131 R AT89S52 38 D PIN 0º ~ 15º REF ...
Page 39
... Atmel Corporation 2005. All rights reserved. Atmel SM Everywhere You Are and others are the trademarks of Atmel Corporation or its subsidiaries. Other terms and product names may be trademarks of others. Atmel Operations Memory ...