I'm trying to make an IR receiver to learn raw IR codes from remotes (at least ones that operate at the 38kHz the IR receiver module I use can recognize). I'm trying to operate at interrupt level for all this so my main loop can concentrate on other things, and I already have working code that recognizes the mark/space transitions and records the duration, but since nothing really indicates the end of a sequence, I was thinking my interrupt routine could start (or restart) a timer each time it sees the start of a space and if enough time passes, get a timer interrupt to signal the end of the IR sequence. I'd hope I could reset the timer when I see each space so I get one and only one interrupt and it really means I've seen the time gap at the end of the IR sequence. Just wanted to ask if it is feasible to manipulate timer registers from inside an interrupt routine like this (accessing timers isn't too slow, for instance) before I go off and start studying up on timer registers.
I suppose I'd want to do something similar when I start sending the learned codes, use one timer for the PWM modulation and another timer to control the duration of each raw mark and space so my IR sending code could also operate entirely at interrupt level.