完善资料让更多小伙伴认识你,还能领取20积分哦, 立即完善>
扫一扫,分享给好友
你好,我想用PIC32MZ2048EFH064端口上的几个I/O引脚来驱动R2R DAC。DMA的任务是每次计时器2匹配发生时将数据移动到输出,当它工作时,完成该序列所需的时间比它应该的时间长3倍。我很难理解为什么会发生这种情况,并且希望有人能弄清楚为什么,这里是第2段。米I有>1)序列长度是255750个样本(字节),再细分成930x 275个样本长啁啾。imer还配置有1:1预标度,因此它应该在100MHz/4=25MHz4下滴答。在这个标称滴答速率下,我期望在275/25000000=~11uSec5中完成序列中的每个啁啾。在示波器上,~100ns的过渡宽度看起来是正确的,但是该序列需要花费~3倍的时间才能完成。我已经通过启用REFCLKO验证了内核/SYSCLK在200MHz下运行,因此我不明白为什么会发生这种情况。
以上来自于百度翻译 以下为原文 Hi there, I'm trying to use a few of the I/O pins on PORTF of the PIC32MZ2048EFH064 to drive an R2R DAC. The DMA is tasked with moving data to the output every time a timer 2 match occurs, and while it is working it is taking 3x longer than it should to complete the sequence. I am struggling to understand why this is happening, and in the hopes that someone can shed some light on why, here are the parameters I have> 1) Sequence length is 255750 samples (bytes), subdivided in to 930 x 275 sample long chirps. 2) Nominal tick rate is FCPU/8, in this case 200 MHz / 8 = 25 MHz 3) To achieve the nominal tick rate, PB3DIV is configured to 2 to give 100 MHz, and Timer 2 is configured with PR2=3; 4) The timer is also configured with a 1:1 prescalar so it should tick at 100MHz/4 = 25 MHz 4) At this nominal tick rate I expect to complete each chirp in the sequence in 275/25000000 = ~11 uSec 5) On the oscilloscope the transition widths of ~100 ns look right, but the sequence takes ~3x longer to complete I have verified that the core/SYSCLK is running at 200 MHz via enabling a REFCLKO so I am stumped as to why this is happening. Insights appreciated. |
|
相关推荐
2个回答
|
|
从数据表PBDIV=2=PBLKX是SysCLK除以3,什么是PB4DIV设置在?我认为这不是问题——我认为下面应该配置PB3到100MHz以及PB4到200MHz从200MHz的核。另一个表明速度正确的指示是UART正在使用50MHz的PB2来产生具有108除数的115200波特(BRGH=1)。(50e6/(115200*4)-1)=107.51我目前的理论是DMA引擎完成传输比我预期的要长得多,因此是“跳过”事件。
以上来自于百度翻译 以下为原文 From datasheet PBDIV=2= PBCLKx is SYSCLK divided by 3 What is PB4DIV set at? I don't think that is the problem - I think the below should configure PB3 to 100MHz and PB4 to 200 MHz from a 200 MHz core. /* 200MHz / 4 = 50MHz */ PB2DIVbits.PBDIV = 0b011; /* Timers use clock PBCLK3, set this to 100MHz. */ PB3DIVbits.PBDIV = 0b001; /* Ports use PBCLK4. */ PB4DIVbits.PBDIV = 0b000; Another indication that the speeds are correct is that the PB2 of 50MHz is being used by the UART to generate 115200 baud with a 108 divisor (BRGH=1). (50e6/(115200*4) -1)= 107.51 My current theory is that the DMA engine is taking much longer to complete the transfers than I expected and is therefore 'skipping' events. |
|
|
|
我假设这是一个打印错误,255750/25000000=11MSECCAN,你显示了如何设置DMA通道和链接?
以上来自于百度翻译 以下为原文 I presume that is a typo, as 255750/25000000 = ~11mSec Can you show how you are setting up the DMA channels and chaining? |
|
|
|
只有小组成员才能发言,加入小组>>
5178 浏览 9 评论
2003 浏览 8 评论
1931 浏览 10 评论
请问是否能把一个ADC值转换成两个字节用来设置PWM占空比?
3177 浏览 3 评论
请问电源和晶体值之间有什么关系吗?PIC在正常条件下运行4MHz需要多少电压?
2228 浏览 5 评论
738浏览 1评论
622浏览 1评论
有偿咨询,关于MPLAB X IPE烧录PIC32MX所遇到的问题
509浏览 1评论
PIC Kit3出现目标设备ID(00000000)与预期的设备ID(02c20000)不匹配。是什么原因
636浏览 0评论
533浏览 0评论
小黑屋| 手机版| Archiver| 电子发烧友 ( 湘ICP备2023018690号 )
GMT+8, 2024-11-27 01:14 , Processed in 1.041675 second(s), Total 79, Slave 62 queries .
Powered by 电子发烧友网
© 2015 bbs.elecfans.com
关注我们的微信
下载发烧友APP
电子发烧友观察
版权所有 © 湖南华秋数字科技有限公司
电子发烧友 (电路图) 湘公网安备 43011202000918 号 电信与信息服务业务经营许可证:合字B2-20210191 工商网监 湘ICP备2023018690号