![TENX TECHNOLOGY TM57PE10 Скачать руководство пользователя страница 24](http://html.mh-extra.com/html/tenx-technology/tm57pe10/tm57pe10_user-manual_1087886024.webp)
Advance Information
UM-TM57PE10_E
8-Bit Microcontroller
24
tenx technology inc.
Preliminary
Rev 1.4, 2012/01/19
3.5 PWM1: 8-bit PWM
PWM1 is a simple fixed frequency and duty cycle variable PWM generator. The PWM frequency is fixed,
the period is system clock counts from 0 to 255. The duty can be set via PWM1DUTY register. The
output of PWM1 shares the pin PB5 that can be selected by PWM1E control bit. Figure is the block
diagram of PWM1.
PWM1CNT
A
B
A=B
System
RESET
Fosc
8
00H
8
R
S
A
B
A≤B
PWM1DUTY
0
1
Q
PBO[5]
PB5
PWM1E
PWM1DUTY
PWM1CNT=255
PWM1DUTY * Tosc
Tosc
PWM1
PWM1CNT=0
256 * Tosc
CPUCLK
PWM1CNT*
*
: PWM1CNT is internal counter that cannot be
read by instruction.
PWM1 output duty = [PWM1DUTY / 256]
When PWM1DUTY = 80H, PWM1 output duty will be 1/2
PWM1 output frequency = (Fosc) / 256
When Fosc = 4 MHz, PWM1 output frequency = (4M)/256 = 15.625 KHz