CHAPTER 7 8-BIT TIMER/EVENT COUNTERS 50 AND 51
Preliminary User’s Manual U16315EJ1V0UD
176
7.4.4 PWM output operation
8-bit timer/event counter 5n operates as a PWM output when bit 6 (TMC5n6) of 8-bit timer mode control register 5n
(TMC5n) is set to 1.
The duty ratio 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 selection register 5n (TCL5n).
PWM output can be enabled/disabled with bit 0 (TOE5n) of TMC5n.
Caution
In PWM mode, make the CR5n rewrite period 3 count clocks of the count clock (clock selected by
TCL5n) or more.
(1) PWM output basic operation
[Setting]
<1>
Set each register.
•
Set the port latches (P17, P33)
Note
and port mode registers (PM17, 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: P17, PM17
8-bit timer/event counter 51: P33, PM33
[PWM output operation]
<1>
PWM output (output from TO5n) outputs an inactive level after the count operation starts until an overflow
occurs.
<2>
When an overflow occurs, the active level set in <1> above is output.
The active level is output until CR5n matches the count value of 8-bit timer counter 5n (TM5n).
<3>
After the CR5n matches the count value, the inactive level is output until an overflow occurs again.
<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 inactive.
Remark
n = 0, 1
Содержание 78K0/KD1 Series
Страница 2: ...Preliminary User s Manual U16315EJ1V0UD 2 MEMO ...
Страница 444: ...Preliminary User s Manual U16315EJ1V0UD 444 MEMO ...