InputCapture Interrupts

ChibiOS public support forum for topics related to the STMicroelectronics STM32 family of micro-controllers.

Moderator: RoccoMarco

Post Reply
nikhilvr
Posts: 10
Joined: Wed Oct 22, 2014 5:18 am

InputCapture Interrupts

Post by nikhilvr »

Dear Giovanni,

I need to use four input capture module for Timer2, the hardware is developed like that.
Currently chibios input capture interrupts support 2 channels for a timer but I have to use four.
So I used STM32 standard library interrupts for input capture alone.
Now I get hardfault error which happens after exiting input capture interrupt.

Can I use chibios alongside STM32 standard library interrupts.

Please advice.
User avatar
Giovanni
Site Admin
Posts: 14892
Joined: Wed May 27, 2009 8:48 am
Has thanked: 1202 times
Been thanked: 996 times

Re: InputCapture Interrupts

Post by Giovanni »

Hi,

Yes, you can use the library with ChibiOS, you need to pay attention to the interrupt handlers, you must write them using the ChibiOS macros. If the library provides you an interrupt handler then call it from within a ChibiOS ISR: IRQ--->ChibiOS ISR--->Library ISR.

Giovanni
mobyfab
Posts: 484
Joined: Sat Nov 19, 2011 6:47 pm
Has thanked: 21 times
Been thanked: 31 times

Re: InputCapture Interrupts

Post by mobyfab »

You can try to use the timcap driver in the drivers collection.

https://github.com/ChibiOS/ChibiOS-Drivers

Works will all 4 channels.
nikhilvr
Posts: 10
Joined: Wed Oct 22, 2014 5:18 am

Re: InputCapture Interrupts

Post by nikhilvr »

Thanks Giovanni.I will do as you mentioned.

@mobyfab, Thanks. I am still using V2.6.1 but the driver you pointed out is for V3.0
Shall I shift to V3.0?
User avatar
Giovanni
Site Admin
Posts: 14892
Joined: Wed May 27, 2009 8:48 am
Has thanked: 1202 times
Been thanked: 996 times

Re: InputCapture Interrupts

Post by Giovanni »

Moving to 3.0 is generally a good idea. 2.6.x will be maintained for at least 2 years but only for bug fixes, 3.0 will have all the new developments.

Giovanni
mobyfab
Posts: 484
Joined: Sat Nov 19, 2011 6:47 pm
Has thanked: 21 times
Been thanked: 31 times

Re: InputCapture Interrupts

Post by mobyfab »

There is a 2.6 branch in the repo. (not as up to date, but with a working timcap driver)

You should consider upgrading to 3.0.
Post Reply