a way to use millies() from arduino in Psoc??

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

cross mob
Switten
Level 2
Level 2
25 sign-ins 10 likes given 10 sign-ins

Hello,


For a project I am trying to make, I need to know the elapsed time between each cycle(so that i can subtract these) . I know that in arduino you can use the millies() functionfor , but I didn't find anything like that in the creator. I am aware of the exsistence Odissey's implementation using a stopwatch, but I wonder if there is a easier way to do this.


thanks for replying

0 Likes
1 Solution
MotooTanaka
Level 9
Level 9
Distributor - Marubun (Japan)
First comment on blog Beta tester First comment on KBA
6 Replies
Raj_C
Moderator
Moderator
Moderator
250 solutions authored 500 replies posted 50 likes received

Hi @Switten,

You can refer to the thread 'Measuring time interval using SysTick (CY8CKIT-059/CY8CKIT-044)' by MotooTanaka. 

Let me know if you need further help with this.

 

Thank you

Best Regards

Raj Chaudhari

Switten
Level 2
Level 2
25 sign-ins 10 likes given 10 sign-ins

Thank you verry much @Raj_C 

But wanted to know was the duration of 1 cycle when running the code without any external HW involved. The reason for this is because I am reading the data from an MPU 6050 and I want to know to current angle the device is positioned in.

I used  Sam's blog  as reference for my code but he never completed it. And because I am still a beginner when it comes to programming I am not capable to adjust the program you suggested to run without the input button.

But thx for replying

0 Likes

Switten,

Raj's suggestion of using the systick resources in the PSoC is very simple and requires NO external components.

Odissey1's stopwatch, example uses internal PSoC timers to provide even more accuracy.  Again no external components to be added.

Len
"Engineering is an Art. The Art of Compromise."
0 Likes

I think there was a misunderstanding. What it meant by external components was the button (on pin 2.2) that starts/clears the interupt.

It it possible to do this without the need of the button input? (so that I can compare the elapsed time between the data read from the mpu6050)

0 Likes
MotooTanaka
Level 9
Level 9
Distributor - Marubun (Japan)
First comment on blog Beta tester First comment on KBA

Hi,

I have just posted the following sample.

https://community.infineon.com/t5/Code-Examples/A-sample-of-emulating-millis-from-arduino-in-PSoC-CY...

 

Can this be it? 😉

 

moto

@MotooTanaka at first glance it looks like this is what I needed.

Thank you very much for your help and for replying  😆😊