Page 110
10. 8-Bit TimerCounter (TC5, TC6)
10.1 Configuration
TMP86PM29BUG
10.3.4 8-Bit Pulse Width Modulation (PWM) Output Mode (TC6)
This mode is used to generate a pulse-width modulated (PWM) signals with up to 8 bits of resolution. The
up-counter counts up using the internal clock.
When a match between the up-counter and the PWREGj value is detected, the logic level output from the
timer F/Fj is switched to the opposite state. The counter continues counting. The logic level output from the
timer F/Fj is switched to the opposite state again by the up-counter overflow, and the counter is cleared. The
INTTCj interrupt request is generated at this time.
Since the initial value can be set to the timer F/Fj by TCjCR<TFFj>, positive and negative pulses can be gen-
erated. Upon reset, the timer F/Fj is cleared to 0.
(The logic level output from the
PWMj
pin is the opposite to the timer F/Fj logic level.)
Since PWREGj in the PWM mode is serially connected to the shift register, the value set to PWREGj can be
changed while the timer is running. The value set to PWREGj during a run of the timer is shifted by the
INTTCj interrupt request and loaded into PWREGj. While the timer is stopped, the value is shifted immedi-
ately after the programming of PWREGj. If executing the read instruction to PWREGj during PWM output,
the value in the shift register is read, but not the value set in PWREGj. Therefore, after writing to PWREGj, the
reading data of PWREGj is previous value until INTTCj is generated.
For the pin used for PWM output, the output latch of the I/O port must be set to 1.
Note 1: In the PWM mode, program the timer register PWREGj immediately after the INTTCj interrupt request is
generated (normally in the INTTCj interrupt service routine.) If the programming of PWREGj and the inter-
rupt request occur at the same time, an unstable value is shifted, that may result in generation of the pulse
different from the programmed value until the next INTTCj interrupt request is generated.
Note 2: When the timer is stopped during PWM output, the
PWMj
pin holds the output status when the timer is
stopped. To change the output status, program TCjCR<TFFj> after the timer is stopped. Do not change the
TCjCR<TFFj> upon stopping of the timer.
Example: Fixing the
PWMj
pin to the high level when the TimerCounter is stopped
CLR (TCjCR).3: Stops the timer.
CLR (TCjCR).7: Sets the
PWMj
pin to the high level.
Note 3: To enter the STOP mode during PWM output, stop the timer and then enter the STOP mode. If the STOP
mode is entered without stopping the timer when fc, fc/2 or fs is selected as the source clock, a pulse is out-
put from the
PWMj
pin during the warm-up period time after exiting the STOP mode.
Note 4: j = 6
Table 10-5 PWM Output Mode
Source Clock
Resolution
Repeated Cycle
NORMAL1/2, IDLE1/2 mode
SLOW1/2,
SLEEP1/2
mode
fc = 16 MHz
fs = 32.768 kHz
fc = 16 MHz
fs = 32.768 kHz
DV7CK = 0
DV7CK = 1
fc/2
11
[Hz]
fs/2
3
[Hz]
fs/2
3
[Hz]
128
µ
s
244.14
µ
s
32.8 ms
62.5 ms
fc/2
7
fc/2
7
–
8
µ
s
–
2.05 ms
–
fc/2
5
fc/2
5
–
2
µ
s
–
512
µ
s
–
fc/2
3
fc/2
3
–
500 ns
–
128
µ
s
–
fs
fs
fs
30.5
µ
s
30.5
µ
s
7.81 ms
7.81 ms
fc/2
fc/2
–
125 ns
–
32
µ
s
–
fc
fc
–
62.5 ns
–
16
µ
s
–
Содержание TLCS-870/C Series
Страница 1: ...8 Bit Microcontroller TLCS 870 C Series TMP86PM29BUG ...
Страница 6: ...TMP86PM29BUG ...
Страница 7: ...Revision History Date Revision 2007 10 11 1 First Release 2008 8 29 2 Contents Revised ...
Страница 9: ......
Страница 15: ...vi ...
Страница 19: ...Page 4 1 3 Block Diagram TMP86PM29BUG 1 3 Block Diagram Figure 1 2 Block Diagram ...
Страница 23: ...Page 8 1 4 Pin Names and Functions TMP86PM29BUG ...
Страница 48: ...Page 33 TMP86PM29BUG ...
Страница 49: ...Page 34 2 Operational Description 2 3 Reset Circuit TMP86PM29BUG ...
Страница 61: ...Page 46 3 Interrupt Control Circuit 3 8 External Interrupts TMP86PM29BUG ...
Страница 81: ...Page 66 6 Watchdog Timer WDT 6 3 Address Trap TMP86PM29BUG ...
Страница 135: ...Page 120 10 8 Bit TimerCounter TC5 TC6 10 1 Configuration TMP86PM29BUG ...
Страница 145: ...Page 130 11 Asynchronous Serial interface UART 11 9 Status Flag TMP86PM29BUG ...
Страница 165: ...Page 150 13 10 bit AD Converter ADC 13 6 Precautions about AD Converter TMP86PM29BUG ...
Страница 183: ...Page 168 15 LCD Driver 15 4 Control Method of LCD Driver TMP86PM29BUG ...
Страница 201: ...Page 186 18 Electrical Characteristics 18 9 Handling Precaution TMP86PM29BUG ...
Страница 203: ...Page 188 19 Package Dimensions TMP86PM29BUG ...
Страница 205: ......