3
Program Control
3 – 11
When the IDLE (n) instruction is used, it effectively slows down the
processor’s internal clock and thus its response time to incoming
interrupts. The one-cycle interrupt response time of the standard idle state
is increased by n, the clock divisor. When an enabled interrupt is received,
the processor will remain in the idle state for up to a maximum of n
processor cycles before resuming normal operation (n = 16, 32, 64, or 128).
When the IDLE (n) instruction is used in systems that have an externally
generated serial clock (SCLK), the serial clock rate may be faster than the
processor’s reduced internal clock rate. Under these conditions, interrupts
must not be generated at a faster rate than can be serviced, due to the
additional time the processor takes to come out of the idle state (a
maximum of n processor cycles).
3.4
INTERRUPTS
The program sequencer’s interrupt controller responds to interrupts by
shifting control to the instruction located at the appropriate interrupt
vector address. Tables 3.2–3.7 show the interrupts and associated vector
addresses for each processor of the ADSP-2100 family. (Note that SPORT1
can be configured as either a serial port or as a collection of control pins
including two external interrupt inputs,
IRQ0
and
IRQ1
. See Chapter 5,
“Serial Ports,” for more information about the configuration of SPORT1.)
The interrupt vector locations are spaced four program memory locations
apart—this allows short interrupt service routines to be coded in place,
with no jump to the service routine required. For interrupt service
routines with more than four instructions, however, program control must
be transferred to the service routine by means of a jump instruction placed
at the interrupt vector location.
After an interrupt has been serviced, an RTI (Return From Interrupt)
instruction returns control to the main program by popping the top value
on the PC stack into the PC; the status stack is also popped to restore the
previous processor state.
Interrupts can also be forced under software control; see the discussion of
the IFC register below.