da7212 mkrzero接口

⚠️
嗨,...感谢您来论坛。令人兴奋的消息!我们现在正在迁至我们的新论坛平台,将提供更好的功能,并包含在主对话框网站中。所有帖子和帐户都已迁移。我们现在只接受新论坛上的流量 - 请发布任何新线程https://www.dialog-seminile.com/support.。我们将在未来几天修复错误/优化搜索和标记。
9个帖子/ 0新
最后一篇
尼拉达特
离线
最后一次露面:1 year 2 months ago
加入:2019-12-27 07:09
da7212 mkrzero接口

你好,

根据DA7212的数据表Page 62,当DA7212与从动模式中的处理器接口时,不需要MCLK。我用我的Arduino Mkrzero界面接口了ARD-Audio-DA7212板。Arduino MKRZero能够生成所需的I2S信号,如BCLK,WCLK和Datout。我的问题是我必须向Mkrzero提供MCLK到ARD-Audio-DA7212吗?

regards,

尼拉达特。

设备:
CharlesXue1122.
离线
最后一次露面:5 days 57 min ago
职员
加入:2019-12-23 05:48
Dear Niradat,

Dear Niradat,

抱歉迟到的回应。我的DA7212 DA7212似乎与您的差异有些不同。

你能把你的人发送给我来检查描述。我需要检查PLL时钟Soucrec来自MCLK或Blck。

非常感谢!

布尔

查尔斯

尼拉达特
离线
最后一次露面:1 year 2 months ago
加入:2019-12-27 07:09
你好,

你好,

附近是我拥有的da7212的数据表。

Regards,

尼拉达特

CharlesXue1122.
离线
最后一次露面:5 days 57 min ago
职员
加入:2019-12-23 05:48
嗨Niradat,

嗨Niradat,

附件是一个新的。您可以参考“13.25时钟模式”部分作为参考。请注意PLL模式配置。

谢谢!

尼拉达特
离线
最后一次露面:1 year 2 months ago
加入:2019-12-27 07:09
嗨查尔斯,

嗨查尔斯,

感谢您分享DA7212的更新数据表。使用数据表我已经在Arduino Mkrzero上写下了Follwing代码。在此代码中,MKRzero正在播放16位立体声WAV文件,我可以在我的ARD-Audio -Da7212音频屏蔽上聆听它。但似乎DA7212突然进入睡眠状态,音频停止。虽然mkrzero正在播放音频。此外,来自DA7212模块的音频不是立体声。请在这方面帮助。

此致,

NIradat.

