English
Language : 

PIC16F193X Datasheet, PDF (196/418 Pages) Microchip Technology – 28/40/44-Pin Flash-Based, 8-Bit CMOS Microcontrollers with LCD Driver and nanoWatt Technology
PIC16F193X/LF193X
19.5.4 OPERATION IN SLEEP MODE
In Sleep mode, the TMRx register will not increment
and the state of the module will not change. If the CCPx
pin is driving a value, it will continue to drive that value.
When the device wakes up, TMRx will continue from its
previous state.
19.5.5 CHANGES IN SYSTEM CLOCK
FREQUENCY
The PWM frequency is derived from the system clock
frequency. Any changes in the system clock frequency
will result in changes to the PWM frequency. See
Section 8.0 “Oscillator Module (With Fail-Safe
Clock Monitor)” for additional details.
19.5.6 EFFECTS OF RESET
Any Reset will force all ports to Input mode and the
CCP registers to their Reset states.
19.5.7 SETUP FOR PWM OPERATION
The following steps should be taken when configuring
the CCP module for PWM operation:
1. Disable the PWM pin (CCPx) output driver(s) by
setting the associated TRIS bit(s).
2. Load the PRx register with the PWM period value.
3. Configure the CCP module for the PWM mode
by loading the CCPxCON register with the
appropriate values.
4. Load the CCPRxL register and the DCxBx bits of
the CCPxCON register, with the PWM duty cycle
value.
5. Configure and start Timerx:
• Clear the TMRxIF interrupt flag bit of the PIRx
register. See Note below.
• Configure the TxCKPS bits of the TxCON
register with the Timerx prescale value.
• Enable Timerx by setting the TMRxON bit of
the T2CON register.
6. Enable PWM output pin:
• Wait until Timerx overflows, TMRxIF bit of the
PIR1 register is set. See Note below.
• Enable the PWM pin (CCPx) output driver(s) by
clearing the associated TRIS bit(s).
Note:
In order to send a complete duty cycle and
period on the first PWM output, the above
steps must be included in the setup
sequence. If it is not critical to start with a
complete PWM signal on the first output,
then step 6 may be ignored.
DS41364A-page 194
Preliminary
© 2008 Microchip Technology Inc.