5 Replies Latest reply on Aug 1, 2013 5:47 AM by junichi.hiraoka

    UART Sleep on TX completion

    chang.long.zhu.jin

       Hello,

         

      I have a question on how to put the UART to sleep. My set up is an UART with the interrupt pin connected to the 'drq' of a DMA.

         

      At the moment I have configured the UART to indicate the DMA to transmit data from the memory (RAM) to the UART's buffer once the UART has its buffer empty.

         

      Now I want to put the UART to sleep, and what I have thought is using the DMA "nrq" interrupt and read the TX status register of the UART:

         

      if(DMA_UART_flag == 1){

         

                 DMA_UART_flag = 0;

         

                  reg = UART_ReadTxStatus();

         

                  while((reg & UART_TX_STS_COMPLETE) != UART_TX_STS_COMPLETE){

         

                      reg = UART_ReadTxStatus();

         

                  }

         

                  UART_Sleep();

         

      }

         

      However, it remains in the loop... Any idea?

         

      Thank you in advance!