PIC18F2331/2431/4331/4431
17.1.8
SPECIAL EVENT TRIGGER
(CAP1 ONLY)
17.1.9
OPERATING MODES SUMMARY
Table 17-3 shows a summary of the input capture
configuration when used in conjunction with the TMR5
timer resource.
The Special Event Trigger mode of IC1
(CAP1M<3:0> = 1110 or 1111) enables the Special
Event Trigger signal. The trigger signal can be used as
the Special Event Trigger Reset input to TMR5,
resetting the timer when the specific event happens on
IC1. The events are summarized in Table 17-2.
17.1.10 OTHER OPERATING MODES
Although the IC and QEI submodules are mutually
exclusive, the IC can be reconfigured to work with the
QEI module to perform specific functions. In effect, the
QEI “borrows” hardware from the IC to perform these
operations.
TABLE 17-2: SPECIAL EVENT TRIGGER
CAP1M<3:0>
Description
For velocity measurement, the QEI uses dedicated
hardware in channel IC1. The CAP1BUF registers are
remapped, becoming the VELR registers. Its operation
and use are described in Section 17.2.6 “Velocity
Measurement”.
1110
The trigger occurs on every falling
edge on the CAP1 input.
1111
The trigger occurs on every rising
edge on the CAP1 input.
While in QEI mode, the CAP2BUF and CAP3BUF reg-
isters of channel IC2 and IC3 are used for position
determination. They are remapped as the POSCNT
and MAXCNT Buffer registers, respectively.
TABLE 17-3: INPUT CAPTURE TIME BASE RESET SUMMARY
Reset Timer
Pin
CAPxM
Mode
Timer
Description
on Capture
CAP1 0001-0100 Edge Capture
TMR5
optional(1)
Simple Edge Capture mode (includes a
selectable prescaler).
0101
Period Measurement
TMR5
TMR5
optional(1)
always
Captures Timer5 on period boundaries.
Captures Timer5 on pulse boundaries.
0110-0111 Pulse-Width
Measurement
1000
Input Capture on State
Change
TMR5
TMR5
optional(1)
optional(2)
Captures Timer5 on state change.
1110-1111 Special Event Trigger
Used as a Special Event Trigger to be
used with the Timer5 or other peripheral
modules.
(rising or falling edge)
CAP2 0001-0100 Edge Capture
TMR5
optional(1)
Simple Edge Capture mode (includes a
selectable prescaler).
0101
Period Measurement
TMR5
TMR5
optional(1)
always
Captures Timer5 on period boundaries.
Captures Timer5 on pulse boundaries.
0110-0111 Pulse-Width
Measurement
1000
Input Capture on State
Change
CAP3 0001-0100 Edge Capture
TMR5
TMR5
optional(1)
optional(1)
Captures Timer5 on state change.
Simple Edge Capture mode (includes a
selectable prescaler).
0101
Period Measurement
TMR5
TMR5
optional(1)
always
Captures Timer5 on period boundaries.
Captures Timer5 on pulse boundaries.
0110-0111 Pulse-Width
Measurement
1000
Input Capture on State
Change
TMR5
optional(1)
Captures Timer5 on state change.
Note 1: Timer5 may be reset on capture events only when CAPxREN = 1.
2: Trigger mode will not reset Timer5 unless RESEN = 0in the T5CON register.
DS39616D-page 160
2010 Microchip Technology Inc.