Datasheet

TLV320DAC3100
www.ti.com
SLAS671A FEBRUARY 2010REVISED MAY 2012
5.5.7 Key-Click Functionality With Digital Sine-Wave Generator (PRB_P25)
A special algorithm has been included in the digital signal processing block PRB_P25 for generating a
digital sine-wave signal that is sent to the DAC. The digital sine-wave generator is also referred to as the
beep generator in this document.
This functionality is intended for generating key-click sounds or beeps for user feedback. The sine-wave
generator is very flexible (see Table 5-22) and is completely register programmable. Programming
page 0 / register 71 through page 0 / register 79 (8 bits each) completely controls the functionality of this
generator and allows for differentiating sounds.
The two registers used for programming the 16-bit sine-wave coefficient are page 0 / register 76 and
page 0 / register 77. The two registers used for programming the 16-bit cosine-wave coefficient are
page 0 / register 78 and page 0 / register 79. This coefficient resolution allows virtually any frequency of
sine wave in the audio band to be generated, up to f
S
/2.
The three registers used to control the length of the sine-burst waveform are page 0 / register 73 through
page 0 / register 75. The resolution (bit) in the registers of the sine-burst length is one sample time, so this
allows great control on the overall time of the sine-burst waveform. This 24-bit length timer supports
16,777,215 sample times. (For example, if f
S
is set at 48 kHz, and the register value equals 96,000d
(01 7700h), then the sine burst lasts exactly 2 seconds.) The default settings for the tone generator, based
on using a sample rate of 48 kHz, are 1-kHz (approximately) sine wave, with a sine-burst length of five
cycles (5 ms).
Table 5-22. Beep Generator Register Locations (Page 0x00)
LEFT RIGHT BEEP LENGTH SINE COSINE
BEEP BEEP
MSB MID LSB MSB LSB MSB LSB
CONTROL CONTROL
REGISTER 71 72 73 74 75 76 77 78 79
Table 5-23. Example Beep-Generator Settings for a 1000-Hz Tone
BEEP FREQUENCY BEEP LENGTH (Cycles = 5) SINE COSINE SAMPLE RATE
MSB MID LSB MSB LSB MSB LSB
Hz Hz
(hex) (hex) (hex) (hex) (hex) (hex) (hex)
1000
(1)
0 0 F0 10 B5 7E E8 48,000
(1) These are the default settings.
Two registers are used to control the left sine-wave volume and the right sine-wave volume independently.
The 6-bit digital volume control used allows level control of 2 dB to –61 dB in 1-dB steps. The left-channel
volume is controlled by writing to page 0 / register 71, bits D5–D0. The right-channel volume is controlled
by writing to page 0, register 72, bits D5–D0. A master volume control that controls the left and right
channels of the beep generator can be set up by writing to page 0 / register 72, bits D7–D6. The default
volume control setting is 2 dB, which provides the maximum tone-generator output level.
For generating other tones, the three tone-generator coefficients can be found by running the following
script using MATLAB™ :
Sine = dec2hex(round(sin(2*pi*Fin/Fs)*2^15))
Cosine = dec2hex(round(cos(2*pi*Fin/Fs)*2^15))
Beep Length = dec2hex(floor(Fs*Cycles/Fin))
where,
f
in
= Beep frequency desired
f
S
= Sample rate
Cycles= Number of beep (sine wave) cycles that are needed
dec2hex = Decimal to hexadecimal conversion function
Copyright © 2010–2012, Texas Instruments Incorporated APPLICATION INFORMATION 37
Submit Documentation Feedback
Product Folder Link(s): TLV320DAC3100