English
Language : 

PIC18F2220_07 Datasheet, PDF (144/386 Pages) Microchip Technology – 28/40/44-Pin High-Performance, Enhanced Flash Microcontrollers with 10-Bit A/D and nanoWatt Technology
PIC18F2220/2320/4220/4320
In addition to the expanded functions of the CCP1CON
register, the ECCP module has two additional registers
associated with enhanced PWM operation and
Auto-Shutdown features:
• PWM1CON
• ECCPAS
All other registers associated with the ECCP module
are identical to those used for the CCP1 module in
PIC18F2X20 devices, including register and individual
bit names. Likewise, the timer assignments and inter-
actions between the two CCP modules are identical,
regardless of whether CCP1 is a standard or enhanced
module.
16.1 ECCP Outputs
The Enhanced CCP module may have up to four outputs
depending on the selected operating mode. These out-
puts, designated P1A through P1D, are multiplexed with
I/O pins on PORTC and PORTD. The pin assignments
are summarized in Table 16-1.
To configure I/O pins as PWM outputs, the proper PWM
mode must be selected by setting the P1Mn and
CCP1Mn bits (CCP1CON<7:6> and <3:0>, respec-
tively). The appropriate TRISC and TRISD direction
bits for the port pins must also be set as outputs.
16.2 Capture and Compare Modes
The Capture and Compare modes of the ECCP module
are identical in operation to that of CCP1, as discussed
in Section 15.3 “Capture Mode” and Section 15.4
“Compare Mode”. No changes are required when
moving between these modules on PIC18F2X20 and
PIC18F4X20 devices.
16.3 Standard PWM Mode
When configured in Single Output mode, the ECCP
module functions identically to the standard CCP
module in PWM mode, as described in Section 15.4
“Compare Mode”.
Note:
When setting up single output PWM opera-
tions, users are free to use either of the pro-
cesses described in Section 15.5.3 “Setup
for PWM Operation” or Section 16.4.7
“Setup for PWM Operation”. The latter is
more generic but will work for either single
or multi output PWM.
TABLE 16-1: PIN ASSIGNMENTS FOR VARIOUS ECCP MODES
ECCP Mode
CCP1CON
Configuration
RC2
RD5
RD6
RD7
Compatible CCP
00xx11xx
CCP1
RD5/PSP5 RD6/PSP6 RD7/PSP7
Dual PWM
10xx11xx
P1A
P1B
RD6/PSP6 RD6/PSP6
Quad PWM
x1xx11xx
P1A
P1B
P1C
P1D
Legend: x = Don’t care. Shaded cells indicate pin assignments not used by ECCP in a given mode.
Note 1: TRIS register values must be configured appropriately.
2: With ECCP in Dual or Quad PWM mode, the PSP input/output control of PORTD is overridden by P1B,
P1C and P1D.
DS39599F-page 142
© 2007 Microchip Technology Inc.