AN2274 Freescale Semiconductor / Motorola, AN2274 Datasheet - Page 11

no-image

AN2274

Manufacturer Part Number
AN2274
Description
Generic Tone Generation on the StarCore SC140 Core
Manufacturer
Freescale Semiconductor / Motorola
Datasheet
3
We integrated and tested the generic tone generator on the MSC8101 Application Development System
(MSC8101ADS) board [2] to confirm MATLAB simulation results. Many different tones were measured.
3.1 Test Set-up
On the MSC8101ADS, an audio codec is connected to an MSC8101 device through one of its CPM multi-channel
controllers (MCCs), which configures the codec, and one of its serial peripheral interfaces (SPIs), which sends
audio samples out of the ADS. Figure 6 shows a diagram of this testing set-up. Alternatively, the ADSFS set-up
[5] can be used, allowing generated samples to be written into files using the Ethernet port with a high transfer rate.
In this case, the codec is not used.
3.2 Initialization Examples of Multi-Frequency Tones
The examples shown here provide specific configurations of the initialization function to generate several sets of
tones composed by one or two frequencies. Because frequency values, power levels, and durations may vary from
one case to another, the generic character of the generator is evident. Modifying the code to other types of signaling
tones should be a fairly simple task.
Freescale Semiconductor
Using and Testing the Generic Tone Generator
Function name:
Input:
Output:
BEGIN
END BEGIN
Generic Tone Generation on the StarCore™ SC140/SC1400 Cores, Rev. 1
FOR (Number of sample to generate/8)
END FOR
RETURN (Flag)
IF (sound duration is expired)
ELSE
END IF
Example 1. Tone Generator Pseudo Code
IF (silence duration is not expired)
ELSE
END IF
FOR (8 couples of samples)
Load previous oscillator state and coefficient
Generate SAMPLE1 and SAMPLE2 together
Fill output buffer with SAMPLE1+SAMPLE2
Update flag (sound generated)
END FOR
fsl_tone_gen
Pointer to output
Pointer to buffer containing static variables
Number of samples to generate
Return Flag
Fill memory with 8 silence samples
Initialize next component with respect to cycles
and component number.
Update flag if tone is complete.
Using and Testing the Generic Tone Generator
11

Related parts for AN2274