
138
CHAPTER 7 8-BIT PWM TIMERS
7.1
Overview of 8-bit PWM Timers
An 8-bit PWM timer has the interval timer functions and the PWM timer functions of an
8-bit resolution. A counter is incremented using interval timer functions in
synchronization with three types of internal count clocks or the output of 8/16-bit
capture timers/counters. The user can select one of these functions. Therefore, the 8-
bit interval timer can be set and the square wave of any frequency can be output using
the set output. In addition, if a low-pass filter is connected to the PWM output, the D/A
converter can be used.
s Interval Timer Functions (Functions to Output the Square Wave)
Interrupts are generated repeatedly at any interval by the interval timer functions.
Because the output level of the pin (P50/PWM pin) can be inverted for each interrupt, the
square wave of any frequency can also be output.
An interval timer operation from the cycle of the count clock to 28-times cycle is possible.
The count clock can be selected from four types.
Table 7.1-1 "Range of Intervals and Square Wave Output" shows the range of intervals and
square wave output.
Note:
Calculation example of intervals and square wave frequency
The following expression is the interval when the count clock cycle is set to 1 tINST and when an
oscillation frequency (FCH) of 10 MHz and a PWM compare register (COMR) value of DDH
(221) are set. Another expression is the frequency of the square wave output from the PWM pin
that is operated continuously without changing the COMR register value.
However, the values are true when the maximum speed clock of the normal mode is selected
Table 7.1-1 Range of Intervals and Square Wave Output
Count clock cycle
Interval
Square wave output (Hz)
1
Internal count
clock
1tINST
1tINST to 2
8t
INST
1/ (2tINST)to 1/ (2
9t
INST)
216tINST
24tINST to 2
12t
INST
1/ (25tINST)to 1/ (2
13t
INST)
364tINST
26tINST to 2
14t
INST
1/ (27tINST)to 1/ (2
15t
INST)
4
8/16-bit timer
count clock
2tINST
2tINST to 2
17t
INST
1/ (22tINST)to 1/ (2
10t
INST)
32tINST
25tINST to 2
21t
INST
1/ (26tINST)to 1/ (2
14t
INST)
512tINST
29tINST to 2
25t
INST
1/ (210tINST)to 1/ (2
18t
INST)
1tEXT
1tEXT to 2
16t
EXT
1/ (2tEXT)to 1/ (2
9t
EXT)
tINST: Instruction cycle (Affected by the clock mode and others.)
tEXT: Output cycle of an 8/16-bit capture timer