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。
原来如此,明白了,谢谢大家!
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。
原来如此,明白了,谢谢大家!
不是时序问题,我如果不使用中断,是可以发完的,因为我在中断里关了通道,所以发送一半就不发了!
void DMA_ITConfig(DMA_Channel_TypeDef* DMAy_Channelx, uint32_t DMA_IT, FunctionalState NewState)
我这是V3.5的版本.....
void DMA1_Channel7_IRQHandler(void)
{
// delay_ms(30);
DMA_ClearFlag(DMA1_FLAG_TC7);
DMA_ClearFlag(DMA1_FLAG_TE7);
DMA_Cmd(DMA1_Channel7,DISABLE);
USART2_RX;
}
加上延时发送数据没有问题,可是去掉延时就只能发一半多出去。TC不是发送完成中断吗?
一周热门 更多>