200
CHAPTER 8 8-BIT TIMER/EVENT COUNTERS 50, 51
User’s Manual U15798EJ2V0UD
8.5.4 PWM output operation
The 8-bit timer/event counter operates as PWM output when bit 6 (TMC5n6) of 8-bit timer mode control register
5n (TMC5n) is set to 1.
The duty rate pulse determined by the value set to 8-bit timer compare register 5n (CR5n) is output from TO5n.
Set the active level width of the PWM pulse to CR5n; the active level can be selected with bit 1 (TMC5n1) of TMC5n.
The count clock can be selected with bits 0 to 2 (TCL5n0 to TCL5n2) of timer clock select register 5n (TCL5n).
Enable/disable for PWM output can be selected with bit 0 (TOE5n) of TMC5n.
Caution CR5n can be rewritten in PWM mode only once in a cycle.
Remark
n = 0, 1
(1) PWM output basic operation
[Setting]
<1>
Set each register.
•
Set the port latches (P32, P33)
Note
and port mode registers (PM32, PM33)
Note
to 0.
•
TCL5n: Select the count clock.
•
CR5n:
Compare value
•
TMC5n: Stop the count operation, select PWM mode.
The timer output F/F is not changed.
TMC5n1
Active Level Selection
0
Active-high
1
Active-low
Timer output enabled
(TMC5n = 01000001B or 01000011B)
<2>
The count operation starts when TCE5n = 1.
Set TCE5n to 0 to stop the count operation.
Note
8-bit timer/event counter 50: P33, PM33
8-bit timer/event counter 51: P32, PM32
[PWM output operation]
<1>
PWM output (output from TO5n) outputs an inactive level after the count operation starts until an overflow
is generated.
<2>
When an overflow is generated, the active level set in <1> of setting is output.
The active level is output until CR5n matches the count value of 8-bit timer counter 5n (TM5n).
<3>
After CR5n matches the count value, PWM output outputs the inactive level again until an overflow is
generated.
<4>
Operations <2> and <3> are repeated until the count operation stops.
<5>
When the count operation is stopped with TCE5n = 0, PWM output becomes the inactive level.
Remark
n = 0, 1
Содержание mPD780344 Series
Страница 2: ...2 User s Manual U15798EJ2V0UD MEMO...