cp3bt13 National Semiconductor Corporation, cp3bt13 Datasheet - Page 164

no-image

cp3bt13

Manufacturer Part Number
cp3bt13
Description
Cp3bt13 Reprogrammable Connectivity Processor With Bluetooth-r And Can Interfaces
Manufacturer
National Semiconductor Corporation
Datasheet
www.national.com
23.2.1
Mode 1 is the Processor-Independent Pulse Width Modula-
tion (PWM) mode, which generates pulses of a specified
width and duty cycle, and which also provides a separate
general-purpose timer/counter.
Figure 88 is a block diagram of the Multi-Function Timer
configured to operate in Mode 1. Timer/Counter 1 (TCNT1)
On the first underflow, the timer is loaded from the TCRA
register, then from the TCRB register on the next underflow,
then from the TCRA register again on the next underflow,
and so on. Every time the counter is stopped and restarted,
it always obtains its first reload value from the TCRA regis-
ter. This is true whether the timer is restarted upon reset, af-
ter entering Mode 1 from another mode, or after stopping
and restarting the clock with the Timer/Counter 1 clock se-
lector.
The timer can be configured to toggle the TA output bit on
each underflow. This generates a clock signal on the TA out-
put with the width and duty cycle determined by the values
stored in the TCRA and TCRB registers. This is a “proces-
sor-independent” PWM clock because once the timer is set
up, no more action is required from the CPU to generate a
continuous PWM signal.
Mode 1: Processor-Independent PWM
Selector
Timer 1
Timer 2
Clock
Clock
Clock
Figure 88. Processor-Independent PWM Mode
Reload A = Time 1
Reload B = Time 2
Timer/Counter 1
Timer/Counter 2
TCNT1
TCNT2
TCRA
TCRB
Underflow
Underflow
164
functions as the time base for the PWM timer. It counts
down at the clock rate selected for the counter. When an un-
derflow occurs, the timer register is reloaded alternately
from the TCRA and TCRB registers, and counting proceeds
downward from the loaded value.
The timer can be configured to generate separate interrupts
upon reload from the TCRA and TCRB registers. The inter-
rupts can be enabled or disabled under software control.
The CPU can determine the cause of each interrupt by look-
ing at the TAPND and TBPND bits, which are updated by
the hardware on each occurrence of a timer reload.
In Mode 1, Timer/Counter 2 (TCNT2) can be used either as
a simple system timer, an external event counter, or a pulse-
accumulate counter. The clock counts down using the clock
selected with the Timer/Counter 2 clock selector. It gener-
ates an interrupt upon each underflow if the interrupt is en-
abled with the TDIEN bit.
TDPND
TAPND
TBPND
TBIEN
TDIEN
TAIEN
TAEN
Timer
Interrupt A
Timer
Interrupt B
Timer
Interrupt D
DS084
TA
TB

Related parts for cp3bt13