2 Replies Latest reply on Apr 10, 2017 8:03 AM by user_1574446

    Timer Counting Backwards?

      Hi, todat I opened a new project, I wanted to have a timer running free on  my project so I can need to get delta time, the thing is that I start the timer and it it counting backwards?? , how can I fix this?, It can not be a software Error, because I am Only calling Timer_Start(); and Timer_ReadCounter();


      Thanks =)

        • 1. Re: Timer Counting Backwards?

          Welcome in the forum.


          The timer usually counts down to zero from period value. A simple difference (PeriodValue - Counter) will give the counts elapsed.


          Some more information needed: Which PSoC ? Which board (self made, Kit? Which kit).


          When you got stuck, please 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.





          • 2. Re: Timer Counting Backwards?

            Great, this is what I did:


                    uint8_t a = Timer_ReadPeriod();


                    uint8_t b = Timer_ReadCounter();


                    CurrentTime = (a - b);




            Im Using CY8CKIT - 059 , the project is really simple, im just trying to check for Delta time so I can read it at the begin of my loop and then use the same "time" on different functions, I think it was a pretty generic project so i didn't included it, but got it gorking now, thanks Bob 

            1 of 1 people found this helpful