AT80C51RD2_05 ATMEL | Alldatasheet

Document overview

  • Manufacturer or author: Provided By ALLDATASHEET.COM(FREE DATASHEET DOWNLOAD SITE)
  • PDF pages: 83

Technical content

Features

 80C52 Compatible – Four 8-bit I/O Ports – Three 16-bit Timer/Counters – 256 Bytes Scratch Pad RAM – 8 Interrupt Sources with 4 Priority Levels – Dual Data Pointer  Variable Length MOVX for Slow RAM/Peripherals  High-speed Architecture – 10 to 40 MHz in Standard Mode  16K/32K Bytes On-Chip ROM Program  T80C51RD2 ROMless Versions  On-Chip 1024 bytes Expanded RAM (XRAM) – Software Selectable Size (0, 256, 512, 768, 1024 bytes) – 256 Bytes Selected at Reset for AT87C51RB2/RC2 Compatibility  Keyboard Interrupt Interface on Port P1  8-bit Clock Prescaler  64K Program and Data Memory Spaces  Improved X2 Mode with Independant Selection for CPU and Each Peripheral  Programmable Counter Array 5 Channels with: – High-speed Output – Compare/Capture – Pulse Width Modulator – Watchdog Timer Capabilities  Asynchronous Port Reset  Full Duplex Enhanced UART  Dedicated Baud Rate Generator for UART  Low EMI (Inhibit ALE)  Hardware Watchdog Timer (One-time Enabled with Reset-out)  Power Control Modes –I d l e M o d e – Power-down Mode – Power-off Flag  Power Supply: 2.7V to 5.5V or 2.7V to 3.6V  Temperature Ranges: Commercial (0 to +70°C) and Industrial (-40°C to +85°C)  Packages: PDIL40, PLCC44, VQFP44

Description

AT8xC51Rx2 microcontrollers are high performance ROM versions of the 80C51 8-bit microcontrollers. They contain a 0K, 16K or 32K bytes ROM memory block for program. The microcontrollers retain all features of the Atmel 80C52 with 256 bytes of internal RAM, a 7-source 4-level interrupt controller and three timer/counters. In addition, the microcontrollers have a Programmable Counter Array, an XRAM of 1024 byte, a Hardware Watchdog Timer, a Keyboard Interface, a more versatile serial channel that facilitates multiprocessor communication (EUART) and a speed improve- ment mechanism (X2 mode). The microcontrollers have 2 software-selec table modes of reduc ed activity and 8 bit clock prescaler for further reduction in power consumption. In Idle mode, the CPU is frozen while the peripherals and the interrupt system are still operating. In the Power- down mode, the RAM is saved and all other functions are inoperative. 80C51 High Performance ROM 8-bit Microcontroller AT80C51RD2 AT83C51RB2 AT83C51RC2

2 AT80C51RD2/AT83C51Rx2

Table 1. Memory Size

  1. Alternate function of Port 3

4113B–8051–03/05 Pin Configurations P1.7CEX4 P1.4/CEX1 RST P3.0/RxD P3.1/TxD P1.3CEX0 P1.5/CEX2 P1.6/CEX3 P3.2/INT0 P3.3/INT1 P3.4/T0 P3.5/T1 P3.6/WR P3.7/RD XTAL2 XTAL1 VSS P2.0/AD8 P2.1/AD9 P2.2/AD10 P2.3/AD11 P2.4/AD12 P0.4/AD4 P0.6/AD6 P0.5/AD5 P0.7/AD7 ALE/PROG PSEN EA P2.7/AD15 P2.5/AD13 P2.6/AD14 P1.0/T2 P1.2/ECI P1.1/T2EX VCC P0.0/AD0 P0.1/AD1 P0.2/AD2 P0.3/AD3 PDIL40 43 42 41 40 3944 38 37 36 35 34 P1.4/CEX1 P1.0/T2 P1.1/T2EX P1.3/CEX0 P1.2/ECI NIC* VCC P0.0/AD0 P0.2/AD2 P0.3/AD3 P0.1/AD1 P0.4/AD4 P0.6/AD6 P0.5/AD5 P0.7/AD7 ALE/PROG PSEN EA NIC* P2.7/A15 P2.5/A13 P2.6/A14 P1.5/CEX2 P1.6/CEX3 P1.7/CEX4 RST P3.0/RxD NIC* P3.1/TxD P3.2/INT0 P3.3/INT1 P3.4/T0 P3.5/T1 P3.6/WR P3.7/RD XTAL2 XTAL1 VSS P2.0/A8 P2.1/A9 P2.2/A10 P2.3/A11 P2.4/A12 NIC* 12 13 17 161514 20 1918 21 22 VQFP44 1.4 18 19 23 222120 26 2524 27 28 5 4 3 2 1 6 44 43 42 41 40 P1.4/CEX1 P1.0/T2 P1.1/T2EX P1.3/CEX0 P1.2/ECI NIC* VCC P0.0/AD0 P0.2/AD2 P0.1/AD1 P0.4/AD4 P0.6/AD6 P0.5/AD5 P0.7/AD7 ALE/PROG PSEN EA NIC* P2.7/A15 P2.5/A13 P2.6/A14 P3.6/WR P3.7/RD XTAL2 XTAL1 VSS P2.0/A8 P2.1/A9 P2.2/A10 P2.3/A11 P2.4/A12 P1.5/CEX2 P1.6/CEX3 P1.7/CEx4 RST P3.0/RxD NIC* P3.1/TxD P3.2/INT0 P3.3/INT1 P3.4/T0 P3.5/T1 P0.3/AD3 NIC* PLCC44 *NIC: No Internal Connection

4 AT80C51RD2/AT83C51Rx2

Table 2. Pin Description emitting 1s. Port 0 also inputs the code bytes during EPROM programming. byte during memory programming and verification.

that use 8-bit addresses (MOVX @Ri), Port 2 emits the contents of the P2 SFR. the 80C51 family, as listed below. watchdog forces a system reset. bit. With this bit set, ALE will be inactive during internal fetches. Table 2. Pin Description (Continued)

4113B–8051–03/05 SFR Mapping The Special Function Registers (SFRs) of the microcontroller fall into the following categories:  C51 core registers: ACC, B, DPH, DPL, PSW, SP  I/O port registers: P0, P1, P2, P3  Timer registers: T2CON, T2MOD, TCON, TH0, TH1, TH2, TMOD, TL0, TL1, TL2, RCAP2L, RCAP2H  Serial I/O port registers: SADDR, SADEN, SBUF, SCON  PCA (Programmable Counter Array) registers: CCON, CCAPMx, CL, CH, CCAPxH, CCAPxL (x: 0 to 4)  Power and clock control registers: PCON  Hardware Watchdog Timer registers: WDTRST, WDTPRG  Interrupt system registers: IE0, IPL0, IPH0, IE1, IPL1, IPH1  Keyboard Interface registers: KBE, KBF, KBLS  BRG (Baud Rate Generator) registers: BRL, BDRCON  Clock Prescaler register: CKRL  Others: AUXR, AUXR1, CKCON0, CKCON1

8 AT80C51RD2/AT83C51Rx2

Table 3 shows all SFRs with their address and their reset value. Table 3. SFR Mapping

