完善资料让更多小伙伴认识你,还能领取20积分哦, 立即完善>
你好
我正在使用SPC560P40L1 我试图使用存储在内存中的预定义数据来切换GPIO。我希望GPIO能够在ETC / etimer监控的PWM引脚上升沿之后进行切换。我还需要DMA来控制所有这些。 CPU已经很好了。 是否有我可以使用的示例代码?我使用SPC5studio,他们只有使用SPI和ADC的DMA示例。 我查看了参考手册,作为DMA的初学者,这并不容易 有人能指出我正确的方向开始吗? -谢谢 以上来自于谷歌翻译 以下为原文 Hi I'm using the SPC560P40L1 Im trying to switch a GPIO using pre-defined data stored in memory. I would like the GPIO to switch after a rising edge on a PWM pin which is being monitored by ETC/eTimer. I also need the DMA to control all of this. The CPU is pretty loaded already. Is there an example code I could use? Im using the SPC5studio and they only have examples of DMA use with SPI and ADC. I looked at the reference manual and that is not easy to start of with as a beginner to DMA Can anyone point me in the right direction to get started? -Thanks |
|
相关推荐
8个回答
|
|
你好Raghu,
对不起,ETC / eTIMER没有DMA驱动程序 我们没有例子 SPC560P40L1 您可以通过API创建自己的配置 您可以将DMA_MUX通道16,17,18,19用于eTimer SPC5_ADC0_DMA_DEV_ID ==>第16频道 不要犹豫,更新文件icu_lld.c以遵循下面的ADC示例(通过补丁模式) 驱动程序结构修改集成Allocationto集成启动 对于init, 对于开始, 最好的祝福 二万 以上来自于谷歌翻译 以下为原文 Hello Raghu, Sorry , There is no DMA drivers with ETC/eTIMER and we have no example with SPC560P40L1 You can create your own configuration by API You can use DMA_MUX Channel 16,17,18,19 for eTimer SPC5_ADC0_DMA_DEV_ID ==> Channel 16 Do not hesitate to update the file icu_lld.c to follow the ADC Example below (by the patch mode)
For init,
For Start,
Best regards Erwan |
|
|
|
嗨二万
谢谢回复。但是如何使用DMA切换GPIO(DMA在存储器和GPIO之间传输数据)。那可能吗? 我不认为它来自手册中的以下行, 系统存储器,DSPI,ADC,FlexPWM,eTimer和CTU之间可以进行DMA传输 但只是想和你确认一下。 在这种情况下,我可以使用其中一个DSPI引脚来跟踪存储器映射吗?因此,使用DSPI引脚从存储器输出某些数据,使其像GPIO一样工作。 在eTimer ICU发出中断后,我仍然需要启动DMA传输。 你有什么建议可以让这更容易,还是我走在正确的道路上? 以上来自于谷歌翻译 以下为原文 Hi Erwan Thanks for the reply. But what about switching the GPIO using the DMA (DMA transfers data between memory and GPIO). Is that possible? I do not think it is from the following line in the manual,
In which case maybe I can use one of the DSPI pins to switch following a memory map? So using the DSPI pins to output a certain data from memory and make it function like a GPIO. I still need the DMA transfer to start after an interrupt from eTimer ICU. Do you have any suggestions that could make this easier or am I on the right path? |
|
|
|
你好Raghu,
对于GPIO端口,您必须使用Onchip Memory '使用GPIO端口驱动或采样波形。通过配置DMA进行传输 数据到一个或多个GPIO端口,可以使用创建复杂的波形 表格数据存储在片上存储器中。相反,定期使用DMA 从一个或多个GPIO端口传输数据,可以对复杂波形进行采样 并将结果以表格形式存储在片上存储器中。使用eTimer / CTU / DSPI(参见表246)。 如果为eTimer ICU启用DMA传输,则不会处理DMA中断而不是ICU中断。 检查DMA MUX(第20章) 对于RLA& HAL驱动程序,有一个很好的例子,如何配置DMA通道。 最好的祝福 二万 以上来自于谷歌翻译 以下为原文 Hello Raghu , for GPIO Ports, you have to use the Onchip Memory 'Using the GPIO Ports to drive or sample waveforms. By configuring the DMA to transfer data to one or more GPIO ports, it is possible to create complex waveforms using tabular data stored in on-chip memory. Conversely, using the DMA to periodically transfer data from one or more GPIO ports, it is possible to sample complex waveforms and store the results in tabular form in on-chip memory.'Use eTimer /CTU/DSPI (Cf Table 246). if you enable DMA Transfer for eTimer ICU, the DMA Interrupt will be handled not the ICU Interrupt. Check DMA MUX (Chapter 20) For RLA & HAL Drivers , there are a nice example how to configure the DMA Channel. Best regards Erwan |
|
|
|
嗨二万
我查看了您引用的部分,并提到使用PIT配置周期性SPI或GPIO传输。 但是在PIT部分,没有关于如何设置DMA触发器的信息?它是自动的,即只要我启用PIT,它会根据其周期生成连续触发吗?我需要启用PIT中断吗? 除了正常的路由功能外,DMA Mux的前四个通道提供了一种特殊的周期性触发功能,可用于提供自动机制,以固定的间隔传输字节,帧或数据包,而无需处理器干预。触发由周期性中断定时器(PIT)产生;因此,周期性触发间隔的配置是通过PIT中的配置寄存器完成的。有关该主题的更多信息,请参见第31章:周期性中断定时器(PIT)。 以上来自于谷歌翻译 以下为原文 Hi Erwan I looked at the section you referenced and it mentions to use a PIT to configure a periodic SPI or GPIO transfer. But in the PIT section, there is no information on how to setup trigger for DMA? Is it automatic i.e as soon as I enable the PIT, will it generate a continuous trigger depending on its period? Do I need to enable the PIT interrupt? 'Besides the normal routing functionality, the first four channels of the DMA Mux provide a special periodic triggering capability that can be used to provide an automatic mechanism to transmit bytes, frames or packets at fixed intervals without the need for processor intervention. The trigger is generated by the Periodic Interrupt Timer (PIT); as such, the configuration of the periodic triggering interval is done via configuration registers in the PIT. Please refer to Chapter 31: Periodic Interrupt Timer (PIT) for more information on this topic' |
|
|
|
你好Raghu,
PIT仅用于DMA触发。 首先,使用您的计时器设置配置1个PIT通道(#1,#2,#3或#4) 其次,在设置良好的源码时,必须使用相应的DMA通道#0到DMA通道#3。 最好的祝福 二万 以上来自于谷歌翻译 以下为原文 Hello Raghu , the PIT is used only for the DMA triggering. First , configure 1 PIT channel (#1 , #2, #3 or #4) with your timer settings Second, you have to use the corresponding DMA Channel #0 to DMA Channel #3 in settings the good source.. Best regards Erwan |
|
|
|
嗨二万
我有以下配置设置使用DSPI_1 TX,它是我的设备的源3,用于使用带PIT的DMA 1.为Ch 2配置DSPI1 TX1 2.配置PIT CH 3. PIT定时器设置为~15KHz 3.将0xC3写入CH2CONFIG寄存器。 但我很困惑如何实现spi_lld_send(& SPID2,256,buff)命令来发送周期性数据。我是否必须在for循环中实现它。现在我没有看到TX引脚上发送任何数据。我已经在无限for循环中尝试了两者并且在它之外也有相同的结果。 我已经确认PIT使用GPIO引脚切换为callaback。 我还单独确认了DMA SPI传输。如果我将CH2CONFIG设置为0x83,并在无限for循环中实现spi_lld_send(& SPID2,256,buff),我可以连续看到TX引脚上的输出。 但使用DMA的DSPI的PIT不起作用。我的最终目标是以15KHz的时序发送SPI数据,并不时地改变SPI数据。非常感谢任何反馈...... 以上来自于谷歌翻译 以下为原文 Hi Erwan I have the following configuration set for using DSPI_1 TX which is source 3 for my device for using DMA with PIT 1. Configure DSPI1 TX1 for Ch 2 2. Configure PIT CH 3. PIT timer is set for ~15KHz 3. Write 0xC3 to CH2CONFIG register. But I am confused about how to implement the spi_lld_send(&SPID2, 256, buff) command for periodic data to be sent. Do I have to implement this in a for loop. Right now I do not see any data being sent on the TX pin. I have tried both in an infinite for loop and outside of it with the same result. I have confirmed the PIT working with a GPIO pin toggle in a callaback. I have also confirmed the DMA SPI transfer just by itself. If I set CH2CONFIG to 0x83, and implement spi_lld_send(&SPID2, 256, buff) in a infinite for loop, I can see output on TX pin continuously. but PIT with DSPI using DMA is not working. My final goal is to send SPI data at 15KHz timing and change the SPI data every now and then. Would appreciate any feedback... |
|
|
|
嗨二万
你有机会更新我的问题吗? -谢谢 以上来自于谷歌翻译 以下为原文 Hi Erwan Any chance you have an update on my question? -Thanks |
|
|
|
|
|
|
|
只有小组成员才能发言,加入小组>>
请教:在使用UDE STK时,单片机使用SPC560D30L1,在配置文件怎么设置或选择?里面只有SPC560D40的选项
2742 浏览 1 评论
3244 浏览 1 评论
请问是否有通过UART连接的两个微处理器之间实现双向值交换的方法?
1813 浏览 1 评论
3655 浏览 6 评论
6044 浏览 21 评论
1342浏览 4评论
203浏览 3评论
对H747I-DISCO写程序时将CN2的st-link复用为usart1,再次烧录时无法检测到stlink怎么解决?
356浏览 2评论
STM32G474RE芯片只是串口发个数据就发烫严重是怎么回事?
446浏览 2评论
STM32处理增量式编码器Z信号如何判断中断是正转的还是反向转的?
275浏览 2评论
小黑屋| 手机版| Archiver| 电子发烧友 ( 湘ICP备2023018690号 )
GMT+8, 2024-12-27 23:07 , Processed in 1.333301 second(s), Total 90, Slave 74 queries .
Powered by 电子发烧友网
© 2015 bbs.elecfans.com
关注我们的微信
下载发烧友APP
电子发烧友观察
版权所有 © 湖南华秋数字科技有限公司
电子发烧友 (电路图) 湘公网安备 43011202000918 号 电信与信息服务业务经营许可证:合字B2-20210191 工商网监 湘ICP备2023018690号