#定义CODEC_ADDRESS 0 x1a # include < SD.h > #萤火虫e  #include  // filename of wave file to play const char filename[] = "MUSIC.WAV"; // variable representing the Wave File SDWaveFile waveFile; void setup() { // Open serial communications and wait for port to open: Serial.begin(9600); delay(5000); // setup the SD card, depending on your shield of breakout board // you may need to pass a pin number in begin for SS Serial.print("Initializing SD card..."); if (!SD.begin()) { Serial.println("initialization failed!"); return; } Serial.println("initialization done."); // create a SDWaveFile waveFile = SDWaveFile(filename); // check if the WaveFile is valid if (!waveFile) { Serial.println("wave file is invalid!"); while (1); // do nothing } // print out some info. about the wave file Serial.print("Bits per sample = "); Serial.println(waveFile.bitsPerSample()); long channels = waveFile.channels(); Serial.print("Channels = "); Serial.println(channels); long sampleRate = waveFile.sampleRate(); Serial.print("Sample rate = "); Serial.print(sampleRate); Serial.println(" Hz"); long duration = waveFile.duration(); Serial.print("Duration = "); Serial.print(duration); Serial.println(" seconds"); ///////////////////////////////////////////////////////////////////// Initialization of DA7212 ///////////////////////////////////////////////////////////////// Wire.begin(); //WRITE DA7212 0x92 0x00 //Set Ramp rate to default delay(100); Wire.beginTransmission(CODEC_ADDRESS); Wire.write(0x92); Wire.write(0x00); Wire.endTransmission(); //WRITE DA7212 0x90 0x80 //Enable Digital LDO delay(100); Wire.beginTransmission(CODEC_ADDRESS); Wire.write(0x90); Wire.write(0x80); Wire.endTransmission(); //WRITE DA7212 0x29 0xC0 //Enable AIF 16bit I2S mode delay(100); Wire.beginTransmission(CODEC_ADDRESS); Wire.write(0x29); Wire.write(0xC0); Wire.endTransmission(); //WRITE DA7212 0x22 0x0A //Set incoming sample rate to 44.1kHz delay(100); Wire.beginTransmission(CODEC_ADDRESS); Wire.write(0x22); Wire.write(0x0A); Wire.endTransmission(); //WRITE DA7212 0x94 0x02 //Set PC sync to resync default delay(100); Wire.beginTransmission(CODEC_ADDRESS); Wire.write(0x94); Wire.write(0x02); Wire.endTransmission(); //WRITE DA7212 0x27 0x04 //PLL_CTRL PLL disabled delay(100); Wire.beginTransmission(CODEC_ADDRESS); Wire.write(0x27); Wire.write(0x04); Wire.endTransmission(); //WRITE DA7212 0x2A 0x32 //Route DAI to Outputs default delay(100); Wire.beginTransmission(CODEC_ADDRESS); Wire.write(0x2A); Wire.write(0x32); Wire.endTransmission(); //WRITE DA7212 0x4B 0x08 //MIXOUT_L input from DACL delay(100); Wire.beginTransmission(CODEC_ADDRESS); Wire.write(0x48); Wire.write(0x08); Wire.endTransmission(); //WRITE DA7212 0x4C 0x08 //MIXOUT_R input from DACR delay(100); Wire.beginTransmission(CODEC_ADDRESS); Wire.write(0x4C); Wire.write(0x08); Wire.endTransmission(); //WRITE DA7212 0x47 0xCD //Enable charge pump, CP_MOD mode, CPVDD/1 and Boost CP delay(100); Wire.beginTransmission(CODEC_ADDRESS); Wire.write(0x47); Wire.write(0xCD); Wire.endTransmission(); //WRITE DA7212 0x95 0x36 //Set CP threshold to 0x36 delay(100); Wire.beginTransmission(CODEC_ADDRESS); Wire.write(0x95); Wire.write(0x36); Wire.endTransmission(); //WRITE DA7212 0x96 0xA5 //Set CP Tau DELAY to 64ms delay(100); Wire.beginTransmission(CODEC_ADDRESS); Wire.write(0x96); Wire.write(0xA5); Wire.endTransmission(); //WRITE DA7212 0x48 0x2D //Set volume to -12dB delay(100); Wire.beginTransmission(CODEC_ADDRESS); Wire.write(0x48); Wire.write(0x2D); Wire.endTransmission(); //WRITE DA7212 0x49 0x2D //Set volume to -12dB delay(100); Wire.beginTransmission(CODEC_ADDRESS); Wire.write(0x49); Wire.write(0x2D); Wire.endTransmission(); //WRITE DA7212 0x51 0xF1 //Enable DAC, Mix and HP amplifiers delay(100); Wire.beginTransmission(CODEC_ADDRESS); Wire.write(0x51); Wire.write(0xF1); Wire.endTransmission(); //WRITE DA7212 0xFD 0x01 //Set tone gen gain to -18dBstem Active delay(100); Wire.beginTransmission(CODEC_ADDRESS); Wire.write(0xFD); Wire.write(0x01); Wire.endTransmission(); ///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// // adjust the playback volume AudioOutI2S.volume(50); // check if the I2S output can play the wave file if (!AudioOutI2S.canPlay(waveFile)) { Serial.println("unable to play wave file using I2S!"); while (1); // do nothing } // start playback Serial.println("starting playback"); AudioOutI2S.play(waveFile); } void loop() { // check if playback is still going on if (!AudioOutI2S.isPlaying()) { // playback has stopped Serial.println("playback stopped"); while (1); // do nothing } }

CharlesXue1122.
离线
最后一次露面:5 days 57 min ago
职员
加入:2019-12-23 05:48
嗨Niradat,

嗨Niradat,

如果已将DA7212配置为从模式,请您提供从Arduino MKRZERO发送的MCLK / BCLK / WS的频率吗?

I can find some sample code for you.

谢谢!

尼拉达特
离线
最后一次露面:1 year 2 months ago
加入:2019-12-27 07:09
嗨查尔斯,

嗨查尔斯,

Yes, I want to configure DA7212 in slave mode. Regarding the clock outputs from Arduino MKRZERO, there are only three outputs from MKRZERO namely BCLK, WS and DOUT with their respective frequency BCLK= 1.4112 MHz and WS=44.1KHz. MCLK is not output from MKRZERO.

BCLK = 44.1 kHz×16×2 = 1.4112 MHz

Regards,

尼拉达特。

CharlesXue1122.
离线
最后一次露面:5 days 57 min ago
职员
加入:2019-12-23 05:48
嗨Niradat,

嗨Niradat,

请参阅附加的代码。

谢谢!

尼拉达特
离线
最后一次露面:1 year 2 months ago
加入:2019-12-27 07:09
非常感谢查尔斯

非常感谢查尔斯