
PIC18F1230/1330
DS39758D-page 126
2009 Microchip Technology Inc.
FIGURE 14-5:
PWM TIME BASE INTERRUPT TIMING, FREE-RUNNING MODE
14.4.2
INTERRUPTS IN SINGLE-SHOT
MODE
When the PWM time base is in the Single-Shot mode
(PTMOD<1:0> = 01), an interrupt event is generated
when a match with the PTPER register occurs. The
PWM Time Base register (PTMR) is reset to zero on
the following input clock edge and the PTEN bit is
cleared. The postscaler selection bits have no effect in
this Timer mode.
14.4.3
INTERRUPTS IN CONTINUOUS
UP/DOWN COUNT MODE
In
the
Continuous
Up/Down
Count
mode
(PTMOD<1:0> = 10), an interrupt event is generated
each time the value of the PTMR register becomes
zero and the PWM time base begins to count upwards.
The postscaler selection bits may be used in this Timer
mode to reduce the frequency of the interrupt events.
Down Count mode.
Q2
Q1
Q3
Q4
Q2
Q1
Q3
Q4
Q2
Q1
Q3
Q4
Q2
Q1
Q3
Q4
Q2
Q1
Q3
Q4
FOSC/4
PTMR_INT_REQ
FFEh
FFFh
000h
001h
002h
PTIF bit
Note 1:
PWM Time Base Period register, PTPER, is loaded with the value FFFh for this example.
Qc
PTIF bit
PTMR
FFEh
FFFh
001h
002h
1
A: PRESCALER = 1:1
B: PRESCALER = 1:4
PTMR
PTMR_INT_REQ
Q4
1
000h