English
Language : 

W78LE365_07 Datasheet, PDF (15/42 Pages) Winbond – 8-BIT MICROCONTROLLER
W78LE365/W78L365A
This gives a repetition frequency range of 123 Hz to 31.4 KHz ( fosc = 16 MHz). By loading the PWM
registers with either 00H or FFH, the PWM channels will output a constant HIGH or LOW level,
respectively. Since the 8-bit counter counts modulo 255, it can never actually reach the value of the
PWM registers when they are loaded with FFH.
When a compare register (PWM0, PWM1, PWM2, PWM3, PWM4) is loaded with a new value, the
associated output updated immediately. It does not have to wait until the end of the current counter
period. There is weakly pulled high on PWM output.
ENPWM0/1/2/3/4
f osc
1/2
Prescaler
PWMP
PWM0
8bit counter
PWM1
PWM2
8bit counter
PWM3
8bit counter
PWM4
comparator
comparator
comparator
comparator
PWM0OE
PWM0
(P1.3)
PWM1OE
(PPW1.M4)1
PWM2OE
PWM2
(P1.5)
PWM3OE
PWM3
(P1.6)
comparator
PWM4OE
PWM4
(P1.7)
Please refer as below code.
mov pwmcon1, #00110011b
mov pwmcon2, #00000101b
mov pwmp, #40h
jb p1.3, $
mov pwm0, #14h
jb p1.4, $
mov pwm1, #18h
FIGURE 1 PWM DIAGRAM
; enable pwm3, 2, 1, 0
; enable pwm4
; Fpwm = XT/(2*(1+pwmp)*255)
; duty cycle high/low = pwm0/(255-pmw0)
- 15 -
Publication Release Date: January 10, 2007
Revision A7