AN2274 Freescale Semiconductor / Motorola, AN2274 Datasheet - Page 9

no-image

AN2274

Manufacturer Part Number
AN2274
Description
Generic Tone Generation on the StarCore SC140 Core
Manufacturer
Freescale Semiconductor / Motorola
Datasheet
the code runs faster than with a short sound_duration repeated very often. Note that the filter state is initialized
between two cycles, but not between two occurrences of the same component without silence in between. If only
one component is used, it is better to repeat the component, not the tone cycle, to prevent harmonic distortions.
2.5 Status Reporting
The top-level modules are informed of the tone generation status with the return values given by
fsl_tone_gen. The return flag bits are as follows:
We recommend that silence be generated with the silence part of a component, not with the sound part initialized
with null level (–63 dBm0) frequencies. Otherwise, the return flag does not reflect reality.
The “entire buffer is silence” flag detects whether the program has run the generation routine. If the generated
sound is composed of null-level frequencies, the buffer contains only silence, but the returned flag indicates that
sound has been generated. This approach saves MCPS in return flag computation (for testing every sample that
would not be used).
2.6 Tone Generator Code Structure
Figure 5 shows an overview of the tone generation code structure. For details, refer to the source code package.
The main goal of the tone generation function is to generate the tone when required and update the associated state
description structure.
Freescale Semiconductor
Bit 0 (LSB): indicates whether tone generation is complete.
— 1 Complete.
— 0 Not complete.
Bit 1: indicates whether the content of the buffer is silence.
— 1 Entire buffer is silence.
— 0 Buffer or part of the buffer contains sound.
Generic Tone Generation on the StarCore™ SC140/SC1400 Cores, Rev. 1
Tone Generator Implementation
9

Related parts for AN2274