English
Language : 

PIC18F47J53 Datasheet, PDF (262/586 Pages) Microchip Technology – 28/44-Pin, High-Performance USB Microcontrollers with nanoWatt XLP Technology
PIC18F47J53 FAMILY
18.1.2 OPEN-DRAIN OUTPUT OPTION
When operating in Output mode (the Compare or PWM
modes), the drivers for the CCPx pins can be optionally
configured as open-drain outputs. This feature allows
the voltage level on the pin to be pulled to a higher level
through an external pull-up resistor and allows the out-
put to communicate with external circuits without the
need for additional level shifters.
The open-drain output option is controlled by the
CCPxOD bits (ODCON1<7:0> and ODCON2<3:2>).
Setting the appropriate bit configures the pin for the
corresponding module for open-drain operation.
18.2 Capture Mode
In Capture mode, the CCPR4H:CCPR4L register pair
captures the 16-bit value of the TMR1 or TMR3 register
when an event occurs on the CCP4 pin, RB4. An event
is defined as one of the following:
• Every falling edge
• Every rising edge
• Every 4th rising edge
• Every 16th rising edge
The event is selected by the mode select bits,
CCP4M<3:0> (CCP4CON<3:0>). When a capture is
made, the interrupt request flag bit, CCP4IF (PIR4<1>),
is set. (It must be cleared in software.) If another
capture occurs before the value in register, CCPR4, is
read, the old captured value is overwritten by the new
captured value.
Figure 18-1 shows the Capture mode block diagram.
18.2.1 CCP PIN CONFIGURATION
In Capture mode, the appropriate CCPx pin should be
configured as an input by setting the corresponding
TRIS direction bit.
Note: If RB4 is configured as a CCP4 output, a
write to the port causes a capture condition.
18.2.2 TIMER1/3/5 MODE SELECTION
For the available timers (1/3/5) to be used for the capture
feature, the used timers must be running in Timer mode
or Synchronized Counter mode. In Asynchronous
Counter mode, the capture operation may not work.
The timer to be used with each CCP module is selected
in the CCPTMRSx registers. (See Section 18.1.1 “CCP
Modules and Timer Resources”.)
Details of the timer assignments for the CCP modules
are given in Table 18-2 and Table 18-3.
FIGURE 18-1:
CAPTURE MODE OPERATION BLOCK DIAGRAM
CCP5 Pin
Prescaler
 1, 4, 16
Set CCP5IF
C5TSEL0
and
Edge Detect
C5TSEL0
CCP5CON<3:0> 4
Q1:Q4 4
CCP4CON<3:0> 4
Set CCP4IF
C4TSEL1
C4TSEL0
CCP4 Pin
Prescaler
 1, 4, 16
and
Edge Detect
C4TSEL0
C4TSEL1
TMR5H TMR5L
TMR5
Enable
CCPR5H CCPR5L
TMR1
Enable
TMR1H
TMR1L
TMR3H
TMR3L
TMR3
Enable
CCPR4H CCPR4L
TMR1
Enable
TMR1H
TMR1L
Note:
This block diagram uses CCP4 and CCP5 and their appropriate timers as an example. For details on all of
the CCP modules and their timer assignments, see Table 18-2 and Table 18-3.
DS39964B-page 262
Preliminary
 2010 Microchip Technology Inc.