Timer Counting Backwards?

Tip / Sign in to post questions, reply, level up, and achieve exciting badges. Know more

cross mob
Anonymous
Not applicable

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 😃

0 Likes
1 Solution
Bob_Marlowe
Level 10
Level 10
First like given 50 questions asked 10 questions asked

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.

   

 

   

Bob

View solution in original post

0 Likes
2 Replies
Bob_Marlowe
Level 10
Level 10
First like given 50 questions asked 10 questions asked

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.

   

 

   

Bob

0 Likes
Anonymous
Not applicable

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