upd70f3422gj-gae-qs-ax Renesas Electronics Corporation., upd70f3422gj-gae-qs-ax Datasheet - Page 849

no-image

upd70f3422gj-gae-qs-ax

Manufacturer Part Number
upd70f3422gj-gae-qs-ax
Description
32-bit Single-chip Microcontroller
Manufacturer
Renesas Electronics Corporation.
Datasheet
Sound Generator (SG)
Figure 24-3
SG0PWM
SG0CLK
compare
24.3.1 Generating the tone
SG0FH
SG0FH
SG0FH
counter
(32 bit)
match
24.3 Sound Generator Operation
Write
SG0F
buffer
(1)
003B 01AE
This section explains the details of the Sound Generator.
The tone signal is generated by the compare match signal of the SG0FH
counter value with the value of the SG0FH buffer, followed by a by-two-divider.
At each compare match, the counter is reset to zero.
Remember that the SG0FH counter is clocked by the output of the SG0FL
counter.
Updating the frequency buffer values
The values of the frequency buffers can be changed by writing to the
associated frequency registers SG0FL and SG0FH. Both registers can be
written together via SG0F.
Changing the value of the SG0FL (equivalent to SG0F[15:0]) register would
also yield a change of the PWM frequency, i.e. the sound volume. Therefore it
is obligatory to write the correct PWM value to SG0PWM before a new SG0F
value is copied to the frequency buffers.
The SG0F register contents is copied to the buffers when the following
sequence is detected:
1. CPU write access to SG0PWM register occurred.
2. SG0FH counter value and SG0FH buffer value have matched.
The following figure shows an example (not to scale).
Update timing of the frequency buffers
Up to the next match, frequency registers and associated buffers can hold
different values. If a 309 Hz tone is generated, as in the above example, the
time span between writing to the SG0PWM register and updating the buffer
can be up to 3.24 ms.
Preliminary User’s Manual U17566EE1V2UM00
This match is equivalent to the next edge (rising or falling) of the tone
signal.
H
038
H
(Step 1)
003B
039
H
H
03A
H
0027 01AE
(Step 2)
03B
H
H
000
H
0027
001
H
H
Chapter 24
849

Related parts for upd70f3422gj-gae-qs-ax