The Instruction Set
Interrupt Structure
All members of the Atmel AT89SC 8-bit microcontroller
family execute the same instruction set. This instruction set
is optimized for 8-bit control applications and provides a
variety of fast addressing modes for accessing the RAM to
facilitate byte operations on small data structures. The
instruction set provides extensive support for 1-bit variables
as a separate data type, allowing direct bit manipulation in
control and logic systems that require Boolean processing.
The AT89SC core provides up to five interrupt sources: two
timer interrupts, a security interrupt, a memory interrupt,
and an external interrupt.
Each of the interrupt sources can be individually enabled or
disabled by setting or clearing the corresponding Interrupt
Enable (IE) bit in the SFR. This register also contains a glo-
bal disable bit, which can be cleared to disable all interrupts
at once, disregarding the state of each individual bit enable.
Addressing Modes
The AT89SC microcontroller instruction set includes the
following addressing modes:
Each interrupt source can also be individually programmed
to one of two priority levels by setting or clearing the corre-
sponding Interrupt Priority (IP) bit in the SFR.
• Direct Addressing: Operand is specified by an 8-bit
address field.
Random Word Generator
The random word generator provides a 32-bit random word
located in four SFRs: RDW0, RDW1, RDW2, RDW3.
These four registers operate as a 32-bit shift register with
feedback. The feedback loop gives the longest cycle (num-
ber of clock runs between two occurrences of the same
sequence) and the maximum spread between two consec-
utive generated numbers (two snapshots separated by one
clock pulse).
• Indirect Addressing: Operand is specified by an 8- or 16-
bit register.
• Register Instructions: Operand is a register (R0-R7) of
selected bank.
• Register-Specific Instructions: Instruction is specific to a
certain register and operand is implicit.
• Immediate Constants: Operand is specified by an 8- or
16-bit register field.
Reset
The active low RST pin is filtered to generate an active high
internal reset signal. Holding this RST pin low for at least
two machine cycles (12 MCLK periods) while the oscillator
is running accomplishes a CPU reset. If the clock fre-
quency reaches the maximum clock input frequency or if
the power supply is less than the minimum supply voltage,
the internal reset line is automatically driven high. It is
released once the power supply or the clock frequency has
returned to its normal operating value.
• Indexed Addressing: Access to program memory.
Instruction Type
• Data Transfers
- From/to internal RAM
- From/to external on-chip RAM (except AT89SC168)
- From/to EEPROM
- From Flash
• Arithmetic and logical Instructions
- Manipulations on bytes
Power-On Reset
• Boolean Instructions
The AT89SC microcontrollers have an internal Power-On
reset. When power is turned on, the circuit holds this signal
high for three machine cycles. The CPU reset is a logical
OR between power-on reset and the internal reset signal.
- Manipulations and test on bits
• Jump Instructions
- Unconditional jump
- Conditional jump
- Subroutine call and return
- Interrupt Return
Timers
The AT89SC features two 16-bit timer registers: Timer 0
and Timer 1. These registers are incremented every
machine cycle. Thus, the register counts machine cycles.
Since a machine cycle consists of 6 MCLK periods, the
count rate is 1/6 of the MCLK frequency.
Download Mode
The AT89SC microcontroller has a special functional mode
which allows the Flash to be written for new software down-
load. The new software is loaded through the ISO port and
written into the Flash memory. This download mode is soft-
ware controlled, so if the software in use does not contain
the download facility, no new program can be loaded.
In addition to the timer functions, Timer 0 and Timer 1 have
four operating modes: 13-bit timer, 16-bit timer, 8-bit auto-
reload, split timer.
I/O Port
Master Clock Generation
The I/O Port is supported by a single I/O port line. It is man-
aged by software which conforms to ISO 7816 standards.
An interrupt can be generated on each falling edge of the
I/O line.
The master clock of the CPU is generated from the external
ISO 7816 clock. In the rest of this document, all timing val-
ues will be given with reference to the master clock MCLK.
AT89SCXXXXA
4