See: Nano Every Board - TCB1 timer as I/P Pulse width Measurement Mode from Pin D3/Port PF5 - #12 by bbenji74