Set MARGIN to 4, start pulses with rising edge, disable counter pullup.