I'm experimenting with TCNT1 to a detect the sync gap of a RC receiver signal (sum or PPM signal)
The sync gap is longer than 4 ms.
TCNT1 in mode 15: counting up to OCR1A (set to 8000 = 4 ms), then an interrupt is set and the counter starts at 0 again.
Every time a pulse comes in, I reset TCNT1 to 1, to postpone the interrupt. When pulses are not detected for more than 4 ms, an interrupt is issued and I know that the sync gap is arrived.
The problem seems that once the TCNT1 is reset to 1, the counter does count up from 1, but it does not interrupt at 8000 anymore and it does not wrap around at 8000.
When I do not reset TCNT1, and have it timed out, interrupts are issued, and the counter wraps around at 8000.
Does writing to TCNT1 change other registers as well?