• T emperature Ranges: Commercial (0°C to +70°C), Industrial (-40°C to +85°C)
• Option: Extended Range (-55°C to +125°C)
• Packages: PDIL 40, PLCC 44 and VQFP 44, CDIL 40 and CQPJ 44 with Window
• Options: Known Good Dice and Ceramic Packages
Description
The TSC80251G2D products are derivatives of the Atmel Microcontroller family based on the 8/16-bit C251 Architecture.
This family of products is tailored to 8/16-bit microcontroller applications requiring an increased instruction throughput, a
reduced operating frequency or a larger addressable memory space. The architecture can provide a significant code size
reduction when compiling C programs while fully preserving the legacy of C51 assembly routines.
The TSC80251G2D derivatives are pin and software compatible with standard 80C51/Fx/Rx/Rx+ with extended on-chip
data memory (1 Kbyte RAM) and up to 256 kilobytes of external code and data. Additionally, the TSC83251G2D and
TSC87251G2D provide on-chip code memory: 32 kilobytes ROM and 32 kilobytes EPROM/OTPROM respectively.
They provide transparent enhancements to Intel’s 8xC251Sx family with an additional Synchronous Serial Link Controller
(SSLC supporting TWI, μWire and SPI protocols), a Keyboard interrupt interface, a dedicated Baud Ra te Generator for
UART, and Power Management features.
TSC80251G2D derivatives are optimized for speed and for low power consumption on a wide voltage range.
Note:1. This Datasheet provides the technical description of the TSC80251G2D derivatives. For fu rther information on the device
usage, please request the TSC80251 Programmer’s Guide and the TSC80251G1D Design Guide and errata sheet.
Output to memory as 18th external address bit (A17) in extended bus
applications, depending on the values of bits RD0 and RD1 in UCONFIG0
byte (see Table 13, Page 20).
th
17
Address Bit
Output to memory as 17th external address bit (A16) in extended bus
applications, depending on the values of bits RD0 and RD1 in UCONFIG0
byte (see Table 13, Page 20).
AT/TSC8x251G2D
Alternate
Function
P1.7
P3.7
(1)
A15:8
(1)
AD7:0
ALEO
AWAIT# I
CEX4:0I/O
EA#I
ECIO
I/O
Address Lines
O
Upper address lines for the external bus.
Address/Data Lines
Multiplexed lower address lines and data for the external memory.
Address Latch Enable
ALE signals the start of an external bus cycle and indicates that valid
address information are available on lines A16/A17 and A7:0. An external
latch can use ALE to demultiplex the address from address/data bus.
Real-time Asynchronous Wait States Input
When this pin is active (low level), the memory cycle is stretched until it
becomes high. When using the Product Name as a pin-for-pin replacement
for a 8xC51 product, AWAIT# can be unconnected without loss of
compatibility or power consumption increase (on-chip pull-up).
Not available on DIP package.
PCA Input/Output pins
CEXx are input signals for the PCA capture mode and output signals for
the PCA compare and PWM modes.
External Access Enable
EA# directs program memory accesses to on-chip or off-chip code memory.
For EA# = 0, all program memory accesses are off-chip.
For EA# = 1, an access is on-chip ROM if the address is within the range of
the on-chip ROM; otherwise the access is off-chip. The value of EA# is
latched at reset.
For devices without ROM on-chip, EA# must be strapped to ground.
PCA External Clock input
ECI is the external clock input to the 16-bit PCA timer.
P2.7:0
P0.7:0
–
–
P1.7:3
–
P1.2
4135D–8051–08/05
MISOI/O
MOSII/O
INT1:0#I
SPI Master Input Slave Output line
When SPI is in master mode, MISO receives data from the slave
peripheral. When SPI is in slave mode, MISO outputs data to the master
controller.
SPI Master Output Slave Input line
When SPI is in master mode, MOSI outputs data to the slave peripheral.
When SPI is in slave mode, MOSI receives data from the master controller.
External Interrupts 0 and 1
INT1#/INT0# inputs set IE1:0 in the TCON register. If bits IT1:0 in the
TCON register are set, bits IE1:0 are set by a falling edge on INT1#/INT0#.
If bits IT1:0 are cleared, bits IE1:0 are set by a low level on INT1#/INT0#.
P1.5
P1.7
P3.3:2
7
Table 2. Product Name Signal Description (Continued)
Signal
NameType Description
Non Maskable Interrupt
Holding this pin high for 24 oscillator periods triggers an interrupt.
NMII
P0.0:7I/O
P1.0:7I/O
When using the Product Name as a pin-for-pin replacement for a 8xC51
product, NMI can be unconnected without loss of compatibility or power
consumption increase (on-chip pull-down).
Not available on DIP package.
Port 0
P0 is an 8-bit open-drain bidirectional I/O port. Port 0 pins that have 1s
written to them float and can be used as high impedance inputs. To avoid
any paraitic current consumption, Floating P0 inputs must be polarized to
V
or VSS.
DD
Port 1
P1 is an 8-bit bidirectional I/O port with internal pull-ups. P1 provides
interrupt capability for a keyboard interface.
Alternate
Function
–
AD7:0
–
P2.0:7I/O
P3.0:7I/O
PROG#I
PSEN#O
RD#O
RST I
RXDI/O
Port 2
P2 is an 8-bit bidirectional I/O port with internal pull-ups.
Port 3
P3 is an 8-bit bidirectional I/O port with internal pull-ups.
Programming Pulse input
The programming pulse is applied to this input for programming the on-chip
EPROM/OTPROM.
Program Store Enable/Read signal output
PSEN# is asserted for a memory address range that depends on bits RD0
and RD1 in UCONFIG0 byte (see ).
Read or 17
Read signal output to external data memory depending on the values of
bits RD0 and RD1 in UCONFIG0 byte (see Table 13, Page 20).
Reset input to the chip
Holding this pin high for 64 oscillator periods while the oscillator is running
resets the device. The Port pins are driven to their reset conditions when a
voltage greater than V
This pin has an internal pull-down resistor which allows the device to be
reset by connecting a capacitor between this pin and VDD.
Asserting RST when the chip is in Idle mode or Power-Down mode returns
the chip to normal operation.
Receive Serial Data
RXD sends and receives data in serial I/O mode 0 and receives data in
serial I/O modes 1, 2 and 3.
th
Address Bit (A16)
is applied, whether or not the oscillator is running.
IH1
A15:8
–
–
–
P3.7
–
P3.0
TWI Serial Clock
SCLI/O
SCKI/O
SDAI/O
SS#I
8
AT/TSC8x251G2D
When TWI controller is in master mode, SCL outputs the serial clock to
slave peripherals. When TWI controller is in slave mode, SCL receives
clock from the master controller.
SPI Serial Clock
When SPI is in master mode, SCK outputs clock to the slave peripheral.
When SPI is in slave mode, SCK receives clock from the master controller.
TWI Serial Data
SDA is the bidirectional TWI data line.
SPI Slave Select Input
When in Slave mode, SS# enables the slave mode.
4135D–8051–08/05
P1.6
P1.6
P1.7
P1.4
AT/TSC8x251G2D
Table 2. Product Name Signal Description (Continued)
Signal
NameType Description
Alternate
Function
T1:0I/O
T2I/O
T2EXI
TXDO
VDDPWR
VPPI
VSSGND
VSS1GND
Timer 1:0 External Clock Inputs
When timer 1:0 operates as a counter, a falling edge on the T1:0 pin
increments the count.
Timer 2 Clock Input/Output
For the timer 2 capture mode, T2 is the external clock input. For the Timer 2
clock-out mode, T2 is the clock output.
Timer 2 External Input
In timer 2 capture mode, a falling edge initiates a capture of the timer 2
registers. In auto-reload mode, a falling edge causes the timer 2 register to
be reloaded. In the up-down counter mode, this signal determines the
count direction: 1 = up, 0 = down.
Transmit Serial Data
TXD outputs the shift clock in serial I/O mode 0 and transmits data in serial
I/O modes 1, 2 and 3.
Digital Supply Voltage
Connect this pin to +5V or +3V supply voltage.
Programming Supply Voltage
The programming supply voltage is applied to this input for programming
the on-chip EPROM/OTPROM.
Circuit Ground
Connect this pin to ground.
Secondary Ground 1
This ground is provided to reduce ground bounce and improve power
supply bypassing. Connection of this pin to ground is recommended.
However, when using the TSC80251G2D as a pin-for-pin replacement for a
8xC51 product, VSS1 can be unconnected without loss of compatibility.
Not available on DIP package.
–
P1.0
P1.1
P3.1
–
–
–
–
VSS2GND
WAIT#I
WCLKO
WR#O
XTAL1I
Secondary Ground 2
This ground is provided to reduce ground bounce and improve power
supply bypassing. Connection of this pin to ground is recommended.
However, when using the TSC80251G2D as a pin-for-pin replacement for a
8xC51 product, VSS2 can be unconnected without loss of compatibility.
Not available on DIP package.
Real-time Synchronous Wait States Input
The real-time WAIT# input is enabled by setting RTWE bit in WCON
(S:A7h). During bus cycles, the external memory system can signal
‘system ready’ to the microcontroller in real time by controlling the WAIT#
input signal.
Wait Clock Output
The real-time WCLK output is enabled by setting RTWCE bit in WCON
(S:A7h). When enabled, the WCLK output produces a square wave signal
with a period of one half the oscillator frequency.
Write
Write signal output to external memory.
Input to the on-chip inverting oscillator amplifier
To use the internal oscillator, a crystal/resonator circuit is connected to this
pin. If an external oscillator is used, its output is connected to this pin.
XTAL1 is the clock source for internal timing.
–
P1.6
P1.7
P3.6
–
4135D–8051–08/05
9
Table 2. Product Name Signal Description (Continued)
Signal
NameType Description
Alternate
Function
XTAL2O
Note:The description of A15:8/P2.7:0 and AD7:0/P0 .7:0 are for the Non-Page mo de chip con-
figuration. If the chip is configured in Page mode operation, port 0 carries the lower
address bits (A7:0) while port 2 carries the upper address bits (A15:8) and the data
(D7:0).
Output of the on-chip inverting oscillator amplifier
To use the internal oscillator, a crystal/resonator circuit is connected to this
pin. If an external oscillator is used, leave XTAL2 unconnected.
–
10
AT/TSC8x251G2D
4135D–8051–08/05
AT/TSC8x251G2D
Address SpacesThe TSC80251G2D derivatives implement four different address space s:
•On-chip ROM program/code memor y (n ot pr e sen t in ROM le ss de vic es)
•On-chip RAM data memory
•Special Function Registers (SFRs)
•Configuration array
Program/Code MemoryThe TSC83251G2D and TSC87251G2D implement 32 KB of on-chip program/code
memory. Figure 4 shows the split of the inter nal and external program/code m emory
spaces. If EA# is tied to a high level, the 32-Kbyte on-chip program memory is mapped
in the lower part of segment FF: where the C251 core jumps after reset. The rest of the
program/code memory space is mapped to the external memory. If EA# is tied to a low
level, the internal program/code memory is not used and all the accesses are directed to
the external memory.
The TSC83251G2D products provide the internal program/code memory in a masked
ROM memory while the TSC87251G2D products provide it in an EPROM memory. For
the TSC80251G2D products, there is no internal program/code memory and EA# must
be tied to a low level.
Figure 4. Program/Code Memory Mapping
Program/code
External Memory Space
Program/code
Segments
On-chip ROM/EPROM
Code Memory
32 KB
32 KB
64 KB
128 KB
Note:Special care should be taken when the Program Counter (PC) increments:
If the program executes exclusively from on-chip code memory (not from external memory), beware of executing code from the upper eight bytes of the on-chip ROM
(FF:7FF8h-FF:7FFFh). Because of its pipeline capability, the TSC80251G2D derivative
may attempt to prefetch code from external memory (at an address above FF:7FFFh)
and thereby disrupt I/O Ports 0 and 2. Fetching code constants from these 8 bytes does
not affect Ports 0 and 2.
When PC reaches the end of segment FF:, it loops to the reset address FF:0000h (for
FF:FFFFh
FF:8000h
FF:7FFFh
32 KBEA# = 0EA# = 1
FF:0000h
FE:FFFFh
FE:0000h
FD:FFFFh
Reserved
02:0000h
01:FFFFh
01:0000h
00:FFFFh
00:0000h
4135D–8051–08/05
11
compatibility with the C51 Architecture). When PC increments beyond the end of segment FE:, it continues at the reset address FF:0000h (linearity). When PC increments
beyond the end of segment 01:, it loops to the beginning of segment 00: (this prevents
from its going into the reserved area).
Data MemoryThe TSC80251G2D derivatives implement 1 Kbyte of on-chip data RAM. Figure 5
shows the split of the internal and external data memory spaces. This memory is
mapped in the data space just over the 32 bytes of registers area (see TSC80251 Programmers’ Guide). Hence, the part of the on-chip RAM located from 20h to FFh is bit
addressable. This on-chip RAM is not accessible through the program/code memory
space.
For faster computation with the on-chip ROM/EPROM code of the
TSC83251G2D/TSC87251G2D, its upper 16 KB are also mapped in the upper part of
the region 00: if the On-Chip Code Memory Map configuration bit is cleared (EMAP# bit
in UCONFIG1 byte, see Figure ). However, if EA# is tied to a low level, the
TSC80251G2D derivative is running as a ROMless product and the code is actually
fetched in the corresponding external memory (i.e. the upper 16 KB of the lower 32 KB
of the segment FF:). If EMAP# bit is set, the on-chip ROM is not accessible through the
region 00:.
All the accesses to the portion of the data space with no on-chip memory mapped onto
are redirected to the external memory.
Figure 5. Data Memory Mapping
Data External
Memory Space
32 KB
32 KB
64 KB
64 KB
16 KB
ª47 KB
EA# = 0EA# = 1
EMAP# = 1
FF:FFFFh
FF:8000h
FF:7FFFh
FF:0000h
FE:FFFFh
FE:0000h
FD:FFFFh
Reserved
02:0000h
01:FFFFh
01:0000h
00:FFFFh
00:C000h
00:BFFFh
00:0420h
On-chip ROM/EPROM
Code MemoryData Segments
16 KB
16 KB
EMAP# = 0
RAM Data
1 Kbyte
32 bytes reg.
12
AT/TSC8x251G2D
4135D–8051–08/05
AT/TSC8x251G2D
Special Function
Registers
The Special Function Registers (SFRs) of the TSC80251G2D derivatives fall into the
categories detailed in Table 1 to Table 9.
SFRs are placed in a reserved on-chip memory region S: which is not repre sented in the
data memory mapping (Figure 5). The relative addresses within S: of these SFRs are
provided together with their reset values in Table . They are upward compatible with the
SFRs of the standard 80C51 and the Intel’s 80C251Sx family. In this table, the C251
core registers are identified by Note 1 and are described in the TSC80251 Programmer’s Guide. The other SFRs are described in the TSC80251 G1D De sign Guid e. All the
SFRs are bit-addressable using the C251 instruction set.
Table 1. C251 Core SFRs
Mnemonic NameMnemonic Name
(1)
ACC
(1)
B
PSWProgram Status WordDPH
PSW1Program Status Word 1
(1)
SP
AccumulatorSPH
B RegisterDPL
DPXL
Stack Pointer - LSB of SPX
(1)
(1)
(1)
(1)
Stack Pointer High - MSB of
SPX
Data Pointer Low byte - LSB of
DPTR
Data Pointer High byte - MSB
of DPTR
Data Pointer Extended Low
byte of DPX - Region number
Note:1. These SFRs can also be accessed by their corresponding registers in the register
file.
Table 2. I/O Port SFRs
MnemonicNameMnemonicName
P0Port 0P2Port 2
P1Port 1P3Port 3
Table 3. Timers SFRs
MnemonicNameMnemonicName
TL0
TH0
TL1
TH1
TL2
TH2
TCON
Timer/Counter 0 Low
Byte
Timer/Counter 0 High
Byte
Timer/Counter 1 Low
Byte
Timer/Counter 1 High
Byte
Timer/Counter 2 Low
Byte
Timer/Counter 2 High
Byte
Timer/Counter 0 and 1
Control
TMOD
T2CON
T2MODTimer/Counter 2 Mode
RCAP2L
RCAP2H
WDTRSTWatchDog Timer Reset
Timer/Counter 0 and 1
Modes
Timer/Counter 2
Control
Timer/Counter 2
Reload/Capture Low
Byte
Timer/Counter 2
Reload/Capture High
Byte
4135D–8051–08/05
13
Table 4. Serial I/O Port SFRs
MnemonicNameMnemonicName
SCONSerial ControlSADDRSlave Address
SBUFSerial Data BufferBRLBaud Rate Reload
SADEN
Slave Address
Mask
BDRCONBaud Rate Control
Table 5. SSLC SFRs
MnemonicNameMnemonicName
SSCON
SSDAT
SSCS
Synchronous Serial
control
Synchronous Serial
Data
Synchronous Serial
Control and Status
SSADR
SSBR
Table 6. Event Waveform Control SFRs
Mnemonic NameMnemonic Name
CCONEWC-PCA Timer/Counter ControlCCAP0L
CMODEWC-PCA Timer/Counter ModeCCAP1L
CL
EWC-PCA Timer/Counter Low
Register
CCAP2L
EWC-PCA Compare Capture
Module 0 Low Register
EWC-PCA Compare Capture
Module 1 Low Register
EWC-PCA Compare Capture
Module 2 Low Register
Synchronous Serial
Address
Synchronous Serial
Bit Rate
CH
CCAPM0 EWC-PCA Timer/Counter Mode 0CCAP4L
CCAPM1 EWC-PCA Timer/Counter Mode 1 CCAP0H
CCAPM2 EWC-PCA Timer/Counter Mode 2CCAP1H
CCAPM3 EWC-PCA Timer/Counter Mode 3CCAP2H
CCAPM4 EWC-PCA Timer/Counter Mode 4CCAP3H
EWC-PCA Timer/Counter High
Register
CCAP3L
CCAP4H
EWC-PCA Compare Capture
Module 3 Low Register
EWC-PCA Compare Capture
Module 4 Low Register
EWC-PCA Compare Capture
Module 0 High Register
EWC-PCA Compare Capture
Module 1 High Register
EWC-PCA Compare Capture
Module 2 High Register
EWC-PCA Compare Capture
Module 3 High Register
EWC-PCA Compare Capture
Module 4 High Register
14
AT/TSC8x251G2D
4135D–8051–08/05
AT/TSC8x251G2D
Table 7. System Management SFRs
Mnemonic NameMnemonic Name
PCONPower ControlCKRLClock Reload
POWMPower ManagementWCON
Synchronous Real-Time Wait State
Control
Table 8. Interrupt SFRs
Mnemonic NameMnemonic Name
IE0Interrupt Enable Control 0IPL0Interrupt Priority Control Low 0
IE1Interrupt Enable Control 1IPH1Interrupt Priority Control High 1
IPH0Interrupt Priority Control High 0IPL1Interrupt Priority Control Low 1
Notes:1. These registers are described in the TSC80251 Programmer’s Guide (C251 core registers).
2. In TWI and SPI modes, SSCON is splitted in two separate registers. SSCON reset value is 0000 0000 in TWI mode and
0000 0100 in SPI mode.
3. In read and write modes, SSCS is splitted in two separate registers. SSCS reset value is 1111 1000 in read mode and 0000
0000 in write mode.
P1F
CKRL
WCON
XXXX XX00
POWM
0XXX XXXX
PCON
0000 0000
A7h
9Fh
97h
8Fh
87h
16
AT/TSC8x251G2D
4135D–8051–08/05
AT/TSC8x251G2D
Configuration BytesThe TSC80251G2D derivatives provide user design flexibility by configuring certain
operating features at device reset. These features fall into the following categories:
•external memory interface (Page mode, address bits, programmed wait states and
the address range for RD#, WR#, and PSEN#)
•source mode/binary mode opcodes
•selection of bytes stored on the stack by an interrupt
•mapping of the upper portion of on-chip code memory to region 00:
Two user configuration bytes UCONFIG0 (see Table 11) and UCONFIG1 (see Table
12) provide the information.
When EA# is tied to a low level, the configuration bytes are fetched from the external
address space. The TSC80251G2D derivatives reserve the top eight bytes of the memory address space (FF:FFF8h-FF:FFFFh) for an external 8-byte configuration array.
Only two bytes are actually used: UCONFIG0 at FF:FFF8h and UCONFIG1 at
FF:FFF9h.
For the mask ROM devices, configuration information is stored in on-chip memory (see
ROM Verifying). When EA# is tied to a high level, the configuration information is
retrieved from the on-chip memory instead of the external a ddress space and there is no
restriction in the usage of the external memory.
4135D–8051–08/05
17
Table 11. Configuration Byte 0
UCONFIG0
76543210
-WSA1#WSA0#XALE#RD1RD0PAGE#SRC
Bit Number
7-
6WSA1#Wait State A bits
5WSA0#
4XALE#
3RD1Memory Signal Select bits
2RD0
1PAGE#
0SRC
Bit
Mnemonic Description
Reserved
Set this bit when writing to UCONFIG0.
Select the number of wait states for RD#, WR# and PSEN# signals for external
memory accesses (all regions except 01:).
WSA1#
WSA0# Number of Wait States
00 3
01 2
10 1
11 0
Extend ALE bit
Clear to extend the duration of the ALE pulse from T
Set to minimize the duration of the ALE pulse to 1·T
Specify a 18-bit, 17-bit or 16-bit external address bus and the usage of RD#,
WR# and PSEN# signals (see Table 13).
Page Mode Select bit
Clear to select the faster Page mode with A15:8/D7:0 on Port 2 and A7:0 on
Port 0.
Set to select the non-Page mode
0.
Source Mode/Binary Mode Select bit
Clear to select the binary mode.
Set to select the source mode.
to 3·T
OSC
OSC
(1)
(2)
with A15:8 on Port 2 and A7:0/D7:0 on Port
OSC.
.
18
Notes:1. UCONFIG0 is fetched twice so it can be properly read both in Page or Non-Page
modes. If P2.1 is cleared during the first data fetch, a Page mode configuration is
used, otherwise the subsequent fetches are performed in Non-Page mode.
2. This selection provides compatibility with the standard 80C51 hardware which is multiplexing the address LSB and the data on Port 0.
AT/TSC8x251G2D
4135D–8051–08/05
AT/TSC8x251G2D
Table 12. Configuration Byte 1
UCONFIG1
76543210
CSIZE--INTRWSBWSB1#WSB0#EMAP#
Bit
NumberBit MnemonicDescription
On-Chip Code Memory Size bit
CSIZE
TSC87251G2D
7
Clear to select 16 KB of on-chip code memory (TSC87251G1D
product).
Set to select 32 KB of on-chip code memory (TSC87251G2D product).
(1)
TSC80251G2D
TSC83251G2D
6-
5-
4INTR
3WSB
2WSB1#Wait State B bits
1WSB0#
0EMAP#
Reserved
Set this bit when writing to UCONFIG1.
Reserved
Set this bit when writing to UCONFIG1.
Reserved
Set this bit when writing to UCONFIG1.
Interrupt Mode bit
Clear so that the interrupts push two bytes onto the stack (the two lower
bytes of the PC register).
Set so that the interrupts push four bytes onto the stack (the three bytes
of the PC register and the PSW1 register).
Wait State B bit
Clear to generate one wait state for memory region 01:.
Set for no wait states for memory region 01:.
Select the number of wait states for RD#, WR# and PSEN# signals for
external memory accesses (only region 01:).
WSB1#
00 3
01 2
10 1
11 0
On-Chip Code Memory Map bit
Clear to map the upper 16 KB of on-chip code memory (at FF:4000hFF:7FFFh) to the data space (at 00:C000h-00:FFFFh).
Set not to map the upper 16 KB of on-chip code memory (at FF:4000hFF:7FFFh) to the data space.
WSB0#Number of Wait States
(2)
(3)
4135D–8051–08/05
Notes:1. The CSIZE is only available on EPROM/OTPROM products.
2. Two or four bytes are transparently popped according to INTR when using the RETI
instruction. INTR must be set if interrupts are used with code executing outside
region FF:.
3. Use only for Step A compatibility; set this bit when WSB1:0# are used.
19
Configuration Byte 1Table 13. Address Ranges and Usage of RD#, WR# and PSEN# Signals
RD1RD0P1.7P3.7/RD#PSEN#WR#
External
Memory
00A17A16
01I/O pinA16
10I/O pinI/O pin
Read
11I/O pin
signal for
regions 00:
and 01:
Read signal for all
external memory
locations
Read signal for all
external memory
locations
Read signal for all
external memory
locations
Read signal for
regions FE: and FF:
Write signal for all
external memory
locations
Write signal for all
external memory
locations
Write signal for all
external memory
locations
Write signal for all
external memory
locations
256 KB
128 KB
64 KB
2 × 64 KB
(1)
Notes:1. This selection provides compatibility with the standard 80C51 hardware which has
separate external memory spaces for data and code.
20
AT/TSC8x251G2D
4135D–8051–08/05
AT/TSC8x251G2D
Instruction Set
Summary
This section contains tables that summarize the instruction set. For each instruction
there is a short description, its length in bytes, and its execution time in states (one sta te
time is equal to two system clock cycles). There are two concurrent processes limiting
the effective instruction throughput:
•Instruction Fetch
•Instruction Execution
Table 20 to Table 32 assume code executing from on-chip memory, then the CPU is
fetching 16-bit at a time and this is never limiting the execution speed.
If the code is fetched from external memory, a pre-fetch queue will store instructions
ahead of execution to optimize the memory bandwidth usage when slower instructions
are executed. However, the effective speed may be limited depending on the average
size of instructions (for the considered section of the progra m flow). The ma ximum ave rage instruction throughput is provided by Table 14 depending on the external memory
configuration (from Page Mode to Non-Page Mode and the maximum number of wait
states). If the average size of instructions is not an integer, the maximum effective
throughput is found by pondering the number of states for the neighbor integer values.
Table 14. Minimum Number of States per Instruction for given Average Sizes
Average size
of Instructions
(bytes)
1123456
Page Mode
(states)
0 Wait
State
1 Wait
Non-page Mode (states)
State2 Wait States 3 Wait States 4 Wait States
Notation for Instruction
Operands
224681012
3369121518
44 812162024
551015202530
If the average execution time of the considered instructions is larger than the number of
states given by Table 14, this larger value will prevail as the limiting factor. Otherwise,
the value from Table 14 must be taken. This is providing a fair estimation of the execution speed but only the actual code execution can provide the final value.
Table 15 to Table 19 provide notation for Instruction Operands.
Table 15. Notation for Direct Addressing
Direct
AddressDescriptionC251C51
dir8
dir16
A direct 8-bit address. This can be a memory address (00h-7Fh) or a
SFR address (80h-FFh). It is a byte (default), word or double word
depending on the other operand.
A 16-bit memory address (00:0000h-00:FFFFh) used in direct
addressing.
33
3–
4135D–8051–08/05
21
Table 16. Notation for Immediate Addressing
Immediate
AddressDescriptionC251C51
#dataAn 8-bit constant that is immediately addressed in an instruction33
#data16A 16-bit constant that is immediately addressed in an instruction3–
#0data16
#1data16
#short
A 32-bit constant that is immediately addressed in an instruction. The
upper word is filled with zeros (#0data16) or ones (#1data16).
A constant, equal to 1, 2, or 4, that is immediately addressed in an
instruction.
3–
3–
Table 17. Notation for Bit Addressing
Direct
AddressDescriptionC251C51
A directly addressed bit (bit number = 00h-FFh) in memory or an
SFR. Bits 00h-7Fh are the 128 bits in byte locations 20h-2Fh in the
bit51
bit
on-chip RAM. Bits 80h-FFh are the 128 bits in the 16 SFRs with
addresses that end in 0h or 8h, S:80h, S:88h, S:90h,..., S:F0h,
S:F8h.
A directly addressed bit in memory locations 00:0020h-00:007Fh or
in any defined SFR.
–
3
Table 18. Notation for Destination in Control Instructions
Direct
AddressDescriptionC251C51
rel
addr11
A signed (two’s complement) 8-bit relative address. The destination
is -128 to +127 bytes relative to the next instruction’s first byte.
An 11-bit target address. The target is in the same 2-Kbyte block of
memory as the next instruction’s first byte.
33
–3
3
22
addr16
addr24
AT/TSC8x251G2D
A 16-bit target address. The target can be anywhere within the same
64-Kbyte region as the next instruction’s first byte.
A 24-bit target address. The target can be anywhere within the 16Mbyte address space.
–3
3–
4135D–8051–08/05
AT/TSC8x251G2D
Table 19. Notation for Register Operands
RegisterDescriptionC251C51
at Ri
Rn
n
Rm
Rmd
Rms
m, md, ms
WRj
WRjd
WRjs
at WRj
at WRj +dis16
j, jd, js
DRk
DRkd
DRks
at DRk
at DRk +dis16
k, kd, ks
A memory location (00h-FFh) addressed indirectly via byte registers
R0 or R1
Byte register R0-R7 of the currently selected register bank
Byte register index: n = 0-7
Byte register R0-R15 of the currently selected register file
Destination register
Source register
Byte register index: m, md, ms = 0-15
Word register WR0, WR2, ..., WR30 of the currently selected register
file
Destination register
Source register
A memory location (00:0000h-00:FFFFh) addressed indirectly
through word register WR0-WR30, is the target address for jump
instructions.
A memory location (00:0000h-00:FFFFh) addressed indirectly
through word register (WR0-WR30) + 16-bit signed (two’s
complement) displacement value
Word register index: j, jd, js = 0-30
Dword register DR0, DR4, ..., DR28, DR56, DR60 of the currently
through dword register DR0-DR28, DR56 and DR60, is the target
address for jump instruction
A memory location (00:0000h-FF:FFFFh) addressed indirectly
through dword register (DR0-DR28, DR56, DR60) + 16-bit (two’s
complement) signed displacement value