完善资料让更多小伙伴认识你,还能领取20积分哦, 立即完善>
扫一扫,分享给好友
你好,
我的工作项目以模拟样本的SAR ADC使用DMA,放入缓冲区1位于RAM,完成填充缓冲区后,切换到填充缓冲区2。而DMA填充缓冲区,缓冲区是通过串口传送给PC使用的CPU。而缓冲2完成灌装、DMA开始aggain填满缓冲区1和2是通过UART发送缓冲区。这个过程是循环的。 每笔交易以每2字节DMA突发ADC(ADC工作在12位分辨率)和传输数256(每个DMA transactiontakes ADC,128样本而样本2字节)。 (总和)后4096字节通过throughdma我开始从DMA得到错误的数据。 我的问题是: 我怎么能更新中转柜台(我想看看通过debuggeronphub_tdmem [XXX] - 12位ofxfrcnt)? 如何循环基于DMA必须适当的工作定义,解决了4096个字节的传输缓冲区的限制? 谢谢您。 亚历克斯 以上来自于百度翻译 以下为原文 Hello, I am working on project which takes analog samples from SAR ADC using DMA, put them into the buffer 1 located in RAM, after it finishes filling buffer, it switches to fill buffer 2. While DMA fills buffer 2, buffer 1 is transmitted to pc using CPU via uart. While filling of buffers 2 finishing, the DMA start aggain to fill buffer 1 and buffer 2 is transmitted via uart. The process is cyclic. Each transaction of DMA takes 2 bytes per burst from ADC (ADC operates at resolution of 12 bits) and transfers count is 256 (each DMA transaction takes 128 samples from ADC, while each sample is 2 bytes). After 4096 (total sum) of bytes pass through DMA I start to get wrong data from DMA. My questions are: How I can update the transfer counter (I tried to take a look via debugger on PHUB_TDMEM[xxx] - 12 bit of XFRCNT)? How cyclic processes based on DMA must be defined for proper work, solving the limitation of transfer buffer of 4096 bytes? Thank you. Alex |
|
相关推荐
3个回答
|
|
如何定义“来自DMA的错误数据”?您所描述的似乎是正确的,并且在DMA中没有限制,您应该看到(除了每个TD限制为每个传输4095字节,但您只使用256)。每次传输完成后,你是否重置每个TD?
关于PSoC5和DMA有很多附注,你读过了吗? 以上来自于百度翻译 以下为原文 How do you define "wrong data from DMA"? What you describe seems correct, and there is no limit in the DMA which you should see (apart from each TD limited to 4095 bytes per transfer, but you use only 256). Do you reset each TD after each transfer is done? There are a number of AppNotes about PSoC5 and DMA, did you read them? |
|
|
|
嗨,Hli,
谢谢你的回复。 “除了每个TD限制为每个传输4095字节,但您只使用256”-我看到错误的数据在16块256(16x256=4096)之后,由于这个事实,我认为我达到了它的最大值(4095)的转移计数。 唯一的“TD重置”,我做每一次转移后,它只禁用和启用的DMA通道(“CydMaDeDable(DMAY1SKA)”和“CydMaunTabl(DMAY1SK Chank,1);))。 我认为此过程不会重新启动传递计数器。 重置TD的正确步骤是什么? 附笔。 是的,我已经阅读了所有的附注。 谢谢您。 以上来自于百度翻译 以下为原文 Hi Hli, Thank you for your reply. "apart from each TD limited to 4095 bytes per transfer, but you use only 256" - I see the wrong data after 16 blocks of 256 (16x256=4096), due to this fact I think that I reach transfer count of it max value (4095). The only "TD reset" that I do after each transfer is done it's only disable and enable again of the DMA channel ( "CyDmaChDisable(DMA_1_Chan);" and "CyDmaChEnable(DMA_1_Chan, 1);"). I think that this procedure doesn't restarts transfer counter. What is the correct procedure to reset the TD? P.S. Yes, I have read all the AppNotes. Thank you. |
|
|
|
关于TD中设置的转数。按顺序执行TD多次并不重要。
当我理解你正确时,你有两个TDS,链式,每个都负责填充一个缓冲区。这在第52705章第10章中得到解释。重要的是,将DMA通道设置为“保存TD”,这样当下次执行时,TDS会重新加载。 以上来自于百度翻译 以下为原文 Its about the transferCount set in the TD. It should not matter that you execute the TD multiple times in sequence. When I understand you correct you have two TDs, chained, and each of them is responsible for filling one buffer. This is explained in AN 52705, chapter 10. Whats important is that you set the DMA channel to 'preserve TD', so the TDs get reloaded when they are executed the next time. |
|
|
|
只有小组成员才能发言,加入小组>>
752个成员聚集在这个小组
加入小组2071 浏览 1 评论
1827 浏览 1 评论
3639 浏览 1 评论
请问可以直接使用来自FX2LP固件的端点向主机FIFO写入数据吗?
1761 浏览 6 评论
1513 浏览 1 评论
CY8C4025LQI在程序中调用函数,通过示波器观察SCL引脚波形,无法将pin0.4(SCL)下拉是什么原因导致?
511浏览 2评论
CYUSB3065焊接到USB3.0 TYPE-B口的焊接触点就无法使用是什么原因导致的?
361浏览 2评论
CX3连接Camera修改分辨率之后,播放器无法播出camera的画面怎么解决?
410浏览 2评论
357浏览 2评论
使用stm32+cyw43438 wifi驱动whd,WHD驱动固件加载失败的原因?
858浏览 2评论
小黑屋| 手机版| Archiver| 电子发烧友 ( 湘ICP备2023018690号 )
GMT+8, 2024-11-25 08:08 , Processed in 0.880016 second(s), Total 81, Slave 64 queries .
Powered by 电子发烧友网
© 2015 bbs.elecfans.com
关注我们的微信
下载发烧友APP
电子发烧友观察
版权所有 © 湖南华秋数字科技有限公司
电子发烧友 (电路图) 湘公网安备 43011202000918 号 电信与信息服务业务经营许可证:合字B2-20210191 工商网监 湘ICP备2023018690号