English
Language : 

PIC18F2331_07 Datasheet, PDF (170/400 Pages) Microchip Technology – 28/40/44-Pin Enhanced Flash Microcontrollers with nanoWatt Technology, High Performance PWM and A/D
PIC18F2331/2431/4331/4431
16.1.8 SPECIAL EVENT TRIGGER
(CAP1 ONLY)
The Special Event Trigger mode of IC1
(CAP1M3:CAP1M0 = 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 16-2.
TABLE 16-2: SPECIAL EVENT TRIGGER
CAP1M3:
CAP1M0
Description
1110
1111
The trigger occurs on every falling
edge on the CAP1 input.
The trigger occurs on every rising
edge on the CAP1 input.
16.1.9 OPERATING MODES SUMMARY
Table 16-3 shows a summary of the input capture
configuration when used in conjunction with the TMR5
timer resource.
16.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.
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 16.2.6 “Velocity
Measurement”.
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 16-3: INPUT CAPTURE TIME BASE RESET SUMMARY
Pin CAPxM
Mode
Timer
Reset Timer
on Capture
Description
CAP1 0001-0100 Edge Capture
TMR5
optional(1) Simple Edge Capture mode (includes a
selectable prescaler).
0101 Period Measurement TMR5
optional(1) Captures Timer5 on period boundaries.
0110-0111 Pulse-Width
Measurement
TMR5
always Captures Timer5 on pulse boundaries.
1000
Input Capture on State TMR5
Change
optional(1) Captures Timer5 on state change.
1110-1111 Special Event Trigger TMR5
(rising or falling edge)
optional(2)
Used as a Special Event Trigger to be
used with the Timer5 or other peripheral
modules.
CAP2 0001-0100 Edge Capture
TMR5
optional(1) Simple Edge Capture mode (includes a
selectable prescaler).
0101 Period Measurement TMR5
optional(1) Captures Timer5 on period boundaries.
0110-0111 Pulse-Width
Measurement
TMR5
always Captures Timer5 on pulse boundaries.
1000
Input Capture on State TMR5
Change
optional(1) Captures Timer5 on state change.
CAP3 0001-0100 Edge Capture
TMR5
optional(1) Simple Edge Capture mode (includes a
selectable prescaler).
0101 Period Measurement TMR5
optional(1) Captures Timer5 on period boundaries.
0110-0111 Pulse-Width
Measurement
TMR5
always Captures Timer5 on pulse boundaries.
1000
Input Capture on State TMR5
Change
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 = 0 in the T5CON register.
DS39616C-page 168
Preliminary
© 2007 Microchip Technology Inc.