Through Martyn´s help I have been able to find the right example for my needs.
Due to size code limitation in my Codewarrior, I generated a sine wave with a digital oscillator instead of a wave table.
I replaced the "USB_Prepare_Data" function with this:
#define WAV_LENGHT 9
#define A=0.05f
#define M_PI 4.0*ATAN(1)
#define FS 44100.0
#define F0 1000.0
#define W0 2*M_PI*F0/FS
#define K1 1.9797349455598831615890608617794f
float Y1=0.035498579489406697256333580400447f;
float Y2=0;
/*
Y = a*Y1 - Y2
K1=2*cos(2*PI*f/FS)
Y1=A*sin(2*PI*f/FS)
Y2=0
*/
void USB_Prepare_Data(void)
{
uint_8 k;
float c;
if (g_cur_mute[0] == 0)
{
// copy data to buffer
for(k=0;k<WAV_LENGHT;k+=3)
{
c = (K1*Y1-Y2);
long2word( (U24*)&wav_buff[k], (long int)(8388608.0*c));
Y2 = Y1;
Y1 = c;
}
}
else
{
// copy data to buffer
for(k=0;k<WAV_LENGHT;k++,audio_position++)
{
wav_buff[k] = 0;
}
}
}
I used 24bit samples and a sampling rate of 44100Hz, so it was necessary to change the usb_descriptor.c.
Attached U24.C and U24.H are only for data conversion.
It ran O.K. in my board.
Next step is add an AD converter...
Enjoy!