您好,请教关于6746使用EDMA实现SPI传输的问题,目前我的需求是:定时1s钟向SPI发送10个字节的数据,用EDMA实现向SPI总线发数.
我现在的做法,初始化EDMA通道时,OPT寄存器设置为0x8113290,link地址设置为0xffff,目前测试情况是DMA和SPI初始化完成后,第一次DMA向SPI发数正确,能够正确进入DMA传输完成中断。1s定时中断到了,想要启动第二次Dma传输,如何启动,需要设置什么寄存器吗?谢谢!
This thread has been locked.
If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.
您好,请教关于6746使用EDMA实现SPI传输的问题,目前我的需求是:定时1s钟向SPI发送10个字节的数据,用EDMA实现向SPI总线发数.
我现在的做法,初始化EDMA通道时,OPT寄存器设置为0x8113290,link地址设置为0xffff,目前测试情况是DMA和SPI初始化完成后,第一次DMA向SPI发数正确,能够正确进入DMA传输完成中断。1s定时中断到了,想要启动第二次Dma传输,如何启动,需要设置什么寄存器吗?谢谢!
All DMA/QDMA PaRAM sets must also specify a link address value. For repetitive transfers such as
ping-pong buffers, the link address value should point to another predefined PaRAM set. Alternatively, a
nonrepetitive transfer should set the link address value to the null link value. The null link value is defined
as FFFFh. See Section 18.2.3.7 for more details.
NOTE: Any incoming events that are mapped to a null PaRAM set results in an error condition. The
error condition should be cleared before the corresponding channel is used again. See
Section 18.2.3.5.
按上面描述,第一次完成后,link到了null参数表,而SPI接口是一直使能的,所以在发完第10个数后还是会向EDMA发送事件请求下一个数的,而这时DMA参数为null,从而产生error,所以在下次启动之前要清掉:
18.2.3.3 Null PaRAM Set
A null PaRAM set is defined as a PaRAM set where all count fields (ACNT, BCNT, and CCNT) are
cleared to 0. If a PaRAM set associated with a channel is a NULL set, then when serviced by the
EDMA3CC, the bit corresponding to the channel is set in the associated event missed register (EMR or
QEMR). This bit remains set in the associated secondary event register (SER or QSER). This implies that
any future events on the same channel are ignored by the EDMA3CC and you are required to clear the bit
in SER or QSER for the channel. This is considered an error condition, since events are not expected on
a channel that is configured as a null transfer. See Section 18.4.2.5.8 and Section 18.4.2.2.1 for more
information on the SER and EMR registers, respectively.
你好,我按照您说的做法,在定时需要发送SPI的数据时,做了清除的处理操作,具体实现代码是:
EDMA3ClrMissEvt(SOC_EDMA30CC_0_REGS,EDMA3_CHA_SPI1_TX)
EDMA3EnableTransfer(SOC_EDMA30CC_0_REGS, EDMA3_CHA_SPI1_TX, EDMA3_TRIG_MODE_EVENT);
但是问题并没有解决.
仿真测试过程中,我查看EMR和SER寄存器,SPI1 发送相应的通道位并未置位,所以感觉可能不是这里的问题.
想请问,当link地址设置为0xfffff是,是否能实现我想要的定时发送SPI数据的功能?谢谢