4113B–8051–03/05 Oscillators Overview One oscillator is available for CPU:  OSC used for high frequency (3 MHz to 40 MHz) In order to optimize the power consumption and the execution time needed for a specific task, an internal prescaler feature has been implemented between the selected oscilla- tor and the CPU. Registers Table 4. Clock Reload Register Reset Value = 1111 1111b Not bit addressable Prescaler Divider A hardware RESET puts the prescaler divider in the following state:  CKRL = FFh: F CLK CPU = FCLK PERIPH = FOSC/2 (Standard C51 feature) KS signal selects OSC: FCLK OUT = FOSC  Any value between FFh down to 00h can be written by software into CKRL register in order to divide frequency of the selected oscillator: – CKRL = 00h: minimum frequency FCLK CPU = FCLK PERIPH = FOSC/1020 (Standard Mode) FCLK CPU = FCLK PERIPH = FOSC/510 (X2 Mode) – CKRL = FFh: maximum frequency FCLK CPU = FCLK PERIPH = FOSC/2 (Standard Mode) FCLK CPU = FCLK PERIPH = FOSC (X2 Mode) –F CLK CPU and FCLK PERIPH In X2 mode: In X1 mode: 76543210 Bit Number Bit Mnemonic Description 7:0 CKRL Clock Reload Register: Prescaler value FCPU F= CLKPERIPH FOSC FCPU F= CLKPERIPH FOSCA

10 AT80C51RD2/AT83C51Rx2

 Divides frequency crystals by 2 (cheaper crystals) while keeping same CPU power.  Increases CPU power by 2 while keeping same crystal frequency. by the CPU core and the peripherals. bypassed, the signals on XTAL1 must have a cyclic ratio between 40 to 60%. shows the switching mode waveforms. Figure 2. Clock Generation Diagram

Figure 3. Mode Switching Waveforms the X2 bit activates the X2 feature (X2 mode). eral clock cycle) to fast peripheral speed (6 clock periods per peripheral clock cycle). These bits are active only in X2 mode.

12 AT80C51RD2/AT83C51Rx2

Table 5. CKCON0 Register when X2 is low, this bit has no effect). Cleared to select 6 clock periods per peripheral clock cycle. Set to select 12 clock periods per peripheral clock cycle. CPU clock X2 is set; when X2 is low, this bit has no effect). Cleared to select 6 clock periods per peripheral clock cycle. Set to select 12 clock periods per peripheral clock cycle. CPU clock X2 is set; when X2 is low, this bit has no effect). Cleared to select 6 clock periods per peripheral clock cycle. Set to select 12 clock periods per peripheral clock cycle. X2 is low, this bit has no effect). Cleared to select 6 clock periods per peripheral clock cycle. Set to select 12 clock periods per peripheral clock cycle. X2 is low, this bit has no effect). Cleared to select 6 clock periods per peripheral clock cycle. X2 is low, this bit has no effect). Cleared to select 6 clock periods per peripheral clock cycle. individual peripherals "X2" bits.

code to switch between them (Refer to Figure 4). Figure 4. Use of Dual Pointer Table 6. AUXR1 Register Note: 1. Bit 2 stuck at 0; this allows to use INC AUXR1 to toggle DPS without changing GF3. The value read from this bit is indeterminate. Do not set this bit. The value read from this bit is indeterminate. Do not set this bit. The value read from this bit is indeterminate. Do not set this bit. 3 GF3 This bit is a gener al purpose user flag. The value read from this bit is indeterminate. Do not set this bit.

14 AT80C51RD2/AT83C51Rx2

4113B–8051–03/05 Assembly Language ; Block move using dual data pointers ; Modifies DPTR0, DPTR1, A and PSW ; note: DPS exits opposite of entry state ; unless an extra INC AUXR1 is added 00A2 AUXR1 EQU 0A2H 0000 909000MOV DPTR,#SOURCE ; address of SOURCE 0003 05A2 INC AUXR1 ; switch data pointers 0005 90A000 MOV DPTR,#DEST ; address of DEST

0008 LOOP:

0008 05A2 INC AUXR1 ; switch data pointers 000A E0 MOVX A,@DPTR ; get a byte from SOURCE 000B A3 INC DPTR ; increment SOURCE address 000C 05A2 INC AUXR1 ; switch data pointers 000E F0 MOVX @DPTR,A ; write the byte to DEST 000F A3 INC DPTR ; increment DEST address 0010 70F6JNZ LOOP ; check for 0 terminator 0012 05A2 INC AUXR1 ; (optional) restore DPS INC is a short (2 bytes) and fast (12 clocks) way to manipulate the DPS bit in the AUXR1 SFR. However, note that the INC instruction does not directly force the DPS bit to a par- ticular state, but simply toggles it. In simple routines, such as the block move example, only the fact that DPS is toggled in the proper sequence matters, not its actual value. In other words, the block move routine works the same whether DPS is '0' or '1' on entry. Observe that without the last instruction (INC AUXR1), the routine will exit with DPS in the opposite state.

space for increased data parameter handling and high level language usage. Table 7. Expanded RAM The T8xc51Rx2 has internal data memory that is mapped into four separate segments.

  1. The Lower 128 bytes of RAM (addresses 00h to 7Fh) are directly and indirectly
  2. The Upper 128 bytes of RAM (addresses 80h to FFh) are indirectly addressable
  3. The Special Function Registers (SFRs) (addresses 80h to FFh) are directly
  4. The expanded RAM bytes are indirectly accessed by MOVX instructions, and

with the EXTRAM bit cleared in the AUXR register (see Table 7). physically separate from SFR space. Figure 5. Internal and External Data Memory Address

128 Bytes

16 AT80C51RD2/AT83C51Rx2

4113B–8051–03/05 When an instruction accesses an internal location above address 7Fh, the CPU knows whether the access is to the upper 128 bytes of data RAM or to SFR space by the addressing mode used in the instruction.  Instructions that use direct addressing access SFR space. For example: MOV 0A0H, # data, accesses the SFR at location 0A0h (which is P2).  Instructions that use indirect addressing access the Upper 128 bytes of data RAM. For example: MOV @R0, # data where R0 contains 0A0h, accesses the data byte at address 0A0h, rather than P2 (whose address is 0A0h).  The XRAM bytes can be accessed by indirect addressing, with EXTRAM bit cleared and MOVX instructions. This part of memory which is physically located on-chip, logically occupies the first bytes of external data memory. The bits XRS0 and XRS1 are used to hide a part of the available XRAM as explained in Table 7. This can be useful if external peripherals are mapped at addresses already used by the internal XRAM.  With EXTRAM = 0, the XRAM is indirectly addressed, using the MOVX instruction in combination with any of the registers R0, R1 of the selected bank or DPTR. An access to XRAM will not affect ports P0, P2, P3.6 (WR) and P3.7 (RD). For example, with EXTRAM = 0, MOVX @R0, # data where R0 contains 0A0H, accesses the XRAM at address 0A0H rather than external memory. An access to external data memory locations higher than the accessible size of the XRAM will be performed with the MOVX DPTR instructions in the same way as in the standard 80C51, with P0 and P2 as data/address busses, and P3.6 and P3.7 as write and read timing signals. Accesses to XRAM above 0FFH can only be done by the use of DPTR.  With EXTRAM = 1 , MOVX @Ri and MOVX @DPTR will be similar to the standard 80C51. MOVX @ Ri will provide an eight-bit address multiplexed with data on Port 0 and any output port pins can be used to output higher order address bits. This is to provide the external paging capability. MOVX @DPTR will generate a sixteen-bit address. Port2 outputs the high-order eight address bits (the contents of DPH) while Port0 multiplexes the low-order eight address bits (DPL) with data. MOVX @ Ri and MOVX @DPTR will generate either read or write signals on P3.6 (WR ) and P3.7 (RD). The stack pointer (SP) may be located anywhere in the 256 bytes RAM (lower and upper RAM) internal data memory. The stack may not be located in the XRAM. The M0 bit allows to stretch the XRAM ti mings; if M0 is set, the read and write pulses are extended from 6 to 30 clock periods. This is useful to access external slow peripherals.

