English
Language : 

M16C6K9 Datasheet, PDF (146/292 Pages) Renesas Technology Corp – SINGLE-CHIP 16-BIT CMOS MICROCOMPUTER
M16C/6K9 Group
PWM
Data Setup (PWM0)
PWM0 output pin shares with P93 or P44. PWM0 output pin is selected from either P93/PWM00 or P44/
PWM01 by bit 0 of PWM control register 0 (address 030C16). PWM0 output is enabled and starts to operate
by setting bit 0 of PWM control register 1 (address 030D16) to “1” .
The period of PWM is set by PWM0 prescaler (address 030016), The “H” width of output pulse is set by
PWM0 register (address 030116).
The following are the calculations if the prescaler value is n and PWM0 register value is m.
(n = 0 to 255, m = 0 to 255)
PWM period = 255 ✕ (n+1) = 31.875 ✕ (n+1) µs
f(XIN)
(In the case of f(XIN)=8MHz, PWM counter source selection bits=“002”)
"H" width of output pulse = PWM period ✕ m = 0.125 ✕ (n+1) ✕ mµs
255
(In the case of f(XIN)=8MHz, PWM counter source selection bits=“002”)
The setting of PWM1 to PWM5 are the same.
PWM Operation
By setting bit 0 ( PWM0 output enable bit) of PWM control register 1 to “1”, the PWM output circuit starts to
operate from default state with “H” pulse output.
If the values of PWM0 register and PWM0 prescaler are modified during the PWM output operation, the
corresponding pulse will be output from the next period after the modification.
31.875 ✕ m ✕ (n+1) µs
255
<
>
PWM0 output
< T = [31.875 ✕ (n+1)] µs >
m : The content of PWM0 register
n : The content of PWM0 prescaler
T : PWM Period ( in the case of f(XIN) = 8MHz)
Fig.LA-2 The timing of PWM period (PWM0)
Rev.1.00 Jun 06, 2003 page 146 of 290