848
Chapter 24
Sound Generator (SG)
Preliminary User’s Manual U17566EE1V2UM00
(5)
SG0PWM - SG0 volume register
The 16-bit register SG0PWM is used to specify the sound volume. It holds the
target value for the sound amplitude that is given by the duty cycle of the PWM
signal.
Access
This register is can be read/written in 16-bit units. It cannot be written if bit
SG0CTL.PWR = 0.
Address
<base> + 4
H
Initial Value
0000
H
. This register is cleared by any reset.
The value written to this register must be considered in conjunction with the
contents of register SG0FL. The register SG0FL specifies the maximum value
of the counter SG0FL.
For the calculation of the resulting duty cycle refer to
“PWM calculations“ on
page 852
.
The setting takes effect after the SG0PWM buffer has been updated (see
“Updating the volume buffer value“ on page 851
).
Note
1.
The bits 15:9 are not used.
2.
The value read from this register does not necessarily reflect the current
volume, because the value of counter SG0FL is compared with the
contents of the volume buffer. The buffer might not be updated yet.
3.
The sound stops immediately when this register is cleared.
15
14
13
12
11
10
9
8
7
6
5
4
3
2
1
0
0
0
0
0
0
0
0
Sound volume target value
R
R
R
R
R
R
R
R/W
electronic components distributor