Table 8. AUXR Register Set to stretch MOVX control: the RD and the WR pulse length is 30 clock periods. Cleared to access internal XRAM using MOVX @ Ri/ @ DPTR. Set to access external memory. (HSB), default setting, XRAM selected.

18 AT80C51RD2/AT83C51Rx2

4113B–8051–03/05 Timer 2 The Timer 2 in the T8xc51Rx2 is the standard C52 Timer 2. It is a 16-bit timer/counter: the count is maintained by two eight-bit timer registers, TH2 and TL2 are cascaded. It is controlled by T2CON (Table 9) and T2MOD (Table 10) reg- isters. Timer 2 operation is similar to Timer 0 and Timer 1. C/T2 selects FOSC/12 (timer operation) or external pin T2 (counter oper ation) as the timer clock input. Setting TR2 allows TL2 to be incremented by the selected input. Timer 2 has 3 operating modes: capture, auto-reload and Baud Rate Generator. These modes are selected by the combination of RCLK, TCLK and CP/RL2 (T2CON). Refer to the Atmel 8-bit Microcontroller Hardware description for Capture and Baud Rate Generator Modes. Timer 2 includes the following enhancements:  Auto-reload mode with up or down counter  Programmable clock-output Auto-reload Mode The auto-reload mode configures Timer 2 as a 16-bit timer or event counter with auto- matic reload. If DCEN bit in T2MOD is cleared, Timer 2 behaves as in 80C52 (refer to the Atmel 8-bit Microcontroller Hardware description). If DCEN bit is set, Timer 2 acts as an Up/down timer/counter as shown in Figure 6. In this mode the T2EX pin controls the direction of count. When T2EX is high, Timer 2 counts up. Timer overflow occurs at FFFFh which sets the TF2 flag and generates an interrupt request. The overflow also causes the 16-bit value in RCAP2H and RCAP2L registers to be loaded into the timer registers TH2 and TL2. When T2EX is low, Timer 2 counts down. Timer underflow occurs when the count in the timer registers TH2 and TL2 equals the value stored in RCAP2H and RCAP2L registers. The underflow sets TF2 flag and reloads FFFFh into the timer registers. The EXF2 bit toggles when Timer 2 overflows or underflows according to the direction of the count. EXF2 does not generate any interrupt. This bit can be used to provide 17-bit resolution.

Figure 6. Auto-Reload Mode Up/Down Counter (DCEN = 1)  Set T2OE bit in T2MOD register. reload value or a different one depending on the application.  To start the timer, set TR2 run control bit in T2CON register. independent since both functions use the values in the RCAP2H and RCAP2L registers.

20 AT80C51RD2/AT83C51Rx2

Figure 7. Clock-Out Mode C/T2 = 07

Table 9. T2CON Register Must be cleared by software. Set by hardware on Timer 2 overflow, if RCLK = 0 and TCLK = 0. Cleared to use timer 1 overflow as receive clock for serial port in mode 1 or 3. Set to use Timer 2 overflow as receive clock for serial port in mode 1 or 3. Cleared to use timer 1 overflow as transmit clock for serial port in mode 1 or 3. Set to use Timer 2 overflow as transmit clock for serial port in mode 1 or 3. Cleared to ignore events on T2EX pin for Timer 2 operation. detected, if Timer 2 is not used to clock the serial port. Cleared to turn off Timer 2.

0 CP/RL2#

Set to capture on negative transitions on T2EX pin if EXEN2 = 1.

22 AT80C51RD2/AT83C51Rx2

Table 10. T2MOD Register The value read from this bit is indeterminate. Do not set this bit. The value read from this bit is indeterminate. Do not set this bit. The value read from this bit is indeterminate. Do not set this bit. The value read from this bit is indeterminate. Do not set this bit. The value read from this bit is indeterminate. Do not set this bit. The value read from this bit is indeterminate. Do not set this bit. Cleared to program P1.0/T2 as clock input or I/O port. Set to program P1.0/T2 as clock output.

0 DCEN

Cleared to disable Timer 2 as up/down counter. Set to enable Timer 2 as up/down counter.

4113B–8051–03/05 Programmable Counter Array (PCA) The PCA provides more timing capabilities with less CPU intervention than the standard timer/counters. Its advantages include reduced software overhead and improved accu- racy. The PCA consists of a dedicated timer/counter which serves as the time base for an array of five compare/capture modules. Its clock input can be programmed to count any one of the following signals:  Peripheral clock frequency (F CLK PERIPH) ÷ 6  Peripheral clock frequency (F CLK PERIPH) ÷ 2  Timer 0 overflow  External input on ECI (P1.2) Each compare/capture modules can be programmed in any one of the following modes:  Rising and/or falling edge capture  Software timer  High-speed output  Pulse width modulator Module 4 can also be programmed as a Watchdog Timer (see Section "PCA Watchdog Timer", page 34). When the compare/capture modules are programmed in the capture mode, software timer, or high-speed output mode, an interrupt can be generated when the module exe- cutes its function. All five modules plus the PCA timer overflow share one interrupt vector. The PCA timer/counter and compare/capture modules share Port 1 for external I/O. These pins are listed below. If the port is not used for the PCA, it can still be used for standard I/O. The PCA timer is a common time base for all five modules (see Figure 8). The timer count source is determined from the CPS1 and CPS0 bits in the CMOD register (Table 11) and can be programmed to run at:  1/6 the peripheral clock frequency (FCLK PERIPH)  1/2 the peripheral clock frequency (FCLK PERIPH)  The Timer 0 overflow  The input on the ECI pin (P1.2) PCA Component External I/O Pin 16-bit Counter P1.2/ECI 16-bit Module 0 P1.3/CEX0 16-bit Module 1 P1.4/CEX1 16-bit Module 2 P1.5/CEX2 16-bit Module 3 P1.6/CEX3

24 AT80C51RD2/AT83C51Rx2

Figure 8. PCA Timer/Counter

