add interrupt functions to Tim