2018-12-03 05:38 AM
Hi everyone,
Can I use CS43L22 just like a audio switch? In my project has a AUX input and want to switch this analog input via passthrough to the hp output. Is it possible? If yes, how? I have tried to call the following commands in main, but not get any sound.
WriteRegister(0x02, 0x01);
WriteRegister(0x04, 0xAF);
WriteRegister(0x05, 0x81);
WriteRegister(0x06, 0x04);
SetAudioVolume(0xb4);
WriteRegister(0x08, 0x01);
WriteRegister(0x09, 0x01);
WriteRegister(0x0D, 0x70);
WriteRegister(0x0E, 0xC0);
WriteRegister(0x14, 0x05);
WriteRegister(0x15, 0x05);
WriteRegister(0x1A, 0x0A);
WriteRegister(0x1B, 0x0A);
WriteRegister(0x02, 0x9E);
2018-12-03 06:35 AM
By AUX you mean AIN1A/AIN1B? If yes, and WriteRegister() does what it promises, the above code looks reasonable.
Can you play back data from the DAC when not in passthrough mode?
JW
2018-12-03 11:17 AM
Yes, I mean AIN1A and AIN1B.
I think that it should start playing the song once the WriteRegister(0x02, 0x9E) command, but it deosn't play.
I noticed it needs sending dummy data via I2S DMA to play an analog input. However I don't understand why it needs this?
2018-12-03 11:57 AM
> I noticed it needs sending dummy data via I2S DMA to play an analog input.
I don't think it does.
Do you have a custom-built board, or some of the DISCOs?
JW
2018-12-03 12:13 PM
I use custom design refers to F4Disco. After sent the above commands, in main transferring dummy via Dma, then it plays the song. When stopped the transfer, it doesn’t play.
2018-12-03 02:42 PM
The only reason which comes into my mind is that the headphones amplifier needs the charge pump running, and that is driven from the I2S clocks The CS43L22 datasheet is not very clear in this, but maybe besides MCLK the charge pump needs also the LRCK to be present?
JW
2018-12-04 12:07 AM
Yes,it's possible. However, it's a problem to play an analog input.