cop87l42rj National Semiconductor Corporation, cop87l42rj Datasheet - Page 17

no-image

cop87l42rj

Manufacturer Part Number
cop87l42rj
Description
8-bit Cmos Otp Microcontrollers With 4k Or 32k Memory And Comparator
Manufacturer
National Semiconductor Corporation
Datasheet
Multi-Input Wake Up
pop the stack into the program counter (PC). The stack
pointer is then incremented twice. The RETI instruction addi-
tionally sets the GIE bit to re-enable further interrupts.
Any of the three instructions can be used to return from a
hardware interrupt subroutine. The RETSK instruction
should be used when returning from a software interrupt
subroutine to avoid entering an infinite loop.
Note: There is always the possibility of an interrupt occurring during an in-
Control Registers
CNTRL1 REGISTER (ADDRESS 00EE)
The Timer and MICROWIRE control register contains the fol-
lowing bits:
TC3
TC2
TC1
TRUN
MSEL
IEDG
SL1 and SL0 Select the MICROWIRE clock divide-by
PSW REGISTER (ADDRESS 00EF)
The PSW register contains the following select bits:
HC
C
TPND Timer T1 interrupt pending
ENTI
Bit 7
Bit 7
TC3
HC
struction which is attempting to reset the GIE bit or any other interrupt
enable bit. If this occurs when a single cycle instruction is being used
to reset the interrupt enable bit, the interrupt enable bit will be reset but
an interrupt may still occur. This is because interrupt processing is
started at the same time as the interrupt bit is being reset. To avoid this
scenario, the user should always use a two, three, or four cycle instruc-
tion to reset interrupt enable bits.
Half-Carry Flip/Flop
Carry Flip/Flop
(timer Underflow or capture edge)
Timer T1 interrupt enable
TC2
C
TPND
Timer T1 Mode Control Bit
Timer T1 Mode Control Bit
Timer T1 Mode Control Bit
Used to start and stop the timer/counter
(1 = run, 0 = stop)
Selects G5 and G4 as MICROWIRE signals
SK and SO respectively
External interrupt edge polarity select
(00 = 2, 01 = 4, 1x = 8)
TC1 TRUN MSEL IEDG
ENTI
IPND
(Continued)
BUSY
FIGURE 16. Interrupt Block Diagram
SL1
ENI
Bit 0
Bit 0
SL0
GIE
17
DETECTION OF ILLEGAL CONDITIONS
The device incorporates a hardware mechanism that allows
it to detect illegal conditions which may occur from coding er-
rors, noise, and “brown out” voltage drop situations. Specifi-
cally, it detects cases of executing out of undefined ROM
area and unbalanced tack situations.
Reading an undefined ROM location returns 00 (hexadeci-
mal) as its contents. The opcode for a software interrupt is
also “00”. Thus a program accessing undefined ROM will
cause a software interrupt.
Reading an undefined RAM location returns an FF (hexa-
decimal). The subroutine stack on the device grows down for
each subroutine call. By initializing the stack pointer to the
top of RAM, the first unbalanced return instruction will cause
the stack pointer to address undefined RAM. As a result the
program will attempt to execute from FFFF (hexadecimal),
which is an undefined ROM location and will trigger a soft-
ware interrupt.
IPND
BUSY MICROWIRE busy shifting flag
ENI
GIE
The Half-Carry bit is also effected by all the instructions that
effect the Carry flag. The flag values depend upon the in-
struction. For example, after executing the ADC instruction
the values of the Carry and the Half-Carry flag depend upon
the operands involved. However, instructions like SET C and
RESET C will set and clear both the carry flags. Table *NO
TARGET FOR table NS2079* lists the instructions that effect
the HC and the C flags.
ADC
SUBC
SET C
RESET C
RRC
TABLE 9. Instructions Effecting HC and C Flags
Instr.
External interrupt pending
External interrupt enable
Global interrupt enable (enables interrupts)
Depends on
Operands
Depends on
Operands
Set
Set
Depends on
Operands
HC Flag
DS012529-20
Depends on
Operands
Depends on
Operands
Set
Set
Depends on
Operands
C Flag
www.national.com

Related parts for cop87l42rj