AN2274 Freescale Semiconductor / Motorola, AN2274 Datasheet - Page 6

no-image

AN2274

Manufacturer Part Number
AN2274
Description
Generic Tone Generation on the StarCore SC140 Core
Manufacturer
Freescale Semiconductor / Motorola
Datasheet
Tone Generator Implementation
2.2 Tone Cycles
When all components are ready, they must be gathered into the desired tone. A component group is called a cycle,
as shown in Figure 3. Up to five components can be grouped into one cycle. Finally, the created cycle can be
repeated as often as needed to form the signaling tone.
2.3 Functional Interface
There are many different types of tones, such as single, dual, partial dual, and modulated. The starting times of
sinusoids with different frequencies are arbitrary, but they are easily synchronized within the components. The
external interface to the software consists of the following C functions (see Figure 4):
6
void
void
COMP1
Bit 1: Unit_1
— 0 Frequency1.
— 1 Frequency1 divided by 3.
Bit 2: Unit_2
— 0 Frequency2.
— 1 Frequency2 divided by 3.
Bit 3: Phase_1
— 0 Frequency1 initialized with 0° phase.
— 1 Frequency1 initialized with 180° phase.
Bit 4: Phase_2
— 0 Frequency2 initialized with 0° phase.
— 1 Frequency2 initialized with 180° phase.
TONE_GENERIC is a structure that describes the tone to be generated.
SIGNAL is a 16-bit signed fractional type.
linear_out is an output buffer.
samples_out, a multiple of eight, indicates how many samples the software must generate in this call.
GEN_CHANNEL is a structure containing the description of the tone to be generated and the actual
state of the generation.
fsl_tone_gen_init
fsl_tone_gen
Generic Tone Generation on the StarCore™ SC140/SC1400 Cores, Rev. 1
The unit bits produce frequencies with 1/3 Hz. For example, 16 2/3 Hz is generated with 50 Hz
when the unit bit is set (16 2/3 Hz = 50/3 Hz).
where:
COMP2
(GEN_CHANNEL *gen_channel, SIGNAL *linear_out, unsigned samples_out);
(GEN_CHANNEL *gen_channel, TONE_GENERIC *tone_control);
Figure 3. Cycle Components
COMP3
One Cycle
COMP4
COMP5
Freescale Semiconductor
COMP1

Related parts for AN2274