129
CHAPTER 9 8-BIT TIMER/EVENT COUNTERS 2, 3 TM2, TM3
9.4.4 8-bit PWM output operation
8-bit timer/event counters operate as PWM output when bit 6 (TMCn6) of 8-bit timer mode control register n (TMCn)
is set to 1.
The duty rate pulse determined by the value set to 8-bit compare register n (CRn) is output from TIOn.
Set the active level width of PWM pulse to CRn, and the active level can be selected with bit 1 (TMCn1) of TMCn.
Count clock can be selected with bit 0 to bit 2 (TCLn0 to TCLn2) of timer clock select register n (TCLn).
PWM output enable/disable can be selected with bit 0 (TOEn) of TMCn.
Caution
Rewrite of CRn in PWM mode is allowed only once in a cycle.
Remark
n = 2, 3
(1) PWM output basic operation
[Setting]
<1>
Set port latch (P43, P44) and port mode register 4 (PM43, PM44) to 0.
<2>
Set active level width with 8-bit compare register (CRn).
<3>
Select count clock with timer clock select register n (TCLn).
<4>
Set active level with bit 1 (TMCn1) of TMCn.
<5>
Count operation starts when bit 7 (TCEn) of TMCn is set to 1.
Set TCEn to 0 to stop count operation.
[PWM output operation]
<1>
PWM output (output from TIOn) outputs inactive level after count operation starts until overflow is
generated.
<2>
When overflow is generated, the active level set in <1> of setting is output.
The active level is output until CRn matches the count value of 8-bit counter n (TMn).
<3>
After the CRn matches the count value, PWM output outputs the inactive level again until overflow is
generated.
<4>
PWM output operation <2> and <3> are repeated until the count operation stops.
<5>
When the count operation is stopped with TCEn = 0, PWM output changes to inactive level.
Remark n = 2, 3
Содержание mPD780973 Series
Страница 2: ...2 MEMO ...
Страница 66: ...66 MEMO ...
Страница 98: ...98 MEMO ...
Страница 138: ...138 MEMO ...
Страница 164: ...164 MEMO ...
Страница 182: ...182 MEMO ...
Страница 204: ...204 MEMO ...
Страница 244: ...244 MEMO ...
Страница 262: ...262 MEMO ...
Страница 278: ...278 MEMO ...
Страница 290: ...290 MEMO ...