English
Language : 

COP884BC Datasheet, PDF (16/57 Pages) National Semiconductor (TI) – 8-Bit CMOS ROM Based Microcontrollers with 2k Memory, Comparators, and CAN Interface
Timers (Continued)
TIMER CONTROL FLAGS
The control bits and their functions are summarized below.
T1C3 Timer mode control
T1C2 Timer mode control
T1C1 Timer mode control
T1C0
Timer Start/Stop control in Modes 1 and 2 (Pro-
cessor Independent PWM and External Event
Counter), where 1 = Start, 0 = Stop
Timer Underflow Interrupt Pending Flag in
Mode 3 (Input Capture)
T1PNDA Timer Interrupt Pending Flag
T1ENA Timer Interrupt Enable Flag
1 = Timer Interrupt Enabled
0 = Timer Interrupt Disabled
T1PNDB Timer Interrupt Pending Flag
T1ENB Timer Interrupt Enable Flag
1 = Timer Interrupt Enabled
0 = Timer Interrupt Disabled
The timer mode control bits (T1C3, T1C2 and T1C1) are detailed below:
Mode
1
2
3
T1C3
1
1
0
0
0
1
0
1
T1C2
0
0
0
0
1
1
1
1
T1C1
1
0
0
1
0
0
1
1
Description
PWM: T1A Toggle
PWM: No T1A
Toggle
External Event
Counter
External Event
Counter
Captures:
T1A Pos. Edge
T1B Pos. Edge
Captures:
T1A Pos. Edge
T1B Neg. Edge
Captures:
T1A Neg. Edge
T1B Neg. Edge
Captures:
T1A Neg. Edge
T1B Neg. Edge
Interrupt A
Source
Autoreload RA
Autoreload RA
Interrupt B
Source
Autoreload RB
Autoreload RB
Timer
Underflow
Timer
Underflow
Pos. T1A Edge
or Timer
Underflow
Pos. T1A
Edge or Timer
Underflow
Neg. T1A
Edge or Timer
Underflow
Neg. T1A
Edge or Timer
Underflow
Pos. T1B Edge
Pos. T1B Edge
Pos. T1B Edge
Neg. T1B
Edge
Neg. T1B
Edge
Neg. T1B
Edge
Timer
Counts On
tC
tC
Pos. T1A
Edge
Pos. T1A
Edge
tC
tC
tC
tC
HIGH SPEED, CONSTANT RESOLUTION
PWM TIMER
The device has one processor independent PWM timer. The
PWM timer operates in two modes: PWM mode and capture
mode. In PWM mode the timer outputs can be programmed
to two pins PWM0 and PWM1. In capture mode, pin PWM0
functions as the capture input. Figure 12 shows a block dia-
gram for this timer in capture mode and Figure 13 shows a
block diagram for the timer in PWM mode.
PWM Timer Registers
The PWM Timer has three registers: PWMCON, the PWM
control register, RLON, the PWM on-time register and
PSCAL, the prescaler register.
PWM Prescaler Register (PSCAL) (Address X’00A0)
The prescaler is the clock source for the counter in both
PWM mode and in frequency monitor mode.
PSCAL is a read/write register that can be used to program
the prescaler. The clock source to the timer in both PWM and
capture modes can be programmed to CKI/N where N =
PSCAL + 1, so the maximum PWM clock frequency = CKI
and the minimum PWM clock frequency = CKI/256. The pro-
cessor is able to modify the PSCAL register regardless of
whether the counter is running or not and the change in fre-
quency occurs with the next underflow of the prescaler (CK-
PWM).
PWM On-time Register (RLON) (Address X’00A1)
RLON is a read/write register. In PWM mode the timer output
will be a “1” for RLON counts out of a total cycle of 255 PWM
clocks. In capture mode it is used to program the threshold
frequency.
The PWM timer is specially designed to have a resolution of
255 PWM clocks. This allows the duty cycle of the PWM out-
put to be selected between 1/255 and 254/255. A value of 0
in the RLON register will result in the PWM output being con-
tinuously low and a value of 255 will result in the PWM output
being continuously high.
Note: The effect of changing the RLON register during active PWM mode op-
eration is delayed until the boundary of a PWM cycle. In capture mode
the effect takes place immediately.
www.national.com
16