is it possible to start a timer on external input to produce a timer interrupt?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
2018-09-24 12:54 PM
Using only timer peripherals would it be possible to configure an input to start a timer - let the timer run for a set amount of time, and then create a timer interrupt?
- Labels:
-
STM32F4 Series
-
TIM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
2018-09-24 1:10 PM
Yes Set TIMx_SMCR.TS to one of the inputs (TI1FP1 or TI2FP2, coming from CH1 or CH2) and TIMx_SMCR.SMS to Trigger Mode. Set some other channel to output compare, set its compare register to required delay, clear the respective pending interrupt flag in TIMx_SR and enable its respective interrupt in TIMx_DIER (and then of course enable the interrupt in NVIC). Set TIMx_CNT to 0 and don't enable the timer - the trigger will enable.
JW
