SN8P1700
8-bit micro-controller build-in 12-bit ADC
PWM FUNCTION DESCRIPTION
OVERVIEW
PWM function is generated by TC0/TC1 timer counter and output the PWM signal to PWM0OUT pin (P5.4)/
PWM1OUT pin (P5.3). The 8-bit counter counts modulus 256, from 0-255, inclusive. The value of the 8-bit counter is
compared to the contents of the reference register (TC0R/TC1R). When the reference register value (TC0R/TC1R) is
equal to the counter value (TC0C/TC1C), the PWM output goes low. When the counter reaches zero, the PWM output
is forced high. The low-to-high ratio (duty) of the PWM0/PWM1 output is TC0R/256 and TC1R/256.
All PWM outputs remain inactive during the first 256 input clock signals. Then, when the counter value (TC0C/TC1C)
changes from FFH back to 00H, the PWM output is forced to high level. The pulse width ratio (duty cycle) is defined by
the contents of the reference register (TC0R/TC1R) and is programmed in increments of 1:256. The 8-bit PWM data
register TC0R/TC1R is write only register.
PWM output can be held at low level by continuously loading the reference register with 00H. Under PWM operating, to
change the PWM’s duty cycle is to modify the TC0R/TC1R.
Reference Register Value
Duty
(TC0R/TC1R)
0000 0000
0/256
0000 0001
1/256
0000 0010
2/256
.
.
.
.
1000 0000
1000 0001
.
128/256
129/256
.
.
.
1111 1110
1111 1111
254/256
255/256
Table 8-5. The PWM Duty Cycle Table
0
1
..... 128 ..... 254 255
0
1
..... 128 ..... 254 255
TC0/TC1 Clock
Low
TC0R/TC1R = 00H
High
Low
TC0R/TC1R = 01H
TC0R/TC1R = 80H
TC0R/TC1R = FFH
High
Low
High
Low
Figure 8-8 The Output of PWM with different TC0R/TC1R.
Page 88
SONiX TECHNOLOGY CO., LTD
Revision 1.94