4 Replies Latest reply on Feb 27, 2020 3:43 AM by BaM_4291296

    Read timer value

    BaM_4291296

      Hello,

       

      I am doing project on the time, it should detect the on time and off time and that time should be displayed on monitor via UART. I have made use of the cyble- 01-201100 and i have made use of the timer module as a timer/counter and i tried to fetch the time using Timer_ReadCapture(), but it always shows the 65535(period/compare max values) constant but i need to find the on time and off time. Please help me to solve the problem.

       

      Thanks,

      Basavaraj

        • 1. Re: Read timer value
          GaneshD_41

          Hi Basavaraj,

           

          Can you please elaborate more? Please tell us what is exactly the On time and OFF time you want to measure?

           

          Some hints:

           

          1. If you are using DeepSleep in your application, you can use WatchDogTimer to measure the times.

          2. If you are not using Deep Sleep, you can use any of the timers TCPWM Timer/WatchDog timer/Systick timer to measure the times.

           

          If you are using TCPWM timer, you can run the Timer in continuous mode and set the interrupt for terminal count and increment the variable inside Timer component isr.

           

          Please refer code examples for Timer interrupt CE220169 TCPWM periodic interrupt in PSoC Creator.

           

          Thanks and regards

          Ganesh

          • 2. Re: Read timer value
            BaM_4291296

            Hello Ganesh,

             

            I want to measure the capacitance charging and dis-charging time so that's why i need to detect the on time and off time in my timer

            • 3. Re: Read timer value
              AashitaR_11

              Hi,

               

              Can you please give more details of your implementation(if possible, kindly share the block diagram)?

               

              Also, Can you please let us know when is Timer_ReadCapture being called?

              This will help us to have a clearer view of the issue you are facing.

               

              Thanks and Regards,

              Aashita

              • 4. Re: Read timer value
                BaM_4291296

                Hello,

                 

                Here is the complete program please do check it.