
GR716-DS-UM, May 2019, Version 1.29
279
www.cobham.com/gaisler
GR716
•
If dcen
bit is set and
c2e
bit is cleared in the
PWM control register,
PWM output switch state for
the first time after the PWM counter reaches the value
comp1
, which is configured in the
PWM
compare register
. After half of PWM period, the counter counts downwards and on matching the
value
comp1
, PWM output switches state for the second time.
•
If dcen
bit is cleared and
c2e
bit is set in the
PWM control register,
PWM output switch state for
the first time after the PWM counter reaches the value
comp1
, which is configured in the
PWM
compare register
. The counter increments further and on matching the value
comp2
which is con-
figured in
PWM compare register
, PWM output switches state for the second time.
•
If dual compare mode is selected, it is desired that the two inactive time periods are not of equal
length, software needs to continuously update the
PWM compare register
with new values. Since
the core updates its internal register at the start of and middle of the PWM period, software need
to update the
PWM compare register
sometime during the first half of the period.
Note that the core’s internal period register is updated from the
PWM period register
at the start of
every period, both for asymmetric and symmetric PWM generation.
30.2.3 Dead band time
It is often desired to have a delay between when one of the PWM signals of a PWM pair goes inactive
and when the other signal goes active. This delay is called dead band time. By default the core does
not generate any dead band time, but can be configured to do so by setting the
dben
bit in the
PWM
control register
to 0b1. When dead band time is enabled the core will start a counter each time a PWM
pair switch its outputs. The output going inactive is not delayed while the output going active is
delayed until the counter matches the value in the
PWM dead band compare register
. To support a
wide range of applications the amount of dead band time inserted is programmable.
30.2.4 Idle state
Single PWM or PWM pair outputs can be dynamically disabled without disabling counters for syn-
chronization. This dynamic disable state is called idle state. Idle state generation is only supported in
dual compare mode and is entered when compare registers are set to 0xFFFF. The idle state is kept as
long as the compare registers are set to 0xFFFF. Output state of PWM be will reset to state before
entering idle state. In figure 41 is an example of entering and leaving IDLE state of a PWM pair. The
example describes what user needs to write to the compare registers in order to enter and leaving idel
state. The PWM period in the example is 0x0800 and PWM signal is assumed to be activated at
0x0000 and 0x0200.
Figure 41.
Example of entering and leaving IDLE states.
PWM0
PWM1
t
n
t
n+1
t
n+2
t
n+3
t
n+4
t
n+5
t
n+6
t
n+7
PCOMP.COMP
PCOMP.COMP1
0x0000
0x0200
0xFFFF
0xFFFF
0x0000
0x0200
0xFFFF
0xFFFF
0x0200
0x0800
....
....