Table 11. CMOD Register  The CIDL bit which allows the PCA to stop during idle mode.  The WDTE bit which enables or disables the watchdog function on module 4. the CCON SFR) to be set when the PCA timer overflows. timer (CF) and each module (see Table 12). only be cleared by software. can only be cleared by software. Cleared to program the PCA Counter to continue functioning during idle Mode. Set to program PCA to be gated off during idle. Cleared to disable Watchdog Timer function on PCA Module 4. Set to enable Watchdog Timer function on PCA Module 4. The value read from this bit is indeterminate. Do not set this bit. The value read from this bit is indeterminate. Do not set this bit. The value read from this bit is indeterminate. Do not set this bit. Cleared to disable CF bit in CCON to inhibit an interrupt. Set to enable CF bit in CCON to generate an interrupt.

26 AT80C51RD2/AT83C51Rx2

Table 12. CCON Register The watchdog timer function is implemented in module 4 (see Figure 11). The PCA interrupt system is shown in Figure 9. Must be cleared by software to turn the PCA counter off. Set by software to turn the PCA counter on. The value read from this bit is indeterminate. Do not set this bit.

4 CCF4

Must be cleared by software. Set by hardware when a match or capture occurs.

3 CCF3

Must be cleared by software. Set by hardware when a match or capture occurs.

2 CCF2

Must be cleared by software. Set by hardware when a match or capture occurs.

1 CCF1

Must be cleared by software. Set by hardware when a match or capture occurs.

0 CCF0

Must be cleared by software. Set by hardware when a match or capture occurs.

Figure 9. PCA Interrupt System In addition, module 4 can be used as a Watchdog Timer. registers contain the bits that control the mode that each module will operate in. compare occurs in the associated module.  PWM (CCAPMn.1) enables the pulse width modulation mode. enabled and a capture will occur for either transition.

28 AT80C51RD2/AT83C51Rx2

Table 13 shows the CCAPMn settings for the various PCA functions. Table 13. CCAPMn Registers (n = 0-4) The value read from this bit is indeterminate. Do not set this bit. Cleared to disable the comparator function. Set to enable the comparator function.

5 CAPPn

Cleared to disable positive edge capture. Set to enable positive edge capture. Cleared to disable negative edge capture. Set to enable negative edge capture. compare/capture register causes the CEXn pin to toggle. Cleared to disable the CEXn pin to be used as a pulse width modulated output. Set to enable the CEXn pin to be used as a pulse width modulated output.

Table 14. PCA Module Modes (CCAPMn Registers) Table 15. CCAPnH Registers (n = 0-4)

0000000 N o O p e r a t i o n

30 AT80C51RD2/AT83C51Rx2

Table 16. CCAPnL Registers (n = 0-4) Table 17. CH Register Table 18. CL Register

Figure 10. PCA Capture Mode SFR) and the ECCFn (CCAPMn SFR) bits for the module are both set (see Figure 11).

32 AT80C51RD2/AT83C51Rx2

Figure 11. PCA Compare Mode and PCA Watchdog Timer otherwise an unwanted match could happen. Writing to CCAPnH will set the ECOM bit. ECOM bit can still be controlled by accessing to CCAPMn register. each time a match occurs between the PCA counter and the module's capture registers. must be set (see Figure 12). A prior write must be done to CCAPnL and CCAPnH before writing the ECOMn bit.

Figure 12. PCA High-speed Output Mode otherwise an unwanted match could occur. ECOM bit can still be controlled by accessing the CCAPMn register. modules will have the same frequency of output because they all share the PCA timer. the module's CCAPMn register must be set to enable the PWM mode.

34 AT80C51RD2/AT83C51Rx2

Figure 13. PCA PWM Mode

  1. Periodically change the compare value so it will never match the PCA timer.
  2. Periodically change the PCA timer value so it will never match the compare
  3. Disable the watchdog by clearing the WDTE bit before a match occurs and then

cations the first solution is the best option. This watchdog timer won’t generate a reset out on the reset pin.

36 AT80C51RD2/AT83C51Rx2

Figure 16. UART Timings in Modes 2 and 3 nication feature is enabled (SM2 bit in SCON register is set). is not interrupted by command frames addressed to other devices. be enabled in mode 0 (i.e. setting SM2 bit in SCON register in mode 0 has no effect). slaves at a time. The following example illustrates how a given address is formed.

