- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi everyone,
I have a function which is called in an interruption. I would like define the call of my interruption according to the duration of execution of my function.
Normaly to know simply the duration of execution I set a pin at the begining and clear the pin at the end of the function. I look on a oscilloscope the duration.
But at home I haven't osciloscope. Is there a simply method to know the duration? I have a UART to send data
Thank you
- Labels:
-
PSoC 5LP
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
You could place a timer, start it before the f() call, then
stop and read it after f() return would be one way.
A more exact method is count the code cycles in the ASM listing, .LST file
in the workspace result tab.
Regards, Dana.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Okay thanks but I don't understand something,
if I put a clock of 24MHZ on the timer with a period of 256 (10,667µS) , when I stop the timer in my function,how can I have the time? I will get the counter value of the timer
thank you
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
The timer is a down counter starting at its period value.
When started it starts counting down, and when you stop
it, the value (period - counter value) X input clock period = time
of event.
You could use an up counter, and accomplish the same
thing ithout the subtract math.
Regards, Dana.