Copyright
c
2016, SiFive Inc. All rights reserved.
55
Address
Description
0x00
pwmcfg
0x04
Reserved
0x08
pwmcount
0x0C
Reserved
0x10
pwms
0x14
Reserved
0x18
Reserved
0x1C
Reserved
0x20
pwmcmp0
0x24
pwmcmp1
0x28
pwmcmp2
0x2C
pwmcmp3
Table 15.1: SiFive PWM memory map, offsets relative to PWM peripheral base address.
to replay the one-shot waveform. The
pwmen*
bits are reset at wakeup reset, which disables the
PWM counter and saves power.
The 4-bit
pwmscale
field scales the PWM counter value before feeding it to the PWM comparators.
The value in
pwmscale
is the bit position within the
pwmcount
register of the start of a
cmpwidth
-bit
pwms
field. A value of 0 in
pwmscale
indicates no scaling, and
pwms
would then be equal to the
low
cmpwidth
bits of
pwmcount
. The maximum value of 15 in
pwmscale
corresponds to dividing the
clock rate by
2
15
, so for an input bus clock of 16 MHz, the LSB of
pwms
will increment at 488.3 Hz.
The value of
pwms
is memory-mapped and can be read as a single
cmpwidth
-bit value over the
TileLink bus.
The
pwmzerocmp
bit, if set, causes the PWM counter
pwmcount
to be automatically reset to zero
one cycle after the
pwms
counter value matches the compare value in
pwmcmp0
. This is normally
used to set the period of the PWM cycle. This feature can also be used to implement periodic
counter interrupts, where the period is independent of interrupt service time.
PWM Compare Registers (
pwmcmp0
–
pwmcmp3
)
R
eserve
d
31
16
pwmcmp0[15:0]
15
0
Figure 15.3: PWM compare register
pwmcmp0
. Registers
pwmcmp1
–
pwmcmp3
have the same format.
This diagram assumes that
cmpwidth
of 16. The actual width each register is
cmpwidth
.
The primary use of the
ncmp
PWM compare registers is to define the edges of the PWM waveforms
within the PWM cycle.
Each compare register is a
cmpwdith
-bit value against which the current
pwms
value is compared
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 ...