Time measurement between two ISRs, general idea?

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

Moderators: RoccoMarco, lbednarz, tfAteba

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

Time measurement between two ISRs, general idea?

Post by horstman »

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: 14895
Joined: Wed May 27, 2009 8:48 am
Has thanked: 1202 times
Been thanked: 997 times

Re: Time measurement between two ISRs, general idea?

Post by Giovanni »

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?

Post by horstman »

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: 14895
Joined: Wed May 27, 2009 8:48 am
Has thanked: 1202 times
Been thanked: 997 times

Re: Time measurement between two ISRs, general idea?

Post by Giovanni »

Hi,

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

Giovanni
Post Reply