完善资料让更多小伙伴认识你,还能领取20积分哦, 立即完善>
例如设置sample_rate=48000,bits_per_sample=16,use_apll = true,fixed_mclk = 12288000;
static esp_err_t i2s_apll_calculate_fi2s计算得到真实:real rate: 47999.961 I (402) I2S: DMA Malloc info, datalen=blocksize=128, dma_buf_count=64 I (412) I2S: sdm0=2, sdm1=154, sdm2=4, odir=5 I (412) I2S: APLL: Req RATE: 48000, fi2s_rate: 12287990.000, real rate: 47999.961, BITS: 16, CLKM: 1, BCK_M: 8, MCLK: 12287990.000, SCLK: 1535998.750000, diva: 1, divb: 0 I (422) bsp_i2s_init: I2S driver installed. 如果i2s_apll_calculate_fi2s按照遍历方式寻找最佳的值得到更接近real rate: 47999.992,fi2s_rate也有一点点提高,不知道这样这几组值对结果有没有什么影响。 I (3162) I2S: sdm0=149, sdm1=212, sdm2=5, odir=6 E (3162) i2s_apll_get_fi2s: f_xtal:40000000,fout:393215936.000,fpll:12287998.000 I (3162) I2S: APLL: Req RATE: 48000, fi2s_rate: 12287998.000, real rate: 47999.992, BITS: 16, CLKM: 1, BCK_M: 8, MCLK: 12287998.000, SCLK: 1535999.750000, diva: 1, divb: 0 I (3182) bsp_i2s_init: I2S driver installed. float f_xtal = (float)(rtc_clk_xtal_freq_get() * 1000000); min_diff = APLL_MAX_FREQ; float t_odir,t_sdm0,t_sdm1; for (_odir = 0; _odir < 32; _odir ++){ t_odir = f_xtal / (2 * (_odir+2)) / 2; for (_sdm0 = 0; _sdm0 < 256; _sdm0 ++) { t_sdm0 = (_sdm0 / 65536.0f) + 4; for (_sdm1 = 0; _sdm1 < 256; _sdm1 ++){ t_sdm1 = (_sdm1 / 256.0f) + t_sdm0; for (_sdm2 = 4; _sdm2 < 9; _sdm2 ++) { //avg = i2s_apll_get_fi2s(bits_per_sample, _sdm0, *sdm1, *sdm2, *odir); avg = t_odir * (t_sdm1 + _sdm2); if (abs(avg - rate) < min_diff) { min_diff = abs(avg - rate); *odir = _odir; *sdm0 = _sdm0; *sdm1 = _sdm1; *sdm2 = _sdm2; } } } } } |
|
相关推荐
|
|
只有小组成员才能发言,加入小组>>
168个成员聚集在这个小组
加入小组140 浏览 0 评论
1158 浏览 1 评论
584浏览 6评论
482浏览 5评论
有没有办法在不使用混杂模式的情况下实现Wifi驱动程序接收缓冲区访问中断呢?
467浏览 5评论
466浏览 4评论
441浏览 4评论
小黑屋| 手机版| Archiver| 电子发烧友 ( 湘ICP备2023018690号 )
GMT+8, 2024-12-25 12:49 , Processed in 0.789913 second(s), Total 73, Slave 57 queries .
Powered by 电子发烧友网
© 2015 bbs.elecfans.com
关注我们的微信
下载发烧友APP
电子发烧友观察
版权所有 © 湖南华秋数字科技有限公司
电子发烧友 (电路图) 湘公网安备 43011202000918 号 电信与信息服务业务经营许可证:合字B2-20210191 工商网监 湘ICP备2023018690号