04.03.2013 Views

RL78/D1A User's Manual: Hardware - Renesas

RL78/D1A User's Manual: Hardware - Renesas

RL78/D1A User's Manual: Hardware - Renesas

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

Under development<br />

Preliminary document<br />

Specifications in this document are tentative and subject to change.<br />

<strong>RL78</strong>/<strong>D1A</strong> CHAPTER 17 SOUND GENERATOR<br />

17.1.2 Principle of operation<br />

The software-controlled registers SG0FL, SG0FH, and SG0PWM are equipped with hardware buffers. The Sound<br />

Generator operates on these buffers.<br />

This approach eliminates audible artifacts, because the buffers are only updated in synchronization with the generated<br />

tone waveform.<br />

Remark This section provides an overview. For details please refer to 17.3 Sound Generator Operation.<br />

(1) Generation of the tone frequency<br />

The tone frequency is determined by two counters and their associated compare register values. Two counters are<br />

necessary to keep the tone pulse and the PWM signal synchronized.<br />

The first counter (S0GFL) provides the input to the tone generator and also to the PWM generator. It is used to keep<br />

the PWM frequency outside the audio range (above 30 kHz) and within the signal bandwidth of the external sound<br />

system (usually below 64 kHz). Its match value defines also the 100 % volume level.<br />

The second counter (S0GFH) generates the tone frequency (250 Hz to 6 kHz).<br />

Remark If the target values of the counters S0GFL/S0GFH are changed to generate a different tone frequency, the<br />

volume register SG0PWM has to be adjusted to keep the same volume.<br />

(2) Generation of the volume information<br />

The volume information (the “amplitude” of the audible signal) is provided as a high-frequency PWM signal. In<br />

composite mode, the PWM signal is ANDed with the tone signal, as illustrated in the following figure.<br />

Tone signal<br />

PWM signal,<br />

duty cycle 66 %<br />

Composite<br />

signal<br />

Analog<br />

audio signal<br />

Figure 17-2. Generation of the Composite Output Signal<br />

100%<br />

66%<br />

0%<br />

After low-pass filtering, the analog signal amplitude corresponds to the duty cycle of the PWM signal. Low-pass<br />

filtering (averaging) is an inherent characteristic of a loudspeaker system.<br />

The duty cycle can vary between 0 % and 100 %. Its generation is controlled by the counter register SG0FL and the<br />

volume register SG0PWM.<br />

When the volume register SG0PWM is cleared, the sound stops immediately.<br />

R01UH0317EJ0004 Rev. 0.04 1000<br />

Feb. 22, 2013

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!