English
Language : 

PIC18F2331 Datasheet, PDF (191/396 Pages) Microchip Technology – 28/40/44-Pin Enhanced Flash Microcontrollers with nanoWatt Technology, High Performance PWM and A/D
PIC18F2331/2431/4331/4431
TABLE 17-1: MINIMUM PWM FREQUENCY
Minimum PWM Frequencies vs. Prescaler Value
for FCYC = 10 MIPS, (PTPER = 0FFFh)
Prescale
1:1
1:4
1:16
1:64
PWM
Frequency
Edge-aligned
2441 Hz
610 Hz
153 Hz
38 Hz
PWM
Frequency
Center-aligned
1221 Hz
305 Hz
76 Hz
19 Hz
17.3.5 PWM TIME BASE POSTSCALER
The match output of PTMR can optionally be
post-scaled through a 4-bit postscaler (which gives a
1:1 to 1:16 scaling inclusive) to generate an interrupt.
The postscaler counter is cleared when any of the
following occurs:
• Write to the PTMR register
• Write to the PTCON register
• Any device Reset
The PTMR register is not cleared when PTCON is
written.
17.4 PWM Time Base Interrupts
The PWM timer can generate interrupts based on the
modes of operation selected by PTMOD<1:0> bits and
the postscaler bits (PTOPS<3:0>).
17.4.1 INTERRUPTS IN FREE RUNNING
MODE
When the PWM time base is in the Free Running mode
(PTMOD<1:0> = 00), an interrupt event is generated
each time a match with the PTPER register occurs. The
PTMR register is reset to zero in the following clock
edge.
Using a postscaler selection other than 1:1 will reduce
the frequency of interrupt events.
FIGURE 17-5:
PWM TIME BASE INTERRUPT TIMING, FREE RUNNING MODE
A: PRESCALER = 1:1
FOSC/4
PTMR
Q1 Q2 Q3 Q4 Q1 Q2 Q3 Q4 Q1 Q2 Q3 Q4 Q1 Q2 Q3 Q4 Q1 Q2 Q3 Q4
FFEh
1
FFFh
000h
001h
002h
PTMR_INT_REQ
PTIF bit
B: PRESCALER = 1:4
Q4 Q4
Qc Qc Qc Qc Qc Qc Qc Qc Qc Qc Qc Qc Qc Qc Qc Qc Qc Qc Qc Qc
PTMR
PTMR_INT_REQ
FFEh
1
FFFh
000h
001h
002h
PTIF bit
Note 1: PWM Time Base Period register, PTPER, is loaded with the value FFFh for this example.
 2003 Microchip Technology Inc.
Preliminary
DS39616B-page 189