IBM PPC440X5 Computer Hardware User Manual


 
User’s Manual
PPC440x5 CPU Core Preliminary
Page 212 of 589
timers.fm.
September 12, 2002
Using mtspr to force the DEC to 0 does not cause a Decrementer exception and thus does not cause
TSR[DIS] to be set. However, if a time base clock causes a decrement from a DEC value of 1 to occur simul-
taneously with the writing of the DEC by a mtspr instruction, then the Decrementer exception will occur,
TSR[DIS] will be set, and the DEC will be written with the value from the mtspr.
In order for software to quiesce the activity of the DEC and eliminate all DEC exceptions, the following proce-
dure should be followed:
1. Write 0 to TCR[DIE]. This prevents a Decrementer exception from causing a Decrementer interrupt.
2. Write 0 to TCR[ARE]. This disables the DEC auto-reload feature.
3. Write 0 to the DEC to halt decrementing. Although this action does not itself cause a Decrementer excep-
tion, it is possible that a decrement from a DEC value of 1 has occurred since the last time that TSR[DIS]
was cleared.
4. Write 1 to TSR[DIS] (DEC Interrupt Status bit). This clears the Decrementer exception by setting
TSR[DIS] to 0. Because the DEC is no longer decrementing (due to having been written with 0 in step 3),
no further Decrementer exceptions are possible.
7.3 Fixed Interval Timer (FIT)
The FIT provides a mechanism for causing periodic exceptions with a regular period. The FIT would typically
be used by system software to invoke a periodic system maintenance function, executed by the Fixed Interval
Timer interrupt handler.
A Fixed Interval Timer exception occurs on a 01 transition of a selected bit from the time base. Note that a
Fixed Interval Timer exception will also occur if the selected time base bit transitions from 01 due to a
mtspr instruction that writes 1 to that time base bit when its previous value was 0.
The Fixed Interval Timer Period (FP) field of the TCR selects one of four bits from the time base, as shown in
Table 7-1.
Figure 7-5. Decrementer Auto-Reload (DECAR)
0:31 Decrementer auto-reload value
Copied to DEC at next time base clock when
DEC = 1 and auto-reload is enabled
(TCR[ARE] = 1).
Table 7-1. Fixed Interval Timer Period Selection
TCR[FP] Time Base Bit
Period
(Time Base Clocks)
Period
(400 Mhz Clock)
0b00 TBL
19
2
13
clocks 20.48 µs
0b01 TBL
15
2
17
clocks 327.68 µs
0b10 TBL
11
2
21
clocks 5.2 ms
0 31