13-10
DSP56853/854/855/857/858 User’s Manual
MOTOROLA
Preliminary
Register Descriptions (TMR_BASE = $1FFE80)
13
the counter output yields a Pulse Width Modulated (PWM) signal whose frequency and
pulse width is determined by the values programmed into the TMR_CMP1 and
TMR_CMP2 registers, and the input clock frequency. This method of PWM generation
has the advantage of allowing almost any desired PWM frequency and/or constant on or
off periods. This mode of operation is often used to drive PWM amplifiers used to power
motors and inverters.
13.8.13 Compare Registers Use
The dual Compare registers (TMR_CMP1 and TMR_CMP2) provide a bidirectional
modulo count capability. The CMP1 register is used when the counter is counting up, and
the CMP2 register is used when the counter is counting down. The only exception is when
the counter is operating with alternating compare registers. The CMP1 register should be
set to the desired maximum count value or $FFFF to indicate the maximum unsigned value
prior to roll-over, and the CMP2 register should be set to the maximum negative count
value or $0000 to indicate the maximum unsigned value prior to roll-under.
If the Output mode is set to 100, the OFLAG will toggle while using alternating Compare
registers. In this Variable Frequency PWM mode, the CMP2 value defines the desired
pulse width of the on-time, and the CMP1 register defines the off-time. The Variable
Frequency PWM mode is defined for positive counting only.
One must be careful when changing CMP1 and CMP2 while the counter is active. If the
counter has already passed the new value, it will count to $FFFF or $0000, roll over/under,
and then begin counting toward the new value. (The check is for Count = Cmpx, not
Count> = Cmp1 or Count < = Cmp2).
13.8.14 Capture Register Use
The Capture register stores a copy of the counter’s value when an input edge (positive,
negative, or both) is detected. Once a capture event occurs, no further updating of the
Capture register will occur until the Input Edge Flag (IEF) is cleared by writing a 0 to the
IEF.
13.9 Register Descriptions (TMR_BASE = $1FFE80)
13.9.1 Timer Control Registers (CTL)
There are four Timer Control Registers in this occurrence. Their addresses are:
TMRA0_CTRL (Timer A, Channel 0 Control)—Address: TMRA_BASE + $6
TMRA1_CTRL (Timer A, Channel 1 Control)—Address: TMRA_BASE + $E
TMRA2_CTRL (Timer A, Channel 2 Control)—Address: TMRA_BASE + $16
TMRA3_CTRL (Timer A, Channel 3 Control)—Address: TMRA_BASE + $1E