em78p5842 ELAN Microelectronics Corp, em78p5842 Datasheet - Page 31

no-image

em78p5842

Manufacturer Part Number
em78p5842
Description
8-bit Micro-controller
Manufacturer
ELAN Microelectronics Corp
Datasheet
VII.10 PWM (Pulse Width Modulation)
__________________________________________________________________________________________________________________________________________________________________
* This specification is subject to change without notice.
(1) Overview
(2) Increment Timer Counter (TMRX: TMR1H/TWR1L or TMR2H/TWR2L)
(3) PWM Period (PRDX : PRD1 or PRD2)
In PWM mode, both PWM1 and PWM2 pins produce up to a 10-bit resolution PWM output (see. Fig.10
for the functional block diagram). A PWM output has a period and a duty cycle, and it keeps the output in
high. The baud rate of the PWM is the inverse of the period. Fig.11 depicts the relationships between a
period and a duty cycle.
TMRX are ten-bit clock counters with programmable prescalers. They are designed for the PWM module
as baud rate clock generators. TMRX can be read, written, and cleared at any reset conditions. If
employed, they can be turned down for power saving by setting T1EN bit to 0.
The PWM period is defined by writing to the PRDX register. When TMRX is equal to PRDX, the
following events occur on the next increment cycle:
Fosc
1:2
1:8
1:32
1:64
Fosc
1:2
1:8
1:32
1:64
Data Bus
Duty Cycle
T1P0 T1P1 T1EN
T2P0 T2P1 T2EN
MUX
MUX
Fig.10 The Functional Block Diagram of the Dual PWMs
Period
Fig.11 The Output Timing of the PWM
DT1 = TMR1
DT2H
DT2L
+
DT2H
DT2L
TMR1H + TMR1L
PRD1
TMR2H + TMR2L
PRD2
+
PRD1 = TMR1
29
DL2H + DL2L
Comparator
Comparator
Comparator
Comparator
DL2H + DL2L
reset
reset
latch
latch
Duty Cycle
Duty Cycle
Match
Match
R Q
S
Period
Match
R Q
S
Period
Match
EM785840/5841/5842
To PWM1IF
8-bit Micro-controller
To PWM2IF
Data Bus
IOC6
IOC6
2004/11/10 V1.2
PWM2
PWM1

Related parts for em78p5842