Hi,
I'm not able to get the beep generator working. The aic is configured for DAC Fs of 8000 samp/sec. I can play speech to the speaker just fin, but beep generator does not play a tone. In the aic3204 configuration, I set register 60 (DAC processing block) to 0x19 which should have enabled DAC processing block 25. Here is the code I use to setup and enabled the beep generator. Any help would be greatly appreciated.
Thanks,
Jim
#define SIN_700_Q15 17121 // sin(2PI * 700/8000) * 32767
#define COS_700_Q15 27939 // cos(2PI * 700/8000) * 32767
#define TONE_GAIN_DB 6 // register value (0 ... 63) == gain of: (0 dB ... -63 dB)
#define TONE_DURATION_SECS 20ul
void aic3204_tonegen () {
Uint16 val;
Int16 hi, lo;
Uint32 samps;
val = (TONE_GAIN_DB & 0x3F);
AIC3204_rset( 0, 0x00); // Select page 0
AIC3204_rset( 71, val); // set left channel volume and disable the generator
AIC3204_rset( 72, val); // set right channel volume
samps = TONE_DURATION_SECS * 8000ul; // DAC Fs == 8000 samp/sec
// sample length bits 23:16
val = (samps >> 16) & 0xFF;
AIC3204_rset( 73, val);
// sample length bits 15:8
val = (samps >> 8) & 0xFF;
AIC3204_rset( 74, val);
// sample length bits 7:0
val = samps & 0xFF;
AIC3204_rset( 75, val);
// sin (x)
val = SIN_700_Q15;
hi = (val >> 8) & 0xFF;
lo = val & 0xFF;
AIC3204_rset( 76, hi);
AIC3204_rset( 77, lo);
// cos (x)
val = COS_700_Q15;
hi = (val >> 8) & 0xFF;
lo = val & 0xFF;
AIC3204_rset( 78, hi);
AIC3204_rset( 79, lo);
// enable the generator
val = (TONE_GAIN_DB & 0x3F) | 0x80;
AIC3204_rset( 71, val);
}