Advance Information
UM-TM57PE10_E
8-Bit Microcontroller
23
tenx technology inc.
Preliminary
Rev 1.4, 2012/01/19
Figure shows the PWM0 waveforms. When CLRPWM0 bit is set to ‘1’, the PWM0 output is cleared to ‘0’
no matter what its current status is. Once the CLRPWM0 bit is cleared to ‘0’, the PWM0 output is set to
‘1’ to begin a new PWM cycle. PWM0 output will be ‘0’ when PWM0CNT greater than or equals to
PWM0BUF. PWM0CNT keeps counting up when equals to PWM0PERIOD, the PWM0 output is set to
‘1’ again.
PWM0PERIOD
PWM0CNT
XX
YY
ZZ
PWM0DUTY
PWM0BUF
XX
YY
ZZ
PWM0O
CLRPWM0
PWM0BUF
FOSC
FOSC/2
(PWM0PSC=01)
K
K+1
PWM0 output duty = [PWM0DUTY / (PWM0 1)]
When PWM0DUTY = 80H, PWM0PERIOD = FFH, PWM0 output duty will be 1/2
PWM0 output frequency = (Fosc) / div / (PWM0 1)
Note: The div variable represents the prescale factor by PWM0PSC [1:0] select value (1, 2, 4, 8)
div = PWM0PSC [1:0] when select 2’b00 = 1
When PWM0PERIOD = FFH, Fosc = 4 MHz, PWM0 output frequency = (4M)/1/256 = 15.625 KHz