Time measurement between two ISRs, general idea?

ChibiOS public support forum for all topics not covered by a specific support forum.

Moderators: barthess, RoccoMarco, utzig, lbednarz, tfAteba

horstman
Posts: 2
Joined: Sun Jan 13, 2019 8:32 pm

Time measurement between two ISRs, general idea?

Postby horstman » Mon Jan 14, 2019 9:00 am

Hello!

I would like to stop the time (in seconds) with a timer between two differents ISRs.
The first ISR should start, the second should stop the timer.
Could You give me a general idea, which approach would be the best for such a problem?

Thank You!
Horst

User avatar
Giovanni
Site Admin
Posts: 11647
Joined: Wed May 27, 2009 8:48 am
Location: Salerno, Italy
Has thanked: 488 times
Been thanked: 409 times
Contact:

Re: Time measurement between two ISRs, general idea?

Postby Giovanni » Mon Jan 14, 2019 10:39 am

Hi,

If you need to measure time then use the TM API (Time Measurement), no need to use timers and it is clock cycle accurate.

Giovanni

horstman
Posts: 2
Joined: Sun Jan 13, 2019 8:32 pm

Re: Time measurement between two ISRs, general idea?

Postby horstman » Thu Jan 17, 2019 5:29 pm

Hello,

all right, I will try that out, thank You!

I wonder if You could help me with another issue. (sorry, I'm still a newbie to ChibiOS...)
I would like to implement/enable external interrupt on a button (+ "ISR"/callback-function) with palSetPadCallbackI()/PAL Driver ..., but I am not quite sure which steps are necessary for this. Would it be possible for You to provide a minimal example for this or to tell me, where I can find one? Or would You rather suggest another, better approach?

Thank You very much!

User avatar
Giovanni
Site Admin
Posts: 11647
Joined: Wed May 27, 2009 8:48 am
Location: Salerno, Italy
Has thanked: 488 times
Been thanked: 409 times
Contact:

Re: Time measurement between two ISRs, general idea?

Postby Giovanni » Thu Jan 17, 2019 5:34 pm

Hi,

In /testhal/STM32/multi/PAL there is the example you need.

Giovanni


Return to “General Support”

Who is online

Users browsing this forum: No registered users and 4 guests