2013-07-15 03:26 PM
Hi,
I'm trying to communicate with a smart card using the usart on a STM105RC. I was successful doing that with normal interrupts, and now I'm trying to use the DMA with the USART for better performance. My problem is that I can send the data and get a ''DMA transfer complete interrupt'', but I don't get a ''Usart transfer complete interrupt'' after that. But for a smart card it is very important to catch the USART_TC and not the DMA_TC, because as shown in the reference manual(RM0008, figure 295), the transfer is not terminated on the USART side when the DMA_TC arises and if I start reading data on the usart after DMA_TC I read the data that are being sent (RX connected to TX in smart card mode). Are there some specific actions to take when using smart card mode and DMA on a USART? I tried using DMA with a ''normal'' usart and I'm getting USART_TC interrupts, but that could be caused by the configuration difference between the 2 usarts. I'm using the remapped Usart3 TX, that is DMA1 Channel2. #usart-dma-smart-card-tc2013-07-15 03:59 PM
I'm not aware of any magic for smart card mode, I've just used DMA on the USARTs in regular modes. I'd imagine you'd want to clear the USART TC flag, and then enable the USART TC interrupt from the DMA TC interrupt service.
2013-07-16 11:59 AM