The SADEN byte is selected so that each slave may be addressed separately. municate with slave A only, the master must send an address where bit 0 is clear (e.g. bit 1 clear, and bit 2 clear (e.g. 1111 0001b). and B, but not slave C, the master can send and address FBh. microcontrollers that do not support automatic address recognition. Table 19. SADEN Register

38 AT80C51RD2/AT83C51Rx2

Table 20. SADDR Register the T2CON and BDRCON registers. Figure 17. Baud Rate selection Table 21. Baud Rate Selection Table UART

0000 T i m e r 1 T i m e r 1

1000 T i m e r 2 T i m e r 1

0100 T i m e r 1 T i m e r 2

1100 T i m e r 2 T i m e r 2

0 X 0 1 Timer 1 INT_BRG

1 X 0 1 Timer 2 INT_BRG

in BDRCON register and the value of the SMOD1 bit in PCON register. Figure 18. Internal Baud Rate

40 AT80C51RD2/AT83C51Rx2

Table 22. SCON Register Clear to reset the error state, not cleared by a valid stop bit. Set by hardware when an invalid stop bit is detected. Refer to SM1 for serial port mode selection. Clear to disable multiprocessor communication feature. eventually mode 1. This bit should be cleared in mode 0. Clear to disable serial reception. Set to enable serial reception. o transmit a logic 0 in the 9th bit. Set to transmit a logic 1 in the 9th bit. Cleared by hardware if 9th bit received is a logic 0. Set by hardware if 9th bit received is a logic 1. In mode 1, if SM2=0, RB8 is the received stop bit. In mode 0 RB8 is not used. Clear to acknowledge interrupt. the stop bit in the other modes. Clear to acknowledge interrupt. Figure 16. in the other modes.

Table 23. Example of Computed Value when X2 = 1, SMOD1 = 1, SPD = 1 Table 24. Example of Computed Value when X2 = 0, SMOD1 = 0, SPD = 0

42 AT80C51RD2/AT83C51Rx2

Table 26. SADDR Register Table 27. SBUF Register Table 28. BRL Register

Table 29. T2CON Register Must be cleared by software. Set by hardware on Timer 2 overflow, if RCLK=0 and TCLK=0.

5 RCLK

Cleared to use timer 1 overflow as receive clock for serial port in mode 1 or 3. Set to use Timer 2 overflow as receive clock for serial port in mode 1 or 3. Cleared to use timer 1 overflow as transmit clock for serial port in mode 1 or 3. Set to use Timer 2 overflow as transmit clock for serial port in mode 1 or 3. Cleared to ignore events on T2EX pin for Timer 2 operation. detected, if Timer 2 is not used to clock the serial port. Cleared to turn off Timer 2. Cleared for timer operation (input from internal clock system: FCLK PERIPH). Set to capture on negative transitions on T2EX pin if EXEN2 = 1.

44 AT80C51RD2/AT83C51Rx2

Table 30. PCON Register doesn’t affect the value of this bit. Set to select double baud rate in mode 1, 2 or 3. Cleared to select SM0 bit in SCON register. Set to select FE bit in SCON register. The value read from this bit is indeterminate. Do not set this bit. Cleared to recognize next reset type. Cleared by user for general purpose usage. Set by user for general purpose usage. Cleared by user for general purpose usage. Set by user for general purpose usage. Cleared by hardware when reset occurs. Set to enter power-down mode. Cleared by hardware when interrupt or reset occurs.

Table 31. BDRCON Register The value read from this bit is indeterminate. Do not set this bit. Cleared to stop the internal Baud Rate Generator. Set to start the internal Baud Rate Generator. Cleared to select Timer 1 or Timer 2 for the Baud Rate Generator. Set to select internal Baud Rate Generator. Cleared to select Timer 1 or Timer 2 for the Baud Rate Generator. Set to select internal Baud Rate Generator.

1 SPD

Cleared to select the SLOW Baud Rate Generator. Set to select the FAST Baud Rate Generator. Set to select the internal Baud Rate Generator for UARTs in mode 0.

46 AT80C51RD2/AT83C51Rx2

rupt and the PCA global interrupt. These interrupts are shown in Figure 19. Figure 19. Interrupt Control System contains a global disable bit, which must be cleared to disable all interrupts at once. levels associated with each combination.

Table 32. Priority Level Bit Values

48 AT80C51RD2/AT83C51Rx2

Table 33. IEO Register Cleared to disable all interrupts. Set to enable all interrupts. Cleared to disable Timer 2 overflow interrupt. Set to enable Timer 2 overflow interrupt. Cleared to disable serial port interrupt. Set to enable serial port interrupt. Cleared to disable timer 1 overflow interrupt. Set to enable timer 1 overflow interrupt.

2 EX1

Cleared to disable external interrupt 1. Set to enable external interrupt 1. Cleared to disable timer 0 overflow interrupt. Set to enable timer 0 overflow interrupt.

0 EX0

Cleared to disable external interrupt 0. Set to enable external interrupt 0.

Table 34. IPL0 Register The value read from this bit is indeterminate. Do not set this bit. Refer to PPCH for priority level. Refer to PT2H for priority level.

4 PSL Serial port priority bit

Refer to PSH for priority level. Refer to PT1H for priority level. Refer to PX1H for priority level. Refer to PT0H for priority level. Refer to PX0H for priority level.

50 AT80C51RD2/AT83C51Rx2

Table 35. IPH0 Register The value read from this bit is indeterminate. Do not set this bit. PCA interrupt priority high bit.

00 L o w e s t

Table 36. IE1 Register Cleared to disable keyboard interrupt. Set to enable keyboard interrupt.

52 AT80C51RD2/AT83C51Rx2

Table 37. IPL1 Register The value read from this bit is indeterminate. Do not set this bit. The value read from this bit is indeterminate. Do not set this bit. The value read from this bit is indeterminate. Do not set this bit. The value read from this bit is indeterminate. Do not set this bit. The value read from this bit is indeterminate. Do not set this bit. The value read from this bit is indeterminate. Do not set this bit. The value read from this bit is indeterminate. Do not set this bit. Refer to KBDH for priority level.

Table 38. IPH1 Register The value read from this bit is indeterminate. Do not set this bit. The value read from this bit is indeterminate. Do not set this bit. The value read from this bit is indeterminate. Do not set this bit. The value read from this bit is indeterminate. Do not set this bit. The value read from this bit is indeterminate. Do not set this bit. The value read from this bit is indeterminate. Do not set this bit. The value read from this bit is indeterminate. Do not set this bit.

54 AT80C51RD2/AT83C51Rx2

Table 39. Interrupt Sources and Vector Addresses

56 AT80C51RD2/AT83C51Rx2

4113B–8051–03/05 Registers Table 40. KBF Register KBF - Keyboard Flag Register (9Eh) Reset Value = 0000 0000b 76543210 KBF7 KBF6 KBF5 KBF4 KBF3 KBF2 KBF1 KBF0 Bit Number Bit Mnemonic Description 7K B F 7 Keyboard line 7 flag Set by hardware when the Port line 7 detects a programmed level. It generates a Keyboard interrupt request if the KBKBIE.7 bit in KBIE register is set. Must be cleared by software. 6K B F 6 Keyboard line 6 flag Set by hardware when the Port line 6 detects a programmed level. It generates a Keyboard interrupt request if the KBIE.6 bit in KBIE register is set. Must be cleared by software. 5K B F 5 Keyboard line 5 flag Set by hardware when the Port line 5 detects a programmed level. It generates a Keyboard interrupt request if the KBIE.5 bit in KBIE register is set. Must be cleared by software. 4K B F 4 Keyboard line 4 flag Set by hardware when the Port line 4 detects a programmed level. It generates a Keyboard interrupt request if the KBIE.4 bit in KBIE register is set. Must be cleared by software. 3K B F 3 Keyboard line 3 flag Set by hardware when the Port line 3 detects a programmed level. It generates a Keyboard interrupt request if the KBIE.3 bit in KBIE register is set. Must be cleared by software. 2K B F 2 Keyboard line 2 flag Set by hardware when the Port line 2 detects a programmed level. It generates a Keyboard interrupt request if the KBIE.2 bit in KBIE register is set. Must be cleared by software. 1K B F 1 Keyboard line 1 flag Set by hardware when the Port line 1 detects a programmed level. It generates a Keyboard interrupt request if the KBIE.1 bit in KBIE register is set. Must be cleared by software. 0K B F 0 Keyboard line 0 flag Set by hardware when the Port line 0 detects a programmed level. It generates a Keyboard interrupt request if the KBIE.0 bit in KBIE register is set. Must be cleared by software.

Table 41. KBE Register Cleared to enable standard I/O pin. Set to enable KBF.7 bit in KBF register to generate an interrupt request. Cleared to enable standard I/O pin. Set to enable KBF.6 bit in KBF register to generate an interrupt request. Cleared to enable standard I/O pin. Set to enable KBF.5 bit in KBF register to generate an interrupt request. Cleared to enable standard I/O pin. Set to enable KBF.4 bit in KBF register to generate an interrupt request. Cleared to enable standard I/O pin. Set to enable KBF.3 bit in KBF register to generate an interrupt request. Cleared to enable standard I/O pin. Set to enable KBF.2 bit in KBF register to generate an interrupt request. Cleared to enable standard I/O pin. Set to enable KBF.1 bit in KBF register to generate an interrupt request. Cleared to enable standard I/O pin. Set to enable KBF.0 bit in KBF register to generate an interrupt request.

58 AT80C51RD2/AT83C51Rx2

Table 42. KBLS Register Cleared to enable a low level detection on Port line 7. Set to enable a high level detection on Port line 7. Cleared to enable a low level detection on Port line 6. Set to enable a high level detection on Port line 6. Cleared to enable a low level detection on Port line 5. Set to enable a high level detection on Port line 5. Cleared to enable a low level detection on Port line 4. Set to enable a high level detection on Port line 4. Cleared to enable a low level detection on Port line 3. Set to enable a high level detection on Port line 3. Cleared to enable a low level detection on Port line 2. Set to enable a high level detection on Port line 2. Cleared to enable a low level detection on Port line 1. Set to enable a high level detection on Port line 1. Cleared to enable a low level detection on Port line 0. Set to enable a high level detection on Port line 0.

4113B–8051–03/05 Power Management Idle Mode An instruction that sets PCON.0 indicates that it is the last instruction to be executed before going into Idle mode. In Idle mode, the internal clock signal is gated off to the CPU, but not to the interrupt, Timer, and Se rial Port functions. The CPU status is pre- served in its entirety: the Stack Pointer, Program Counter, Program Status Word, Accumulator and all other registers maintain their data during idle. The port pins hold the logical states they had at the time Idle was activated. ALE and PSEN hold at logic high level. There are two ways to terminate the Idle mode. Activation of any enabled interrupt will cause PCON.0 to be cleared by hardware, terminating the Idle mode. The interrupt will be serviced, and following RETI the next instruction to be executed will be the one fol- lowing the instruction that put the device into idle. The flag bits GF0 and GF1 can be used to give an indication if an interrupt occurred dur- ing normal operation or during idle. For example, an instruction that activates idle can also set one or both flag bits. When idle is terminated by an interrupt, the interrupt ser- vice routine can examine the flag bits. The other way of terminating the Idle mode is with a hardware reset. Since the clock oscillator is still running, the hardware reset needs to be held active for only two machine cycles (24 oscillator periods) to complete the reset. Power-down Mode To save maximum power, a power-down mode can be invoked by software (refer to Table 30, PCON register). In power-down mode, the oscillator is st opped and the instruction that invoked power- down mode is the last instruction execut ed. The internal RAM and SFRs retain their value until the power-down mode is terminated. V CC can be lowered to save further power. Either a hardware reset or an external interrupt can cause an exit from power- down. To properly terminate power-down, the reset or external interrupt should not be executed before V CC is restored to its normal operating level and must be held active long enough for the oscillator to restart and stabilize. Only external interrupts INT0 , INT1 and Keyboard Interrupts are useful to exit from power-down. Thus, the interrupt must be enabled and configured as level - or edge - sensitive interrupt input. When Keyboard Interrupt occurs after a power-down mode, 1024 clocks are necessary to exit to power-down mode and enter in operating mode. Holding the pin low restarts the oscillator but bringing the pin high completes the exit as detailed in Figure 22. When both interrupts are enabled, the oscillator restarts as soon as one of the two inputs is held low and power-down exit will be completed when the first input is released. In this case, the higher pr iority interrupt service routine is executed. Once the interrupt is serviced, the next instruction to be executed after RETI will be the one following the instruction that put T8xc51Rx2 into power-down mode.

60 AT80C51RD2/AT83C51Rx2

Figure 22. Power-down Exit Waveform interrupt does no affect the SFRs. Table 43 shows the state of ports during idle and power-down modes. Note: 1. Port 0 can force a 0 level. A "one" will leave port floating. Table 43. State of Ports

that will periodically be executed within the time required to prevent a WDT reset. WDTPRG register description, Table 44. Table 44. WDTRST Register

62 AT80C51RD2/AT83C51Rx2

Table 45. WDTPRG Register while the interrupt pin is held low, the WDT is not started until the interrupt is pulled high. It is suggested that the WDT be reset during the interrupt service routine. it is better to reset the WDT just before entering power-down. cally exit Idle, service the WDT, and re-enter Idle mode. The value read from this bit is undetermined. Do not try to set this bit.

 The code array:16/32K bytes. Hardware Config Byte The config byte sets the starting microcontroller options and the security levels. The starting options are X2 mode, and XRAM.

  1. The lock bits when programmed according to Table 46 will provide different level of

protection for the on-chip code and data. Set to force X1 mode, Standard Mode. Set this bit to enable XRAM. Clear this bit to disable XRAM. Table 46. Program Lock bits 1 U U No program lock features enabled. fetching code bytes from internal memory, EA is sampled and latched on reset.

64 AT80C51RD2/AT83C51Rx2

software allowing the user to determine the type of reset. Table 47. PCON Register Set to select double baud rate in mode 1, 2 or 3. Cleared to select SM0 bit in SCON register. Set to select FE bit in SCON register. The value read from this bit is indeterminate. Do not set this bit. Cleared to recognize next reset type. Cleared by user for general purpose usage. Set by user for general purpose usage. Cleared by user for general purpose usage. Set by user for general purpose usage. Cleared by hardware when reset occurs. Set to enter power-down mode. Cleared by hardware when interrupt or reset occurs.

fetches. During ALE disabling, ALE pin is weakly pulled high. Table 48. AUXR Register

1 EXTRAM

Cleared to access internal XRAM using movx @ Ri/ @ DPTR. Set to access external memory. (HSB), default setting, XRAM selected.

66 AT80C51RD2/AT83C51Rx2

4113B–8051–03/05

Electrical Characteristics

TA = 0°C to +70°C; VSS = 0V; VCC = 4.5V to 5.5V; F = 10 to 40 MHz TA = -40°C to +85°C; VSS = 0V; VCC =4.5V to 5.5V; F = 10 to 40 MHz Note: Stresses at or above those listed under “Absolute Maximum Ratings” may cause permanent damage to the device. This is a stress rating only and functional operation of the device at these or any other condi- tions above those indicated in the operational sections of this specification is not implied. Exposure to abso- lute maximum rating conditions may affect device reliability. Power dissipation value is based on the maximum allowable die temperature and the thermal resistance of the package. Symbol Parameter Min Typ Max Unit Test Conditions VIL Input Low Voltage -0.5 0.2 V CC - 0.1 V VIH Input High Voltage except RST, XTAL1 0.2 V CC + 0.9 V CC + 0.5 V VIH1 Input High Voltage RST, XTAL1 0.7 V CC VCC + 0.5 V VOL Output Low Voltage, ports 1, 2, 3, 4 (6) 0.3 0.45 1.0 V V V I OL = 100 µA(4) IOL = 1.6 mA(4) IOL = 3.5 mA(4) VOL1 Output Low Voltage, port 0, ALE, PSEN (6) 0.3 0.45 1.0 V V V I OL = 200 µA(4) IOL = 3.2 mA(4) IOL = 7.0 mA(4) VOH Output High Voltage, ports 1, 2, 3, 4 VCC - 0.3 VCC - 0.7 VCC - 1.5 V V V I OH = -10 µA IOH = -30 µA IOH = -60 µA VCC = 5V ± 10% VOH1 Output High Voltage, port 0, ALE, PSEN VCC - 0.3 VCC - 0.7 VCC - 1.5 V V V I OH = -200 µA IOH = -3.2 mA IOH = -7.0 mA VCC = 5V ± 10% RRST RST Pull-down Resistor 50 200 (5) 250 k Ω IIL Logical 0 Input Current ports 1, 2, 3, 4 and 5 -50 µAV IN = 0.45V ILI Input Leakage Current ±10 µA 0.45V < V IN < VCC ITL Logical 1 to 0 Transition Current, ports 1, 2, 3, 4 -650 µAV IN = 2.0 V CIO Capacitance of I/O Buffer 10 pF Fc = 3 MHz TA = 25°C IPD Power-down Current 100 150 µA4 . 5 V < VCC < 5.5V(3) ICCOP Power Supply Current on normal mode 0.29 x Frequency (MHz) + 4 mA V CC = 5.5V(1) ICCIDLE Power Supply Current on idle mode 0.16 x Frequency (MHz) + 4 mA V CC = 5.5V(2)

4113B–8051–03/05 DC Parameters for Standard Voltage (2) TA = 0°C to +70°C; VSS = 0 V; VCC = 2.7V to 5.5V; F = 10 to 40 MHz TA = -40°C to +85°C; VSS = 0 V; VCC = 2.7V to 5.5V; F = 10 to 40 MHz Symbol Parameter Min Typ (5) Max Unit Test Conditions VIL Input Low Voltage -0.5 0.2 V CC - 0.1 V VIH Input High Voltage except XTAL1, RST 0.2 V CC + 0.9 V CC + 0.5 V VIH1 Input High Voltage, XTAL1, RST 0.7 V CC VCC + 0.5 V VOL Output Low Voltage, ports 1, 2, 3, 4 and 5 (6) 0.45 V I OL = 0.8 mA(4) VOL1 Output Low Voltage, port 0, ALE, PSEN (6) 0.45 V I OL = 1.6 mA(4) VOH Output High Voltage, ports 1, 2, 3, 4 and 5 0.9 V CC VI OH = -10 µA VOH1 Output High Voltage, port 0, ALE, PSEN 0.9 VCC VI OH = -40 µA IIL Logical 0 Input Current ports 1, 2, 3, 4 and 5 -50 µAV IN = 0.45V ILI Input Leakage Current ±10 µA 0.45V < V IN < VCC ITL Logical 1 to 0 Transition Current, ports 1, 2, 3, 4 and 5 -650 µAV IN = 2.0V RRST RST Pulldown Resistor 50 200 250 k Ω CIO Capacitance of I/O Buffer 10 pF Fc = 3 MHz TA = 25°C IPD Power-down Current 120 150 µAV CC =2.7V to 5.5V(3) ICCOP Power Supply Current on normal mode 0.29 x Frequency (MHz) + 4 mA V CC = 5.5V(1) ICCIDLE Power Supply Current on idle mode 0.16 x Frequency (MHz) + 4 mA V CC = 5.5V(2)

68 AT80C51RD2/AT83C51Rx2

4113B–8051–03/05 DC Parameters for Low Voltage TA = 0°C to +70°C; VSS = 0V; VCC = 2.7V to 3.6V; F = 10 to 40 MHz TA = -40°C to +85°C; VSS = 0V; VCC = 2.7V to 3.6V; F = 10 to 40 MHz Notes: 1. Operating I CC is measured with all output pins disconnected; XTAL1 driven with TCLCH, TCHCL = 5 ns (see Figure 26.), VIL = VSS + 0.5V, VIH = VCC - 0.5V; XTAL2 N.C.; EA = RST = Port 0 = VCC. ICC would be slightly higher if a crystal oscillator used (see Figure 23). 2. Idle I CC is measured with all output pins disconnected; XTAL1 driven with TCLCH, TCHCL = 5 ns, VIL = VSS + 0.5V, VIH = VCC - 0.5V; XTAL2 N.C; Port 0 = VCC; EA = RST = VSS (see Figure 24). 3. Power-down I CC is measured with all output pins disconnected; EA = VSS, PORT 0 = VCC; XTAL2 NC.; RST = VSS (see Fig- ure 25). 4. Capacitance loading on Ports 0 and 2 may cause spurious noise pulses to be superimposed on the VOLs of ALE and Ports 1 and 3. The noise is due to external bus capacitance discharging into the Port 0 and Port 2 pins when these pins make 1 to 0 transitions during bus operation. In the worst cases (capacitive loading 100pF), the noise pulse on the ALE line may exceed 0.45V with maxi V OL peak 0.6V. A Schmitt Trigger use is not necessary. 5. Typical are based on a limited number of samples and are not guaranteed. The values listed are at room temperature and 5V. 6. Under steady state (non-transient) conditions, I OL must be externally limited as follows: Maximum IOL per port pin: 10 mA Maximum IOL per 8-bit port: Port 0: 26 mA Ports 1, 2 and 3: 15 mA Maximum total IOL for all output pins: 71 mA If IOL exceeds the test condition, VOL may exceed the related specification. Pins are not guaranteed to sink current greater than the listed test conditions. 7. For other values, please contact your sales office. Symbol Parameter Min Typ Max Unit Test Conditions VIL Input Low Voltage -0.5 0.2 V CC - 0.1 V VIH Input High Voltage except RST, XTAL1 0.2 V CC + 0.9 V CC + 0.5 V VIH1 Input High Voltage, RST, XTAL1 0.7 V CC VCC + 0.5 V VOL Output Low Voltage, ports 1, 2, 3, 4(6) 0.45 V I OL = 0.8 mA(4) VOL1 Output Low Voltage, port 0, ALE, PSEN (6) 0.45 V I OL = 1.6 mA(4) VOH Output High Voltage, ports 1, 2, 3, 4 0.9 V CC VI OH = -10 µA VOH1 Output High Voltage, port 0, ALE, PSEN 0.9 VCC VI OH = -40 µA IIL Logical 0 Input Current ports 1, 2, 3, 4 -50 µAV IN = 0.45V ILI Input Leakage Current ±10 µA 0.45V < V IN < VCC ITL Logical 1 to 0 Transition Current, ports 1, 2, 3, -650 µAV IN = 2.0V RRST RST Pulldown Resistor 50 200 (5) 250 k Ω CIO Capacitance of I/O Buffer 10 pF Fc = 3 MHz TA = 25°C IPD Power-down Current 10 (5) 50 µA VCC = 2.7V to 3.6V(3) ICCOP Power Supply Current on normal mode 0.31 x Frequency (MHz) + 4 mA V CC = 3.6V(1) ICCIDLE Power Supply Current on idle mode 0.2 x Frequency (MHz) + 4 mA V CC = 3.6V(2)

70 AT80C51RD2/AT83C51Rx2

Each timing symbol has 5 characters. The first character is always a “t” (stands for time). AVLL = Time for Address Valid to ALE Low. TLLPL = Time for ALE Low to PSEN Low. Table 49 Table 52, and Table 54 give the description of each AC symbols. Table 51, Table 53 and Table 55 give for each range the AC parameter. in the correponding column (-M or -L) and use this value in the formula. LLIU for -M and 20 MHz, Standard clock. Table 49. Symbol Description

Table 50. AC Parameters for a Fix Clock Table 51. AC Parameters for a Variable Clock

72 AT80C51RD2/AT83C51Rx2

4113B–8051–03/05 External Program Memory Read Cycle External Data Memory Characteristics Table 52. Symbol Description TPLIV TPLAZ ALE PSEN PORT 0 PORT 2 A0-A7A0-A7 INSTR ININSTR IN INSTR IN ADDRESS OR SFR-P2 ADDRESS A8-A15ADDRESS A8 - A15

12 TCLCL

TLLDV ALE to Valid Data In TAVDV Address to Valid Data In TLLWL ALE to WR or RD TAVWL Address to WR or RD TQVWX Data Valid to WR Transition TQVWH Data set-up to WR High TWHQX Data Hold After WR TRLAZ RD Low to Address Float TWHLH RD or WR High to ALE high

Table 53. AC Parameters for a Fix Clock

74 AT80C51RD2/AT83C51Rx2

4113B–8051–03/05 External Data Memory Write Cycle Symbol Type Standard Clock X2 Clock X parameter for - M range X parameter for - L range Units TRLRH Min 6 T - x 3 T - x 25 25 ns TWLWH Min 6 T - x 3 T - x 25 25 ns TRLDV Max 5 T - x 2.5 T - x 30 30 ns TRHDX Min x x 0 0 ns TRHDZ Max 2 T - x T - x 25 25 ns TLLDV Max 8 T - x 4T -x 45 45 ns TAVDV Max 9 T - x 4.5 T - x 65 65 ns TLLWL Min 3 T - x 1.5 T - x 30 30 ns TLLWL Max 3 T + x 1.5 T + x 30 30 ns TAVWL Min 4 T - x 2 T - x 30 30 ns TQVWX Min T - x 0.5 T - x 20 20 ns TQVWH Min 7 T - x 3.5 T - x 20 20 ns TWHQX Min T - x 0.5 T - x 15 15 ns TRLAZ Max x x 0 0 ns TWHLH Min T - x 0.5 T - x 20 20 ns TWHLH Max T + x 0.5 T + x 20 20 ns TQVWHTLLAX ALE PSEN WR PORT 0 PORT 2 A0-A7 DATA OUT ADDRESS OR SFR-P2 TAVWL TLLWL TQVWX ADDRESS A8 - A15 OR SFR P2 TWHQX TWHLH TWLWH

Table 54. Symbol Description Table 55. AC Parameters for a Fix Clock Table 56. AC Parameters for a Variable Clock

76 AT80C51RD2/AT83C51Rx2

4113B–8051–03/05 Shift Register Timing Waveforms External Clock Drive Waveforms AC Testing Input/Output Waveforms AC inputs during testing are driven at V CC - 0.5 for a logic “1” and 0.45V for a logic “0”. Timing measurement are made at VIH min for a logic “1” and VIL max for a logic “0”. Float Waveforms For timing purposes as port pin is no longer floating when a 100 mV changes from load voltage occurs and begins to float when a 100 mV change from the loaded VOH/VOL level occurs. IOL/IOH ≥ ± 20 mA. Clock Waveforms Valid in normal clock mode. In X2 mode XTAL2 must be changed to XTAL2/2. INPUT DATA VALIDVALID VALID VALID 0123456 8 7 ALE CLOCK OUTPUT DATA WRITE to SBUF CLEAR RI TXLXL TQVXH TXHQX TXHDV TXHDX SET TI SET RI INSTRUCTION 01234567 VALID VALID VALID VALID VCC-0.5V 0.45V 0.7VCC 0.2VCC-0.1 TCHCL TCLCX TCLCL TCLCH TCHCX INPUT/OUTPUT 0.2 VCC + 0.9 0.2 VCC - 0.1 VCC -0.5V 0.45V FLOAT VOH - 0.1 V VOL + 0.1 V VLOAD VLOAD + 0.1 V VLOAD - 0.1 V

Figure 27. Internal Clock Signals

4113B–8051–03/05

Ordering Information

Table 57. Ordering Information

79 AT80C51RD2/AT83C51Rx2

Table 57. Ordering Information (Continued)

4113B–8051–03/05

Package Information

81 AT80C51RD2/AT83C51Rx2

4113B–8051–03/05 PLCC44 VQFP44

4113B–8051–03/05

83 AT80C51RD2/AT83C51Rx2

4113B–8051–03/05 Datasheet Change Log Changes from 4113A - 09/02 to 4113B -03/05 1. Added Green product ordering information.

Printed on recycled paper. 4113B–8051–03/05 /xM © Atmel Corporation 2005 . All rights reserved. Atmel®, logo and combinations thereof, are registered trademarks, and Everywhere You Are SM are the trademarks of Atmel Corporation or its subsidiaries. Other terms and product names may be trademarks of others. Disclaimer: The information in this document is provided in connection with Atmel products. No license, expr ess or implied, by estoppel or otherwise, to any intellectual property right is granted by this documen t or in connection with the sale of Atmel products. EXCEPT AS SET FORTH IN ATMEL’S TERMS AND CONDI- TIONS OF SALE LOCATED ON ATMEL’S WEB SITE, ATMEL ASSUMES NO LIABILITY WHATSOEVER AND DISCLAIMS ANY EXPRESS, IMPLIED OR STATUTOR Y WARRANTY RELATING TO ITS PRODUCTS INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTY OF MERCHANTABILITY, FITNESS FOR A PARTICU LAR PURPOSE, OR NON-INFRINGEMENT. IN NO EVENT SHALL ATMEL BE LIABL E FOR ANY DIRECT, INDIRECT, CONSEQUENTIAL, PUNITIVE, SPECIAL OR I NCIDEN- TAL DAMAGES (INCLUDING, WITHOUT LIMITATION, DAMAGES FOR LOSS OF PROFITS, BUSINESS INTERRUPTION, OR LOSS OF INFORMATION) ARISING OUT OF THE USE OR INABILITY TO USE THIS DOCUMENT, EVEN IF ATMEL HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. Atmel makes no representations or warranties with respect to the accuracy or comple teness of the contents of this document and reserves the rig ht to make changes to specifications and product descriptions at any time without notice. Atmel does not make any commitment to update the information contained her ein. Atmel’s products are not intended, authorized, or warranted for use as components in applications intended to support or sustain life. Atmel Corporation Atmel Operations

2325 Orchard Parkway

San Jose, CA 95131, USA Tel: 1(408) 441-0311 Fax: 1(408) 487-2600 Regional Headquarters Europe Atmel Sarl Route des Arsenaux 41 Case Postale 80 CH-1705 Fribourg Switzerland Tel: (41) 26-426-5555 Fax: (41) 26-426-5500 Asia Room 1219 Chinachem Golden Plaza

77 Mody Road Tsimshatsui

Tel: (852) 2721-9778 Fax: (852) 2722-1369 Japan 9F, Tonetsu Shinkawa Bldg. 1-24-8 Shinkawa Chuo-ku, Tokyo 104-0033 Japan Tel: (81) 3-3523-3551 Fax: (81) 3-3523-7581 Memory San Jose, CA 95131, USA Tel: 1(408) 441-0311 Fax: 1(408) 436-4314 Microcontrollers San Jose, CA 95131, USA Tel: 1(408) 441-0311 Fax: 1(408) 436-4314 La Chantrerie BP 70602

44306 Nantes Cedex 3, France

13106 Rousset Cedex, France

1150 East Cheyenne Mtn. Blvd. Colorado Springs, CO 80906, USA Tel: 1(719) 576-3300 Fax: 1(719) 540-1759 Scottish Enterprise Technology Park Maxwell Building East Kilbride G75 0QR, Scotland Tel: (44) 1355-803-000 Fax: (44) 1355-242-743 RF/Automotive Theresienstrasse 2 Postfach 3535

74025 Heilbronn, Germany

1150 East Cheyenne Mtn. Blvd. Colorado Springs, CO 80906, USA Tel: 1(719) 576-3300 Fax: 1(719) 540-1759 Biometrics/Imaging/Hi-Rel MPU/ High Speed Converters/RF Datacom Avenue de Rochepleine BP 123

38521 Saint-Egreve Cedex, France

www.atmel.com/literature