The TSC80251G2D products are derivatives of the
TEMIC 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
the TSC83251G2D and TSC87251G2D provide on-chip
code memory: 32 Kbytes ROM and 32 Kbytes EPROM/
OTPROM respectively.
They provide transparent enhancements to Intel’s
8xC251Sx family with an additional Synchronous Serial
Link Controller (SSLC supporting I2C, µWire and SPI
protocols), a Keyboard interrupt interface, a dedicated
Baud RateGenerator for UART, and Power Management
features.
TSC80251G2D derivatives are optimized for speed and
for low power consumption on a wide voltage range.
to 256 Kbytes of external code and data. Additionally,
Note:
This Datasheet provides the technical description of the TSC80251G2D derivatives. For further information on the device usage, please request
the TSC80251 Programmer’s Guide and the TSC80251G1D Design Guide.
2. Typical Applications
● ISDN Terminals
● High-Speed Modems
● PABX (SOHO)
● Line Cards
● DVD ROM and Players
● Printers
● Plotters
● Scanners
● Banking Machines
● Barcode Readers
● Smart Cards Readers
● High-End Digital Monitors
● High-End Joysticks
Rev. A - May 7, 19991
TSC80251G2D
3. Features
● Pin and Software Compatibility with Standard 80C51
Products and 80C51Fx/Rx/Rx+
● Plug-In Replacement of Intel’s 8xC251Sx
● C251 core: Intel’s MCS
®
251 D-step Compliance
• 40-byte register file
• Registers accessible as Bytes, Words or Dwords
• Three-stage instruction pipeline
• 16-bit internal code fetch
● Enriched C51 Instruction Set
• 16-bit and 32-bit ALU
• Compare and conditional jump instructions
• Expanded set of move instructions
● Linear Addressing
● 1 Kbyte of On-Chip RAM
● External Memory Space (Code/Data) Programmable
from 64 Kbytes to 256 Kbytes
● TSC87251G2D: 32 Kbytes of On-Chip EPROM/
OTPROM
• SINGLE PULSE Programming Algorithm
● TSC83251G2D:32 Kbytes of On-Chip Masked ROM
● TSC80251G2D: ROMless Version
● Four 8-bit Parallel I/O Ports (Ports 0, 1, 2 and 3 of
the standard 80C51)
● Serial I/O Port: full duplex UART (80C51
compatible) with independent Baud Rate Generator
● SSLC: Synchronous Serial Link Controller
• I2C multi-master protocol
•µWire and SPI master and slave protocols
● Three 16-bit Timers/Counters (Timers 0, 1 and 2 of
the standard 80C51)
● EWC: Event and Waveform Controller
• Compatible with Intel’s Programmable Counter
Array (PCA)
• Common 16-bit timer/counter reference with four
possible clock sources (Fosc/4, Fosc/12, Timer 1
and external input)
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 15).
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 15).
(1)
(1)
OAddress Lines
Upper address lines for the external bus.
I/OAddress/Data Lines
Multiplexed lower address lines and data for the external memory.
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.
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.
CEXx are input signals for the PCA capture mode and output signals for the PCA compare
and PWM modes.
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.
ECI is the external clock input to the 16-bit PCA timer.
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.
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.
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#.
Holding this pin high for 24 oscillator periods triggers an interrupt.
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 pulldown).
Not available on DIP package.
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 VDDor VSS.
Alternate
Function
P1.7
P3.7
P2.7:0
P0.7:0
P1.7:3
P1.2
P1.5
P1.7
P3.3:2
AD7:0
6Rev. A - May 7, 1999
TSC80251G2D
Signal
Name
P1.0:7I/OPort 1
P2.0:7I/OPort 2
P3.0:7I/OPort 3
PROG#IProgramming Pulse input
PSEN#OProgram Store Enable/Read signal output
RD#ORead or 17thAddress Bit (A16)
RSTIReset input to the chip
RXDI/OReceive Serial Data
SCLI/OI2C Serial Clock
SCKI/OSPI Serial Clock
SDAI/OI2C Serial Data
SS#ISPI Slave Select Input
T1:0I/OTimer 1:0 External Clock Inputs
T2I/OTimer 2 Clock Input/Output
T2EXITimer 2 External Input
TXDOTransmit Serial Data
VDDPWRDigital Supply Voltage
VPPIProgramming Supply Voltage
TypeDescription
P1 is an 8-bit bidirectional I/O port with internal pull-ups. P1 provides interrupt capability
for a keyboard interface.
P2 is an 8-bit bidirectional I/O port with internal pull-ups.
P3 is an 8-bit bidirectional I/O port with internal pull-ups.
The programming pulse is applied to this input for programming the on-chip EPROM/
OTPROM.
PSEN# is asserted for a memory address range that depends on bits RD0 and RD1 in
UCONFIG0 byte (see Table 13, Page 15).
Read signal output to external data memory depending on the values of bits RD0 and RD1
in UCONFIG0 byte (see Table 13, Page 15).
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
whether or not the oscillator is running.
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.
RXD sends and receives data in serial I/O mode 0 and receives data in serial I/O modes 1,
2 and 3.
When I2C controller is in master mode, SCL outputs the serial clock to slave peripherals.
When I2C controller is in slave mode, SCL receives clock from the master controller.
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.
SDA is the bidirectional I2C data line.
When in Slave mode, SS# enables the slave mode.
When timer 1:0 operates as a counter, a falling edge on the T1:0 pin increments the count.
For the timer 2 capture mode, T2 is the external clock input. For the Timer 2 clock-out mode,
T2 is the clock output.
In timer 2 capture mode, a falling edge initiates a capture of the timer 2 registers. In autoreload 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.
TXD outputs the shift clock in serial I/O mode 0 and transmits data in serial I/O modes 1,
2 and 3.
Connect this pin to +5V or +3V supply voltage.
The programming supply voltage is applied to this input for programming the on-chip EPROM/
OTPROM.
is applied,
IH1
Alternate
Function
A15:8
P3.7
P3.0
P1.6
P1.6
P1.7
P1.4
P1.0
P1.1
P3.1
Rev. A - May 7, 19997
TSC80251G2D
Signal
Name
VSSGNDCircuit Ground
VSS1GNDSecondary Ground 1
VSS2GNDSecondary Ground 2
WAIT#IReal-time Synchronous Wait States Input
WCLKOWait Clock Output
WR#OWrite
XTAL1IInput to the on-chip inverting oscillator amplifier
XTAL2OOutput of the on-chip inverting oscillator amplifier
Note:
1. The description of A15:8/P2.7:0 and AD7:0/P0.7:0 are for the Non-Page mode chip configuration. 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).
TypeDescription
Connect this pin to ground.
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.
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.
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.
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 signal output to external memory.
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.
To use the internal oscillator, a crystal/resonator circuit is connected to this pin. If an external
oscillator is used, leave XTAL2 unconnected.
Alternate
Function
P1.6
P1.7
P3.6
8Rev. A - May 7, 1999
TSC80251G2D
6. Address Spaces
The TSC80251G2D derivatives implement four different address spaces:
● On-chip ROM program/code memory (not present in ROMless devices)
● On-chip RAM data memory
● Special Function Registers (SFRs)
● Configuration array
6.1 Program/Code Memory
The TSC83251G2D and TSC87251G2D implement 32 Kbytes of on-chip program/code memory. Figure 5 shows
the split of the internal and external program/code memory 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.
32 Kbytes
32 Kbytes
64 Kbytes
128 Kbytes
Program/code
External Memory Space
Program/code
Segments
FF:FFFFh
FF:8000h
FF:7FFFh
FF:0000h
FE:FFFFh
FE:0000h
FD:FFFFh
Reserved
02:0000h
01:FFFFh
01:0000h
00:FFFFh
00:0000h
On-chip ROM/EPROM
Code Memory
32 KbytesEA#= 0EA#= 1
Figure 5. Program/Code Memory Mapping
Notes:
Special care should be taken when the Program Counter (PC) increments:
1. 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.
2. When PC reaches the end of segment FF:, it loops to the reset address FF:0000h (for 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).
Rev. A - May 7, 19999
TSC80251G2D
6.2 Data Memory
The TSC80251G2D derivatives implement 1 Kbyte of on-chip data RAM. Figure 6 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
Kbytes 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 8). 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 Kbytes of the lower 32 Kbytes 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.
Data External
Memory Space
On-chip ROM/EPROM
Code MemoryData Segments
32 Kbytes
32 Kbytes
64 Kbytes
64 Kbytes
16 Kbytes
≈47 Kbytes
FF:FFFFh
FF:8000h
FF:7FFFh
EA#= 0EA#= 1
EMAP#= 1
FF:0000h
FE:FFFFh
FE:0000h
FD:FFFFh
Reserved
02:0000h
01:FFFFh
01:0000h
00:FFFFh
00:C000h
00:BFFFh
00:0420h
EMAP#= 0
Figure 6. Data Memory Mapping
16 Kbytes
16 Kbytes
RAM Data
1 Kbyte
32 bytes reg.
6.3 Special Function Registers
The Special Function Registers (SFRs) of the TSC80251G2D derivatives fall into the categories detailed in Table 3
to Table 11.
SFRs are placed in a reserved on-chip memory region S: which is not represented in the data memory mapping
(Figure 6). The relative addresses within S: of these SFRs are provided together with their reset values in Table 12.
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 TSC80251G1D Design Guide. All the SFRs are bit-addressable using the C251
instruction set.
10Rev. A - May 7, 1999
TSC80251G2D
Table 3. C251 Core SFRs
Mnemonic NameMnemonic Name
(1)
ACC
(1)
B
PSWProgram Status WordDPH
PSW1Program Status Word 1DPXL
(1)
SP
Note:
1. These SFRs can also be accessed by their corresponding registers in the register file.
AccumulatorSPH
B RegisterDPL
Stack Pointer - LSB of SPX
Table 4. I/O Port SFRs
Mnemonic NameMnemonic Name
P0Port 0P2Port 2
P1Port 1P3Port 3
Table 5. Timers SFRs
Mnemonic NameMnemonic Name
TL0Timer/Counter 0 Low ByteTMODTimer/Counter 0 and 1 Modes
TH0Timer/Counter 0 High ByteT2CONTimer/Counter 2 Control
TL1Timer/Counter 1 Low ByteT2MODTimer/Counter 2 Mode
TH1Timer/Counter 1 High ByteRCAP2LTimer/Counter 2 Reload/Capture Low Byte
TL2Timer/Counter 2 Low ByteRCAP2HTimer/Counter 2 Reload/Capture High Byte
TH2Timer/Counter 2 High ByteWDTRSTWatchDog Timer Reset
TCONTimer/Counter 0 and 1 Control
(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
Table 6. Serial I/O Port SFRs
Mnemonic NameMnemonic Name
SCONSerial ControlSADDRSlave Address
SBUFSerial Data BufferBRLBaud Rate Reload
SADENSlave Address MaskBDRCONBaud Rate Control
Table 7. SSLC SFRs
Mnemonic NameMnemonic Name
SSCONSynchronous Serial controlSSADRSynchronous Serial Address
SSDATSynchronous Serial DataSSBRSynchronous Serial Bit Rate
SSCSSynchronous Serial Control and Status
CCAP4HEWC-PCA Compare Capture Module 4 High Register
Table 9. System Management SFRs
Mnemonic NameMnemonic Name
PCONPower ControlCKRLClock Reload
POWMPower ManagementWCONSynchronous Real-Time Wait State Control
Table 10. 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
1. These registers are described in the TSC80251 Programmer’s Guide (C251 core registers).
2. In I2C and SPI modes, SSCON is splitted in two separate registers. SSCON reset value is 0000 0000 in I2C 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.
Rev. A - May 7, 199913
TSC80251G2D
6.4 Configuration Bytes
The 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 Figure 7) and UCONFIG1 (see Figure 8) 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 address space and there is no restriction in the usage of the external memory.
UCONFIG0
Configuration Byte 0
76543210
-WSA1#WSA0#XALE#RD1RD0PAGE#SRC
Bit NumberBit MnemonicDescription
7-
6WSA1#
5WSA0#
4XALE#
3RD1
2RD0
1PAGE#
0SRC
Reserved
Set this bit when writing to UCONFIG0.
Wait State A bits
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
003
012
101
110
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
Memory Signal Select bits
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
Source Mode/Binary Mode Select bit
Clear to select the binary mode.
Set to select the source mode.
(1)
(2)
with A15:8 on Port 2 and A7:0/D7:0 on Port 0.
OSC
OSC
to 3·T
.
OSC.
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.
Figure 7. Configuration Byte 0
14Rev. A - May 7, 1999
TSC80251G2D
UCONFIG1
Configuration Byte 1
76543210
CSIZE--INTRWSBWSB1#WSB0#EMAP#
Bit NumberBit MnemonicDescription
CSIZE
TSC87251G2D
7
6-
5-
4INTR
3WSB
2WSB1#
1WSB0#
0EMAP#
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.
TSC80251G2D
TSC83251G2D
On-Chip Code Memory Size bit
Clear to select 16 Kbytes of on-chip code memory (TSC87251G1D product).
Set to select 32 Kbytes of on-chip code memory (TSC87251G2D product).
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:.
Wait State B bits
Select the number of wait states for RD#, WR# and PSEN# signals for external memory accesses
(only region 01:).
WSB1#WSB0#Number of Wait States
003
012
101
110
On-Chip Code Memory Map bit
Clear to map the upper 16 Kbytes of on-chip code memory (at FF:4000h-FF:7FFFh) to the data
space (at 00:C000h-00:FFFFh).
Set not to map the upper 16 Kbytes of on-chip code memory (at FF:4000h-FF:7FFFh) to the data
space.
(2)
(3)
Figure 8. Configuration Byte 1
(1)
Table 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
11I/O pin
Note:
1. This selection provides compatibility with the standard 80C51 hardware which has separate external memory spaces for data and code.
Read 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 Kbytes
128 Kbytes
64 Kbytes
2 × 64 Kbytes
(1)
Rev. A - May 7, 199915
TSC80251G2D
7. 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 state 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 34 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 program flow). The maximum
average 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
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.
7.1 Notation for Instruction Operands
Table 15 to Table 19 provide notation for Instruction Operands.
Table 15. Notation for Direct Addressing
Direct AddressDescriptionC251C51
dir8
dir16A 16-bit memory address (00:0000h-00:FFFFh) used in direct addressing.✓
A direct 8-bit address. This can be a memory address (00h-7Fh) or a SFR address (80hFFh). It is a byte (default), word or double word depending on the other operand.
Table 16. Notation for Immediate Addressing
✓✓
Immediate
Address
#dataAn 8-bit constant that is immediately addressed in an instruction✓✓
#data16A 16-bit constant that is immediately addressed in an instruction✓
#0data16
#1data16
#shortA constant, equal to 1, 2, or 4, that is immediately addressed in an instruction.✓
A 32-bit constant that is immediately addressed in an instruction. The upper word is filled
with zeros (#0data16) or ones (#1data16).
DescriptionC251C51
✓
Rev. A - May 7, 199916
TSC80251G2D
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
bit51
bitA directly addressed bit in memory locations 00:0020h-00:007Fh or in any defined SFR.✓
Direct AddressDescriptionC251C51
rel
addr11
addr16
addr24A 24-bit target address. The target can be anywhere within the 16-Mbyte address space.✓
RegisterDescriptionC251C51
@RiA memory location (00h-FFh) addressed indirectly via byte registers R0 or R1✓
Rn
n
Rm
Rmd
Rms
m, md, ms
WRj
WRjd
WRjs
@WRj
@WRj +dis16
j, jd, js
DRk
DRkd
DRks
@DRk
@DRk +dis16
k, kd, ks
the 128 bits in byte locations 20h-2Fh in the 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.
Table 18. Notation for Destination in Control Instructions
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.
A 16-bit target address. The target can be anywhere within the same 64-Kbyte region as
the next instruction’s first byte.
Table 19. Notation for Register Operands
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 WR0WR30, is the target address for jump instructions.
A memory location (00:0000h-00:FFFFh) addressed indirectly through word register (WR0WR30) + 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 selected register file
Destination register
Source register
A memory location (00:0000h-FF:FFFFh) addressed indirectly through dword register DR0DR28, DR56 and DR60, is the target address for jump instruction
A memory location (00:0000h-FF:FFFFh) addressed indirectly through dword register (DR0DR28, DR56, DR60) + 16-bit (two’s complement) signed displacement value
Dword register index: k, kd, ks= 0, 4, 8..., 28, 56, 60
✓✓
✓
✓
✓
✓
✓
✓
✓
17Rev. A - May 7, 1999
TSC80251G2D
7.2 Size and Execution Time for Instruction Families
Table 20. Summary of Add and Subtract Instructions
1. A shaded cell denotes an instruction in the C51 Architecture.
2. If this instruction addresses an I/O Port (Px, x= 0-3), add 1 to the number of states. Add 2 if it addresses a Peripheral SFR.
3. If this instruction addresses external memory location, add N+2 to the number of states (N: number of wait states).
4. If this instruction addresses external memory location, add 2(N+2) to the number of states (N: number of wait states).
A, dir8Direct address to ACC21
A, @RiIndirect address to ACC1223
A, #dataImmediate data to ACC2121
Rmd, RmsByte register to/from byte register3221
WRjd, WRjsWord register to/from word register3322
DRkd, DRksDword register to/from dword register3524
Rm, #dataImmediate 8-bit data to/from byte register4332
WRj, #data16Immediate 16-bit data to/from word register5443
DRk, #0data1616-bit unsigned immediate data to/from dword register5645
Rm, dir8Direct address (on-chip RAM or SFR) to/from byte register43
WRj, dir8Direct address (on-chip RAM or SFR) to/from word register4433
Rm, dir16Direct address (64K) to/from byte register53
WRj, dir16Direct address (64K) to/from word register54
Rm, @WRjIndirect address (64K) to/from byte register43
Rm, @DRkIndirect address (16M) to/from byte register44
A, RnRegister to/from ACC with carry1122
A, dir8
A, @RiIndirect address to/from ACC with carry1223
A, #dataImmediate data to/from ACC with carry2121
(1)
Direct address (on-chip RAM or SFR) to/from ACC with
carry
Comments
Binary ModeSource Mode
BytesStatesBytesStates
(2)
(2)
(3)
(4)
(3)
(3)
21
(2)
21
32
42
43
32
33
21
(2)
(2)
(3)
(4)
(3)
(3)
(2)
Rev. A - May 7, 199918
TSC80251G2D
Table 21. Summary of Increment and Decrement Instructions
IncrementINC <dest>dest opnd ← dest opnd + 1
IncrementINC <dest>, <src>dest opnd ← dest opnd + src opnd
DecrementDEC <dest>dest opnd ← dest opnd - 1
DecrementDEC <dest>, <src>dest opnd ← dest opnd - src opnd
Mnemonic<dest>, <src>
AACC by 11111
INC
DEC
INC
DEC
INCDRk, #shortDouble word register by 1, 2, or 43423
DECDRk, #shortDouble word register by 1, 2, or 43524
INCDPTRData pointer by 11111
Notes:
1. A shaded cell denotes an instruction in the C51 Architecture.
2. If this instruction addresses an I/O Port (Px, x= 0-3), add 2 to the number of states. Add 3 if it addresses a Peripheral SFR.
RnRegister by 11122
dir8Direct address (on-chip RAM or SFR) by 122
@RiIndirect address by 11324
Rm, #shortByte register by 1, 2, or 43221
WRj, #shortWord register by 1, 2, or 43221
(1)
Comments
Table 22. Summary of Compare Instructions
Binary ModeSource Mode
BytesStatesBytesStates
(2)
22
(2)
CompareCMP <dest>, <src>dest opnd - src opnd
Mnemonic<dest>, <src>
(2)
Comments
Binary ModeSource Mode
BytesStatesBytesStates
Rmd, RmsRegister with register3221
WRjd, WRjsWord register with word register3322
DRkd, DRksDword register with dword register3524
Rm, #dataRegister with immediate data4332
WRj, #data16Word register with immediate 16-bit data5443
DRk, #0data16Dword register with zero-extended 16-bit immediate data5645
CMP
Notes:
1. If this instruction addresses an I/O Port (Px, x= 0-3), add 1 to the number of states. Add 2 if it addresses a Peripheral SFR.
2. If this instruction addresses external memory location, add N+2 to the number of states (N: number of wait states).
3. If this instruction addresses external memory location, add 2(N+2) to the number of states (N: number of wait states).
DRk, #1data16Dword register with one-extended 16-bit immediate data5645
Rm, dir8Direct address (on-chip RAM or SFR) with byte register43
WRj, dir8Direct address (on-chip RAM or SFR) with word register4433
Rm, dir16Direct address (64K) with byte register53
WRj, dir16Direct address (64K) with word register54
Rm, @WRjIndirect address (64K) with byte register43
Rm, @DRkIndirect address (16M) with byte register44
(1)
(2)
(3)
(2)
(2)
32
42
43
32
33
(1)
(2)
(3)
(2)
(2)
19Rev. A - May 7, 1999
Loading...
+ 44 hidden pages
You need points to download manuals.
1 point = 1 manual.
You can buy points or you can get point for every manual you upload.