STM32用DMA发送串口数据提前进中断

2019-07-21 01:17发布

我用的是USART2来发送数据,中断使用的是DMA_ITConfig(DMA1_Channel7,DMA_IT_TC,ENABLE);
可是为什么数据还没有发完就进入中断了!我现在是在中断里加一个延时等他发完,这明显不是我想要的!
友情提示: 此问题已得到解决,问题已经关闭,关闭后问题禁止继续编辑,回答。
8条回答
zmsxhy
2019-07-21 06:44
In transmission mode, once the DMA has written all the data to be transmitted (the TCIF flag is set in the
DMA_ISR register), the TC flag can be monitored to make sure that the USART communication is
complete. This is required to avoid corrupting the last transmission before disabling the USART or
entering the Stop mode. The software must wait until TC=1. The TC flag remains cleared during all data
transfers and it is set by hardware at the last frame’s end of transmission。
原来如此,明白了,谢谢大家!

一周热门 更多>