Copyright
c
2016, SiFive Inc. All rights reserved.
57
pwms
pwmscenter
000
000
001
001
010
010
011
011
100
011
101
010
110
001
111
000
Figure 15.5: Illustration of how count value is inverted before presentation to comparator when
pwmcmp
X
center
is selected, using a 3-bit
pwms
value.
both 100% (
pwmcmp
X
=
0) and 0% (
pwmcmp
X >
pwmcmp0
) right-aligned duty cycles using the other
comparators. The
pwmcmp
X
ip
bits are routed to the GPIO pads, where they can be optionally and
individually inverted thereby creating left-aligned PWM waveforms (high at beginning of cycle).
Generating Center-Aligned (Phase-Correct) PWM Waveforms
The simple PWM waveforms above shift the phase of the waveform along with the duty cycle.
A per-comparator
pwmcmp
X
center
bit in
pwmcfg
allows a single PWM comparator to generate a
center-aligned symmetric duty-cycle as shown in Figure 15.6 The
pwmcmp
X
center
bit changes the
comparator to compare with the bitwise inverted
pwms
value whenever the MSB of
pwms
is high.
This technique provides symmetric PWM waveforms but only when the PWM cycle is at the largest
supported size. At a 16 MHz bus clock rate with 16-bit precision, this limits the fastest PWM cycle
to 244 Hz, or 62.5 kHz with 8-bit precision. Higher bus clock rates allow proportionally faster PWM
cycles using the single comparator center-aligned waveforms. This technique also reduces the
effective width resolution by a factor of 2.
pwms
0
1
2
3
4
5
6
7
1
2
3
4
5
6
0
1
pwmcmpX=1
pwmcmpX=0
PWM Cycle
0
pwmcmpX=2
pwmcmpX=3
pwmcmpX=4
Figure 15.6: E300 center-aligned PWM waveforms generated from one comparator. All possible
waveforms are shown for a 3-bit PWM precision. The signals can be inverted at the GPIOs to
generate opposite-phase waveforms.
When a comparator is operating in center mode, the deglitch circuit allows one 0-1 transition during
Summary of Contents for E300
Page 1: ...SiFive E300 Platform Reference Manual Version 1 0 1 c SiFive Inc ...
Page 2: ...2 SiFive E300 Platform Reference Manual Version 1 0 1 ...
Page 4: ...ii SiFive E300 Platform Reference Manual Version 1 0 1 ...
Page 12: ...4 SiFive E300 Platform Reference Manual Version 1 0 1 ...
Page 14: ...6 SiFive E300 Platform Reference Manual Version 1 0 1 ...
Page 22: ...14 SiFive E300 Platform Reference Manual Version 1 0 1 ...
Page 32: ...24 SiFive E300 Platform Reference Manual Version 1 0 1 ...
Page 40: ...32 SiFive E300 Platform Reference Manual Version 1 0 1 ...
Page 56: ...48 SiFive E300 Platform Reference Manual Version 1 0 1 ...
Page 60: ...52 SiFive E300 Platform Reference Manual Version 1 0 1 ...