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

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

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.1 Description<br />

The following figure provides a functional block diagram of the Sound Generator.<br />

INTSG0<br />

fSG0CLK Note<br />

SG0FL<br />

frequency low register<br />

≤ SG0ITH ?<br />

Y<br />

SG0CTL.PWR<br />

SG0ITH<br />

interrupt threshold register<br />

1<br />

0<br />

Auto Logarithmic<br />

Decrement<br />

Figure 17-1. Sound Generator Block Diagram<br />

Clear<br />

9-bit S0GFL<br />

frequency counter<br />

SG0FL<br />

frequency compare buffer<br />

Match<br />

Match<br />

SG0PWM<br />

volume compare buffer<br />

1<br />

0<br />

CPU write to<br />

SG0PWM<br />

Load<br />

Load<br />

SG0PWM<br />

volume register<br />

0<br />

1<br />

fPWM<br />

(32 to 64 kHz)<br />

&<br />

&<br />

8-bit SG0SDF<br />

auto-decrement counter<br />

R01UH0317EJ0004 Rev. 0.04 998<br />

Feb. 22, 2013<br />

Load<br />

fDecrement<br />

SG0CTL.ALDS<br />

= 0?<br />

Clear<br />

9-bit S0GFH<br />

tone counter<br />

Match<br />

SG0FH<br />

tone compare buffer<br />

SG0FH<br />

frequency high register<br />

fPWM<br />

(32 to 64 kHz)<br />

Y<br />

Tone<br />

S RS-FF<br />

R Reset<br />

PWM<br />

/2<br />

2 × fTone<br />

(200 Hz to 12 kHz)<br />

SG0SDF<br />

sound duration register<br />

Note The Sound Generator's input clock frequency fSG0CLK is fCLK or fCLK/2. Refer the table below.<br />

fCLK fSG0CLK<br />

32 MHz fCLK/2 16 MHz<br />

24 MHz fCLK 24 MHz<br />

16 MHz fCLK 16 MHz<br />

8 MHz fCLK 8 MHz<br />

4 MHz fCLK 4 MHz<br />

&<br />

fTone<br />

(100 Hz to 6 kHz)<br />

SG0OF<br />

SG0<br />

SG0CTL.OS<br />

SG0OA<br />

fPWM<br />

(min. 32 kHz)<br />

Tone generator<br />

The tone generator consists of two up-counters with compare registers. The values written to the frequency registers<br />

are automatically copied to compare buffers. The counters are reset to zero when their values match the contents of the<br />

associated compare buffers.<br />

The 9-bit counter S0GFL generates a clock with a frequency between 32 kHz and 64 kHz. This clock constitutes the<br />

PWM frequency.<br />

It is also the input of the second 9-bit counter S0GFH. The resulting tone signal behind the by-two-divider has a<br />

frequency between 250 Hz and 6 kHz and a 50 % duty cycle.<br />

0<br />

1<br />

SGO<br />

SG0A

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

Saved successfully!

Ooh no, something went wrong!