Техническая Спецификация для Microchip Technology ARD00385

Скачать
Страница из 570
PIC18F87K90 FAMILY
DS39957D-page 254
 2009-2011 Microchip Technology Inc.
In addition to the expanded range of modes available
through the CCPxCON and ECCPxAS registers, the
ECCP modules have two additional registers associated
with Enhanced PWM operation and auto-shutdown
features. They are:
• ECCPxDEL – Enhanced PWM Control
• PSTRxCON – Pulse Steering Control
19.1
ECCP Outputs and Configuration
The Enhanced CCP module may have up to four PWM
outputs, depending on the selected operating mode.
The CCPxCON register is modified to allow control
over four PWM outputs: ECCPx/PxA, PxB, PxC and
PxD. Applications can use one, two or four of these
outputs.
The outputs that are active depend on the selected
ECCP operating mode. The pin assignments are
summarized in 
To configure the I/O pins as PWM outputs, the proper
PWM mode must be selected by setting the PxM<1:0>
and CCPxM<3:0> bits. The appropriate TRIS direction
bits for the PORT pins must also be set as outputs.
19.1.1
ECCP MODULE AND TIMER 
RESOURCES
The ECCP modules use Timers, 1, 2, 3, 4, 6, 8, 10 or 12,
depending on the mode selected. These timers are
available to CCP modules in Capture, Compare or PWM
modes, as shown in 
TABLE 19-1:
ECCP MODE – TIMER 
RESOURCE 
The assignment of a particular timer to a module is
determined by the timer to ECCP enable bits in the
CCPTMRSx register (
). The interactions
between the two modules are depicted in 
Capture operations are designed to be used when the
timer is configured for Synchronous Counter mode.
Capture operations may not work as expected if the
associated timer is configured for Asynchronous Counter
mode.
19.1.2
ECCP PIN ASSIGNMENT
The pin assignment for ECCPx (capture input,
compare and PWM output) can change, based on
device configuration. The ECCPMX (CONFIG3H<1>)
Configuration bit determines which pins, ECCP1 and
ECCP3, are multiplexed to.
• Default/ECCPMX = 1: 
- ECCP1 (P1B/P1C) is multiplexed onto RE6 
and RE5
- ECCP3 (P3B/P3C) is multiplexed onto RE4 
and RE3
• ECCPMX = 0:
- ECCP1 (P1B/P1C) is multiplexed onto RH7 
and RH6
- ECCP3 (P3B/P3C) is multiplexed onto RH5 
and RH4.
The pin assignment for ECCP2 (capture input,
compare and PWM output) can change, based on
device configuration.
The CCP2MX Configuration bit (CONFIG3H<0>)
determines which pin, ECCP2, is multiplexed to.
• If CCP2MX = 1 (default) – ECCP2 is multiplexed 
to RC1
• If CCP2MX = 0 – ECCP2 is multiplexed to:
- RE7 is the ECCP2 pin with CCP2MX = 0
ECCP Mode
Timer Resource
Capture
Timer1 or Timer3
Compare
Timer1 or Timer3
PWM
Timer2, Timer4, Timer6, Timer8, 
Timer10 or Timer12