3858 Group
PULSE WIDTH MODULATION (PWM)
PWM Operation
The 3858 group has
a
PWM function with an 8-bit
When bit 0 (PWM enable bit) of the PWM control register is set to
“1”, operation starts by initializing the PWM output circuit, and
pulses are output starting at an “H”.
resolution, based on a signal that is the clock input XIN or that
clock input divided by 2.
If the PWM register or PWM prescaler is updated during PWM
output, the pulses will change in the cycle after the one in which
the change was made.
Data Setting
The PWM output pin also functions as port P44. Set the PWM
period by the PWM prescaler, and set the “H” term of output pulse
by the PWM register.
If the value in the PWM prescaler is n and the value in the PWM
register is m (where n = 0 to 255 and m = 0 to 255) :
PWM period = 255 ■ (n+1) / f(XIN)
31.875 ■ m ■ (n+1)
µs
255
= 31.875 ■ (n+1) µs
PWM output
(when f(XIN) = 8 MHz,count source selection bit = “0”)
Output pulse “H” term = PWM period ■ m / 255
= 0.125 ■ (n+1) ■ m µs
T = [31.875 ■ (n+1)] µs
(when f(XIN) = 8 MHz,count source selection bit = “0”)
m: Contents of PWM register
n : Contents of PWM prescaler
T : PWM period (when f(XIN) = 8 MHz,count source
selection bit = “0”)
Fig. 45 Timing of PWM period
Data bus
PWM
prescaler pre-latch
PWM
register pre-latch
Transfer control circuit
PWM
prescaler latch
PWM
register latch
Count source
selection bit
Port P44
“0”
XIN
PWM prescaler
PWM register
(XCIN at low-speed mode)
“1”
1/2
Port P44 latch
PWM function
enable bit
Fig. 46 Block diagram of PWM function
Rev.1.10 Apr 3, 2006 page 50 of 75
REJ03B0139-0110