cancel
Showing results for 
Search instead for 
Did you mean: 

input capture mode timer interrupt

Msade.1
Associate

hello everyone

how can I generate an event when timer operates in input capture mode the counter value goes above the ARR register value? 

in my special case I load ARR value to 10000 and CNT register goes ablove ARR value and dosent generate an interrupt "periode elapsed callback" function.

does anyone knos how can I overcome this problem.thanks

3 REPLIES 3

There's no special way to check whether CNT is above ARR - it's the other way round, you must do everything so that this never happens. This is why ARR preload exists, so that the active ARR changes safely when CNT=0.

Or, after changing ARR without preload, check in software if CNT is lower than ARR or not.

JW

Piranha
Chief II

In addition to what Jan said, for some uses a down-counter mode can be used as that mode principally cannot have this issue.

S.Ma
Principal

Most of the time you don't need to care cor the overflow unless measuring multiple overflow periods. Say 16 bit timer capture 0xF000 and afterward 0x1000, 16 bit substract will yield around 0x1000 - 0xF000 = 0x2000