
M68HC11
REFERENCE MANUAL
PULSE ACCUMULATOR
MOTOROLA
11-5
1 = Pulse accumulator enabled.
When the pulse accumulator is disabled, the 8-bit counter stops counting, and pulse
accumulator interrupts are inhibited. Though the flags cannot become set, they will re-
main set if they were ones at the time the pulse accumulator was disabled.
PAMOD — Pulse Accumulator Mode Select
0 = External event counting mode (pin acts as clock).
1 = Gated time accumulation mode (pin acts as clock enable for E divided by 64
clock).
PEDGE — Pulse Accumulator Edge Select
0 = Pulse accumulator responds to falling edges (inhibit gate level is zero).
1 = Pulse accumulator responds to rising edges (inhibit gate level is one).
In gated time accumulation mode (PAMOD = 1), the PEDGE bit has added meaning.
In addition to specifying the edge polarity that causes the PAIF bit to be set, PEDGE
also controls the inhibit gate level, which disables the internal, free-running E divided
by 64 clock to the pulse accumulator counter. The PAIF interrupts occur at the trailing
edge of a gate enable signal; thus, selecting falling edges causes the free-running E
divided by 64 clock to be disabled while the PAI pin is low.
The following registers and paragraphs explain the pulse accumulator interrupt flags
and the pulse accumulator interrupt enable bits. The other bits in these registers not
related to the pulse accumulator system are discussed in
SECTION 10 MAIN TIMER
AND REAL-TIME INTERRUPT
.
PAOVI, PAOVF — Pulse Accumulator Overflow Interrupt Enable and Flag
The PAOVF status bit is automatically set to one each time the pulse accumulator
count rolls over from $FF to $00. This status bit is cleared by writing to the TFLG2 reg-
ister with a one in the corresponding data bit position (bit 4). The PAOVI control bit al-
lows the user to configure the pulse accumulator overflow for polled or interrupt-driven
operation but does not affect the setting or clearing of PAOVF. When PAOVI is zero,
pulse accumulator overflow interrupts are inhibited, and the system is operating in a
polled mode. In this mode, PAOVF must be polled (sampled) by user software to de-
termine when an overflow has occurred. When the PAOVI control bit is one, a hard-
ware interrupt request is generated each time PAOVF is set to one. Before leaving the
interrupt service routine, software must clear PAOVF by writing to the TFLG2 register.
For additional information, refer to
10.2.4 Tips for Clearing Timer Flags
.
TMSK2 —
Timer Interrupt Mask 2 Register
$1024
BIT 7
TOI
0
6
5
4
3
0
0
2
0
0
1
BIT 0
PR0
0
RTII
0
PAOVI
0
PAII
0
PR1
0
RESET:
TFLG2 —
Timer Interrupt Flag 2 Register
$1025
BIT 7
TOF
0
6
5
4
3
0
0
2
0
0
1
0
0
BIT 0
0
0
RTIF
0
PAOVF
0
PAIF
0
RESET: