292
Chapter 10
Timer
Preliminary User’s Manual U15839EE1V0UM00
(a) Example PWM output
By setting the TMCC00 and TMCC01 registers as described below Timer C can output a PWM of
an arbitrary frequency with the values that were set in advance in the CCC00 and CCC01
registers determining the intervals.
Setting method:
(1)
set corresponding port pins (P5) to Timer C output (PM5 to input, PMC5 to Timer C0)
(2)
set CAE bit of TMCC00 register to "1" for activating the Timer C peripheral
(3)
set the active level of TOC0 output by the ALV bit of the TMCC01 register (here: ALV = 1)
(4)
set ENT1, CMS1 and CMS0 bits of TMCC01 register to "1" (leave CLR bit to 0)
(5)
set CE bit to "1" to enable the counter and start operation
Operation:
(1)
When the counter value of the TMC0 register matches the setting value of the CCC00 register, the
TOC0 output becomes active.
(2)
When the counter value of the TMC0 register matches the setting value of the CCC01 register, the
TOC0 output becomes inactive. This enables a PWM of an arbitrary frequency to be output.
Figure 10-16:
Timing of PWM output operation (detail)
Remarks: 1. p: Setting value of CCC00 register (0000H to FFFFH)
2. q: Setting value of CCC01 register (0000H to FFFFH)
3. p:
1/4 q
4. In this example, the active level of TOC0 output is set to high level.
(b) When CCC00 = CCC01
When the setting value of the CCC00 register and the setting value of the CCC01 register are the
same, the TOC0 output remains inactive and does not change.
Count start
Clear
0001H
0000H
0001H
0000H
FFFFH
p
p
p
p
p
p
q
q
q
q
q
q
q
p
TMC0
register
INTCCC00
interrupt
INTCCC01
interrupt
TOC00
(output)
CCC00
COUNT
f
CCC01
Содержание mPD703128
Страница 6: ...6 Preliminary User s Manual U15839EE1V0UM00 ...
Страница 20: ...20 Preliminary User s Manual U15839EE1V0UM00 ...
Страница 32: ...32 Preliminary User s Manual U15839EE1V0UM00 MEMO ...
Страница 154: ...154 Preliminary User s Manual U15839EE1V0UM00 MEMO ...
Страница 238: ...238 Preliminary User s Manual U15839EE1V0UM00 MEMO ...
Страница 356: ...356 Preliminary User s Manual U15839EE1V0UM00 MEMO ...
Страница 522: ...522 Preliminary User s Manual U15839EE1V0UM00 MEMO ...
Страница 600: ...600 Preliminary User s Manual U15839EE1V0UM00 MEMO ...
Страница 610: ...610 Preliminary User s Manual U15839EE1V0UM00 ...
Страница 612: ......