English
Language : 

W79E225A_08 Datasheet, PDF (110/203 Pages) Winbond – 8-bit Microcontroller
Preliminary W79E225A/226A/227A Data Sheet
The PWMP register fact that writes are not into the Counter register that controls the counter; rather
they are into a holding register. As described below the transfer of data from this holding register, into
the register which contains the actual reload value, is controlled by the user’s program. The width of
each PWM output pulse is determined by the value in the appropriate compare register. Each PWM
register pair of (PWMPH,PWMPL), (PWM0H,PWM0L), (PWM2H,PWM2L), (PWM4H,PWM4L) and
(PWM6H,PWM6L),in the format of 12-bit width by combining 4 LSB of high byte and 8 MSB bits of low
byte, decides the PWM period and each channel’s duty cycle. The following equations show the
formula for period and duty for each pwm operation mode:
Edge aligned:
Period
= (pwmp +1) * ioclock period * 1/prescaler
Duty
= duty * ioclock period
Single shot:
Period
= (pwmp) * ioclock period /prescaler (no meaning since it is not periodic)
Duty
= (duty) * ioclock period/prescaler
(for prescaler 1, 1/2/2, 1/4)
(duty-1) * ioclock period /prescaler < Duty < (duty) * ioclock period/prescaler (for prescaler 1/16)
Centre aligned:
Period
= (pwmp* 2) * ioclock period /prescaler
Duty
= (duty*2 - 1) * ioclock period /prescaler
Note: “duty” refers to PWM0~3 register value.
14.3 PWM Pin Structures
As show in the following diagrams, PWM pin structures are controllable through PWM options bits
(PWMEE/PWMOE) and SFR PWMCON4 bits (PWMEOM/PWMOOM/PWM6OM/PWM7OM).
PWMEE/PWMOE
(OPTION BITS)
PWMEOM/PWMOOM
/PWM6OM/PWM7OM
PIO.X
(X = 0-7)
PIN STRUCTURES
X
1 (Disable 
0 (Enable)
0 (Enable)
0
X
Tri-state
1
X
Quasi (I/O output)
1
0
Push Pull (PWM output)
1
1
Push Pull (I/O output)
Table 14-1: PWM pin structures (during internal rom execution)
PWMEE/PWMOE
(OPTION BITS)
1 (Disable)
 &OBCMF 
PWMEOM/PWMOOM PIO.X
PIN
/PWM6OM/PWM7OM (X = 0-7) OUTPUT
PIN STRUCTURES
X
X
External
access
Push Pull
X
X
External
access
Push Pull (strong)
Table 14-2: PWM pin structures (during external rom execution)
- 110 -
Publication Release Date: April 15, 2008
Revision A4.0