2022-05-29 12:21 AM
2022-05-29 12:33 AM
Timer Input Capture.
JW
2022-05-29 12:45 AM
Can you please refer me to an example?
2022-05-29 02:27 AM
Then, whenever you read TIMx_CCRx, it contains the value of TIMx_CNT which was at the moment of latest input edge on TIMx_CHx pin.
Read Input capture mode subchapter of TIM chapter in RM.
If you'd want not just the last edge but also a "history", you'd need to set up DMA to read out TIMx_CCRx into memory upon each capture event, but that's step 2.
JW
2022-05-30 03:29 AM
What if I need to know exactly the first input edge occurs, than I must use an interrupt driven design right?
2022-05-30 04:01 AM
One could presumably use DMA to capture time-stamps into a ring buffer