Millis() arduino function alternatetive for psoc4

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

cross mob
lock attach
Attachments are accessible only for community members.
Anonymous
Not applicable

     Hello,

   

               

   

 I’m trying to figure out how to get delta time in a loop. How can this be done? Should I use a timer? I tried to just have an interrupt fired with known clock frequency but think I have to many interrupts firing and there conflicting?

0 Likes
4 Replies
Anonymous
Not applicable
        Hi What is your delta-time? Is it a interval time of events?   
I think, you would be measure time-span by the Timer   
It is better rather than "interrupt fired with known clock frequency"   
The PSoC/ARM M0 architecture allows Multi-interruptions,   
Good coded interrupts will get work.   
0 Likes
ETRO_SSN583
Level 9
Level 9
250 likes received 100 sign-ins 5 likes given

Just flip a pin at beginning and end of loop, and observe with a scope. Thats typically a low

   

burden instruction.

   

 

   

Regards, Dana.

0 Likes
HeLi_263931
Level 8
Level 8
100 solutions authored 50 solutions authored 25 solutions authored

Or use a free-running counter, and use its capture function.

0 Likes
Anonymous
Not applicable

 you could start a timer at the beggining of the program with an apropiate clock source and leave it running then check its value inside the millis() function

0 Likes