Chapter 19
Pulse Width Modulator (PWM)
This chapter describes the operation of the Pulse-Width Modulation peripheral (PWM).
19.1
PWM Overview
Figure 10 shows an overview of the PWM peripheral. The default configuration described here
has four independent PWM comparators (
pwmcmp0
–
pwmcmp3
), but each PWM Peripheral is
parameterized by the number of comparators it has (
ncmp
). The PWM block can generate multi-
ple types of waveforms on output pins (
pwm
gpio
) and can also be used to generate several
forms of internal timer interrupt. The comparator results are captured in the
pwmcmp
ip
flops
and then fed to the PLIC as potential interrupt sources. The
pwmcmp
ip
outputs are further
processed by an output ganging stage before being fed to the GPIOs.
PWM instances can support comparator precisions (
cmpwidth
) up to 16 bits, with the example
described here having the full 16 bits. To support clock scaling, the
pwmcount
register is 15 bits
wider than the comparator precision
cmpwidth
.
SiFive FE310-G000 Manual: v3p2
© SiFive, Inc.
Page 94