Download Microprocessor Peripherals UPI- 41A 41AH 42 42AH User`s Manual

Transcript
UPI-41A/41AH/42/42AH USER’S MANUAL
operations. Both Carry and Auxiliary Carry are part of
the Program Status Word (PSW) and are stored in the
stack during subroutine calls. The F0 and F1 flags are
general-purpose flags which can be cleared or complemented by UPI instructions. F0 is accessible via the
Program Status Word and is stored in the stack with
the Carry flags. F1 reflects the condition of the A0 line,
and caution must be used when setting or clearing it.
Register Operations
The working registers can be accessed via the accumulator as explained above, or they can be loaded with
immediate data constants from program memory. In
addition, they can be incremented or decremented directly, or they can be used as loop counters as explained
in the section on branch instructions.
in a single instruction which is useful in implementing a
loop counter. This instruction can designate any of the
8 working registers as a counter and can effect a branch
to any address within the current page of execution.
A special indirect jump instruction (JMPP @ A) allows
the program to be vectored to any one of several different locations based on the contents of the accumulator.
The contents of the accumulator point to a location in
program memory which contains the jump address. As
an example, this instruction could be used to vector to
any one of several routines based on an ASCII character which has been loaded into the accumulator. In this
way, ASCII inputs can be used to initiate various routines.
Control
Additional Data Memory locations can be accessed
with indirect instructions via R0 and R1.
The UPI-41A/41AH/42/42AH Instruction Set has six
instructions for control of the DMA, interrupts, and
selection of working registers banks.
Branch Instructions
The UPI-41A/41AH/42/42AH provides two instructions for control of the external microcomputer system.
IBF and OBF flags can be routed to PORT 2 allowing
interrupts of the external processor. DMA handshaking
signals can also be enabled using lines from PORT 2.
The UPI-41A/41AH/42/42AH Instruction Set includes 17 jump instructions. The unconditional allows
jumps anywhere in the 1K words of program memory.
All other jump instructions are limited to the current
page (256 words) of program memory.
Conditional jump instructions can test the following inputs and maching flags:
#
#
#
#
#
#
#
#
#
#
TEST 0 input pin
TEST 1 input pin
Input Buffer Full flag
Output Buffer Full flag
Timer flag
Accumulator zero
Accumulator bit
Carry flag
F0 flag
The IBF interrupt can be enabled and disabled using
two instructions. Also, the interrupt is automatically
disabled following a RESET input or during an interrupt service routine.
The working register bank switch instructions allow the
programmer to immediately substitute a second 8 register bank for the one in use. This effectively provides
either 16 working registers or the means for quickly
saving the contents of the first 8 registers in response to
an interrupt. The user has the option of switching register banks when an interrupt occurs. However, if the
banks are switched, the original bank will automatically
be restored upon execution of a return and restore
status (RETR) instruction at the end of the interrupt
service routine.
F1 flag
The conditions tested by these instructions are the
instantaneous values at the time the conditional jump
instruction is executed. For instance, the jump on accumulator zero instruction tests the accumulator itself,
not an intermediate flag.
Timer
The decrement register and jump if not zero (DJNZ)
instruction combines decrement and branch operations
The counter can be started as a timer with an internal
clock source or as an event counter or timer with an
The 8-bit on-board timer/counter can be loaded or read
via the accumulator while the counter is stopped or
while counting.
27