
ADuC7019/20/21/22/24/25/26/27/28
Rev. B | Page 76 of 92
FIQ
The fast interrupt request (FIQ) is the exception signal to enter
the FIQ mode of the processor. It is provided to service data
transfer or communication channel tasks with low latency. The
FIQ interface is identical to the IRQ interface providing the
second-level interrupt (highest priority). Four 32-bit registers
are dedicated to FIQ: FIQSIG, FIQEN, FIQCLR, and FIQSTA.
FIQSTA Register
Name
Address
Default Value
Access
FIQSTA
0xFFFF0100
0x00000000
R
FIQSIG Register
Name
Address
Default Value
Access
FIQSIG
0xFFFF0104
0x00XXX000
R
FIQEN Register
Name
Address
Default Value
Access
FIQEN
0xFFFF0108
0x00000000
R/W
FIQCLR Register
Name
Address
Default Value
Access
FIQCLR
0xFFFF010C
0x00000000
W
Bit 31 to Bit 1 of FIQSTA are logically OR’ed to create the FIQ
signal to the core and to Bit 0 of both the FIQ and IRQ registers
(FIQ source).
The logic for FIQEN and IRQEN does not allow an interrupt
source to be enabled in both IRQ and FIQ masks. A bit set to 1
in FIQEN does, as a side effect, clear the same bit in IRQEN.
Also, a bit set to 1 in IRQEN does, as a side effect, clear the
same bit in FIQEN. An interrupt source can be disabled in both
IRQEN and FIQEN masks.
Note that to clear an already enabled FIQ source, users must set
the appropriate bit in the FIQCLR register. Clearing an
interrupt’s FIQEN bit does not disable this interrupt.
Programmed Interrupts
Because the programmed interrupts are nonmaskable, they are
controlled by another register, SWICFG, which simultaneously
writes into the IRQSTA and IRQSIG registers, and/or the
FIQSTA and FIQSIG registers. The 32-bit register dedicated to
software interrupts is SWICFG (see
Table 74). This MMR
allows the control of a programmed source interrupt.
SWICFG Register
Name
Address
Default Value
Access
SWICFG
0xFFFF0010
0x00000000
W
Table 74. SWICFG MMR Bit Descriptions
Bit
Description
31:3
Reserved.
2
Programmed Interrupt (FIQ). Setting/Clearing this bit
corresponds with setting/clearing Bit 1 of FIQSTA
and FIQSIG.
1
Programmed Interrupt (IRQ). Setting/Clearing this bit
corresponds with setting/clearing Bit 1 of IRQSTA
and IRQSIG.
0
Reserved.
Note that any interrupt signal must be active for at least the
equivalent of the interrupt latency time, which is detected by
the interrupt controller and by the user in the IRQSTA/FIQSTA
register.
TIMERS
The ADuC7019/20/21/22/24/25/26/27/28 have four general-
purpose timer/counters:
Timer0
Timer1
Timer2 or Wake-Up Timer
Timer3 or Watchdog Timer
These four timers in their normal mode of operation can be
either free-running or periodic.
In free-running mode, the counter decreases from the
maximum value until zero scale and starts again at the
minimum value. (It also increases from the minimum value
until full scale and starts again at the maximum value.)
In periodic mode, the counter decrements/increments from the
value in the load register (TxLD MMR) until zero/full scale and
starts again at the value stored in the load register.
The timer interval is calculated as follows:
(
)
Clock
Source
Prescaler
TxD
Interval
×
=
The value of a counter can be read at any time by accessing its
value register (TxVAL). Note that when a timer is being clocked
from a clock other than core clock, an incorrect value may be
read (due to asynchronous clock system). In this configuration,
TxVAL should always be read twice. If the two readings are
different, it should be read a third time to get the correct value.
Timers are started by writing in the control register of the
corresponding timer (TxCON).
In normal mode, an IRQ is generated each time the value of the
counter reaches zero when counting down. It is also generated
each time the counter value reaches full scale when counting
up. An IRQ can be cleared by writing any value to clear the
register of that particular timer (TxCLRI).
When using an asynchronous clock-to-clock timer, the
interrupt in the timer block could take more time to clear
than the time it takes for the code in the interrupt routine to
execute. Ensure that the interrupt signal is cleared before
leaving the interrupt service routine. This can be done by
checking the IRQSTA MMR.