完善资料让更多小伙伴认识你,还能领取20积分哦, 立即完善>
电子发烧友论坛|
你好,
我想使用DMA功能每10个PWM周期重新加载PWM占空比。因此,我配置了FlexPWM子模块0和DMA通道10.一个数组为VAL3寄存器存储了8个不同的值,其占空比从10%到80%不等。 我的DMA通道步骤看起来像这样: edmaChannelSetup(10,&安培; dcPWM [0],&安培; mcPWM_A。 SUBMOD [0]。 VAL_3 。 [R ,2,0,1,1,2,8,-16,0,0); 现在VAL_3寄存器由DMA写入,但始终与最后一个表元素一起写入。如果我将DMA迭代减少到4,那么VAL_3总是从我的表中获取第4个元素的值。我已经使用DMA来重新加载etimer比较值,并且在从表中写入一个元素以将寄存器与每个比较事件进行比较时没有问题。 每次重新加载事件都无法使用表中的下一个元素吗? 另外,我不太确定我是否理解DMA的重载功能。 DMAEN寄存器包含VALDE位。在参考手册中,描述说''这个读/写位在设置RF时启用VALx寄存器的DMA写请求''。这是否意味着我每个VAL寄存器收到一个请求(意味着总共六个)或者是否应该使用该请求用一个DMA通道写入所有VAL寄存器? 最好的祝福, 帕特里克 以上来自于谷歌翻译 以下为原文 Hello, I would like to reload PWM duty cycle every 10 PWM periods using DMA functionality. Therefore I configured FlexPWM subodule 0 and DMA channel 10. An array stores 8 different values for VAL3 register which equal duty cycles from 10%...80%. My DMA channel step looks like that:
edmaChannelSetup(10,&dcPWM[0],&mcPWM_A. SUBMOD [0]. VAL_3 . R ,2,0,1,1,2,8,-16,0,0); Now VAL_3 register is written by DMA, but always with the last table element. If I reduce the DMA iterations to 4, then VAL_3 always gets the value of 4th element from my table. I already used DMA for reloading eTimer compare values and had no problems with writing one element from a table to compare registers with each compare event. Is there no way to use the next element from table with every reload event? Additionally, I am not quite sure if I understand the reload feature with DMA. The DMAEN register include the VALDE bit. In the reference manual, the description says ''This read/write bit enables DMA write requests for the VALx register when RF is set''. Does it mean that I get one request per VAL register (means totally six) or should the request be used to write all VAL registers with one DMA channel? Best regards, Patrik |
|
相关推荐
5个回答
|
|
|
你好,
关于我的问题还有两个问题: - 如果用DMA更新VALx寄存器,是否必须手动设置LDOK位? - EXT_FORCE信号怎么样?我找不到具有该功能的引脚。 最好的祝福, 帕特里克 以上来自于谷歌翻译 以下为原文 Hello, Two additional questions regarding my issue: - Do I have to set the LDOK bit manually if I update VALx registers with DMA? - What about the EXT_FORCE signal? I didn´t find a pin with that function. Best regards, Patrik |
|
|
|
|
|
你好Patrik,
您正在使用增强型直接内存访问(eDMA),启用DMA通道并启用触发功能 。 1) 据RM说 ''16个可独立选择的DMA通道路由器 - 前4个通道另外提供触发功能'' 你必须使用前4个频道 2)我没有看到任何edma频道的分配 (edmaChannelAllocate) 3)重新加载功能应由PIT触发。 设置DMAEN是不够的。 最后,您应该启动edmaChannelStart 它更新,DMA设置启用请求寄存器。 对于ADC& DSPI,有一些例子如何使用eDMA。 Patrik,你有一个你的申请的例子吗? 您可以通过电子邮件直接向我发送您的申请。 最好的祝福 二万 以上来自于谷歌翻译 以下为原文 Hello Patrik , You are using enhanced direct memory access (eDMA) with DMA Channel enabled with triggering . 1) According to the RM ''• 16 independently selectable DMA channels routers – the first 4 channels additionally provide a trigger functionality'' You have to use the first 4 channels 2) i do not see any allocation of edma Channel (edmaChannelAllocate)
3) The reload feature should be triggered by PIT. To set DMAEN is not sufficient. At the end you should launch edmaChannelStart it updates , DMA Set Enable Request Register. For ADC & DSPI , there are some example how to use eDMA. Patrik , do you have an example of your application ? you can send to me directly your application by email. Best regards Erwan |
|
|
|
|
|
你好Patrik,
- 如果用DMA更新VALx寄存器,是否必须手动设置LDOK位? 是的...... 1)你必须设置CLDOK - Clear Load Okay 2)更新VALx寄存器, 3)强制重新加载寄存器ValueLDOK - 加载OK - EXT_FORCE信号怎么样?我找不到具有该功能的引脚。 我正在检查PWM专家。 最好的祝福 二万 以上来自于谷歌翻译 以下为原文 Hello Patrik , - Do I have to set the LDOK bit manually if I update VALx registers with DMA? yes ... 1) you have to set CLDOK - Clear Load Okay 2) update VALx registers , 3) force the reload of Registers ValueLDOK - Load OK - What about the EXT_FORCE signal? I didn´t find a pin with that function. I am checking with PWM Experts. Best regards Erwan |
|
|
|
|
|
你好,Erwan,
好的,现在这一点对我来说很清楚。意味着我必须在通过DMA更改VALx寄存器后手动设置LDOK。 唯一的问题是EXT_FORCE信号。在参考手册第14章中,CTU交互(第285页)显示FlexPWM_0的EXT_FORCE信号可能是eTimer输出通道1.我已经尝试过这种交互,它运行良好。但我没有找到使用外部信号的解决方案,如26.2.5所述 最好的祝福, 帕特里克 以上来自于谷歌翻译 以下为原文 Hello Erwan, Ok, now that point is clear to me. Means that I have to set LDOK manually after changing the VALx registers by DMA. Only open question is the EXT_FORCE signal. In reference manual chapter14, CTU interaction on page 285 shows that the EXT_FORCE signal for FlexPWM_0 could be eTimer output channel 1. I already tried this interaction and it works well. But I found no solution to use an external signal for as described in 26.2.5 Best regards, Patrik |
|
|
|
|
|
你好Patrick,
可以使用PULSE-OUTPUT模式下的eTimer_0.CH1将外部信号连接到FlexPWM EXT_FORCE输入。如果计数器设置为CNTMODE = 001,OFLAG OUTMODE设置为“11111”(门控时钟输出)且ONCE位未置位,则计数器将输出脉冲频率与脉冲频率相同的脉冲流。选定的时钟源。所选时钟源可以是外部信号,例如,在eTimer_0.CH0上,用作eTimer_0.CH1的输入。 最好的祝福, 朱塞佩 以上来自于谷歌翻译 以下为原文 Hello Patrick, an external signal can be connected to the FlexPWM EXT_FORCE input using the eTimer_0.CH1 in PULSE-OUTPUT Mode. If the counter is setup for CNTMODE = 001, with the OFLAG OUTMODE set to ‘11111’ (gated clock output) and the ONCE bit not set, the counter will output a pulse stream of pulses that has the same frequency of the selected clock source. The selected clock source can be an external signal, for example, on the eTimer_0.CH0 which is used as input for eTimer_0.CH1. Best regards, Giuseppe |
|
|
|
|
只有小组成员才能发言,加入小组>>
stm32mp157的异核通信的rpmsg_sdb的m4固件和a7驱动该如何编写?
1453 浏览 0 评论
stm32f103用freertos对一个采样率为1kHz的传感器,进行采样,数据出差
1502 浏览 0 评论
请教:在使用UDE STK时,单片机使用SPC560D30L1,在配置文件怎么设置或选择?里面只有SPC560D40的选项
3649 浏览 1 评论
3842 浏览 1 评论
请问是否有通过UART连接的两个微处理器之间实现双向值交换的方法?
2461 浏览 1 评论
STM32H7打开DCache后,出现了串口接收信息为空的现象,是哪里出了问题?
727浏览 5评论
用NANO STM32F103RBT6的开发板烧录不了是哪里出了问题?
661浏览 5评论
710浏览 5评论
外部中断触发类型为双边沿触发,进入中断回调后有什么办法判断该边沿是上升沿还是下降沿?
941浏览 5评论
STM32L071CBT6低温环境下无法正常工作是什么原因引起的?
745浏览 5评论
/9
小黑屋| 手机版| Archiver| 电子发烧友 ( 湘ICP备2023018690号 )
GMT+8, 2025-12-2 04:52 , Processed in 0.824939 second(s), Total 80, Slave 63 queries .
Powered by 电子发烧友网
© 2015 bbs.elecfans.com
关注我们的微信
下载发烧友APP
电子发烧友观察
版权所有 © 湖南华秋数字科技有限公司
电子发烧友 (电路图) 湘公网安备 43011202000918 号 电信与信息服务业务经营许可证:合字B2-20210191

淘帖
1581