
8-bit Timers
10-31
10.6.4
PWM Output
Make the settings as described below when using an 8-bit timer to output a PWM waveform. (Timers 4 to B)
The timers cannot be cascaded when outputting a PWM waveform.
■
Procedure for initiating operation
(1) Set the PWM output cycle.
Set the cycle in TMnBR.
The PWM output cycle is:
(value set in TMnBR + 1) x clock source cycle
(2) Set the PWM output duty ratio.
Set the duty ratio in TMnCMP.
The PWM output duty ratio is:
(value set in TMnCMP) / (value set in TMnBR + 1)
The set value is written to the compare register buffer.
(3) Select the clock source.
Select the clock source through TMnCK[2:0] in the TMnMD register. When using 1/8 IOCLK or 1/32 IOCLK
as the clock source, set TMPSCNE to "1" in the TMPSCNT register to enable prescaler operation.
(4) Set the output mode (timers 4 to B only).
Set TMnOM[1:0] in the TMnMD register to PWM output, and select the polarity upon initialization.
(5) Initialize the timer.
Set TMnLDE in the TMnMD register to "1" to initialize timer n.
The value set in TMnBR is loaded into TMnBC as the initial value.
The value in the compare register buffer is loaded into the TMnCMP register.
PWM output is initialized.
After initialization, be certain to set TMnLDE to "0" and to return to normal operation.
(6) Set the I/O port.
Select the output signal through the TMOSL register. (Select the output for timers 8 to B.)
Set the I/O port to the timer output pin .
Select timer output for the output signal in the I/O port register, and set it to the output pin
For details on the I/O port register settings, refer to chapter 15, "I/O Ports.".
(7) Enable the timer count operation.
Set TMnCNE to "1" in the TMnMD register to start the counting operation.
Содержание MN103001G/F01K
Страница 1: ...MICROCOMPUTER MN1030 MN103001G F01K LSI User s Manual Pub No 23101 050E ...
Страница 2: ......
Страница 4: ......
Страница 6: ......
Страница 7: ...14 A D Converter 15 I O Ports 16 Internal Flash Memory 17 Ordering Mask ROM Appendix 14 15 16 17 ...
Страница 8: ......
Страница 9: ...Table of Contents List of Figures and Tables 0 ...
Страница 26: ...xviii ...
Страница 27: ...1 0 1 General Specifications ...
Страница 35: ...2 CPU 2 ...
Страница 57: ...3 Extension Instruction Specifications 3 ...
Страница 96: ...Extension Instruction Specifications 3 40 ...
Страница 97: ...4 Memory Modes 3 4 ...
Страница 102: ...Memory Modes 4 6 ...
Страница 103: ...5 Operating Mode 5 ...
Страница 107: ...6 Clock Generator 6 13 ...
Страница 111: ...7 Internal Memory 7 ...
Страница 114: ...Internal Memory 7 4 ...
Страница 115: ...8 Bus Controller BC 8 ...
Страница 189: ...9 Interrupt Controller 9 ...
Страница 220: ...Interrupt Controller 9 32 ...
Страница 221: ...10 8 bit Timers 9 10 ...
Страница 254: ...8 bit Timers 10 34 ...
Страница 255: ...11 16 bit Timers 11 ...
Страница 292: ...16 bit Timers 11 38 ...
Страница 293: ...12 Watchdog Timer 11 12 ...
Страница 302: ...Watchdog Timer 12 10 ...
Страница 303: ...13 Serial Interface 13 ...
Страница 354: ...Serial Interface 13 52 ...
Страница 355: ...14 A D Converter 14 ...
Страница 367: ...15 I O Ports 15 ...
Страница 431: ...16 Internal Flash Memory 16 ...
Страница 439: ...17 17 Ordering Mask ROM ...
Страница 442: ...Ordering Mask ROM 17 4 ...
Страница 443: ...Appendix ...