4 Replies Latest reply on Nov 4, 2014 5:42 AM by user_14586677

    UART malfunctioning after sleep

    anuradha.nanayakkara

       Hello,

         

      In my application I am having an UART and it malfunctions, seems data get abuse after the system wakes up from sleep.

         

      I am setting the UART to sleep before getting the device to Sleep mode and let it wake up after PSoC gets up from sleep and when UART communication is needed. Can somebody kindly advice on where I am doing wrong?

         

       

         

      Thnaks in advance.

         

      Anuradha

        • 1. Re: UART malfunctioning after sleep
          user_1377889

          There are some calls for the clocks before and after sleep-mode, did you use them, too?

             

          Can you post your complete project, so that we all can have a look at all of your settings? To do so, use
          Creator->File->Create Workspace Bundle (minimal)
          and attach the resulting file (do NOT use chrome, that still may not work).

             

           

             

          Bob
           

          • 2. Re: UART malfunctioning after sleep
            anuradha.nanayakkara

            Dear Bob,

               

            Thanks for replying.

               

            The basic steps am following are as follows.

               

            Source file attached for clarity.

               

            ////////////////////////////////////////////////////////////////////////////

               

            /* ========================================
             *
             * Copyright YOUR COMPANY, THE YEAR
             * All Rights Reserved
             * UNPUBLISHED, LICENSED SOFTWARE.
             *
             * CONFIDENTIAL AND PROPRIETARY INFORMATION
             * WHICH IS THE PROPERTY OF your company.
             *
             * ========================================
            */
            int main()
            {
             /* Place your initialization/startup code here (e.g. MyInst_Start()) */
                int r1;
            // Timer1_ISR_Start();
            // Timer_1_Start();
               
              
             
             UART_1_Start(); // Initializes and enable UART
             
                CyGlobalIntEnable; // Enable global interrupts.
              
             
                for(;;)
                {
                 /* Place your application code here. */
             

               

                    UART_1_Sleep();
                  
                    CyPmSaveClocks();

               

                   
               Pin_LED_Write(0);
                    CyPmSleep(PM_SLEEP_TIME_CTW_4MS, PM_SLEEP_SRC_CTW);
                    CyPmReadStatus(CY_PM_CTW_INT);

               

                    Pin_LED_Write(1);

               

                    CyPmRestoreClocks();
                   
                    UART_1_Wakeup();
             
                    SendPackets(); // sends data packets on USART

               

              CyDelay(10); // 100 sps needed 10 ms delay
                }
            }

               

            //////////////////////////////////////////////////////////////////////////////////////////////////////////

               

            Thanks.
            -Anuradha

            • 3. Re: UART malfunctioning after sleep
              hima

               Hi Anuradha,

                 

               

                 

              Please let us know if your issues are resolved. If not please attach the complete project. I would like to know what is done inside the function SendPackets().

                 

               

                 

              Cheers,

                 

              Hima

              • 4. Re: UART malfunctioning after sleep
                user_14586677

                @HIMA, do you think the original poster is still watching this

                   

                thread after 4 months of no response ?

                   

                 

                   

                Regards, Dana.