When the first pulse appears, zero a counter (as many bits as needed), then start counting in a software loop, checking the pulse again in the loop. When the next pulse appears stop counting - the counters then hold a representation of the time between pulses.
Because PIC's run so fast, and your pulses are so slow, it's best to use delay routines within the loop.
Here's a pulse measuring routine from my IR tutorial.
The section 'Next' is the part that actually measures the width of the pulse, the first part waits for the trailing edge of the first pulse - because it's measuring the width of the pulse, and not the time between them.
Because PIC's run so fast, and your pulses are so slow, it's best to use delay routines within the loop.
Here's a pulse measuring routine from my IR tutorial.
Code:
Read_Pulse clrf LoX
btfss IR_PORT, IR_In ;wait until high
goto $-1
clrf tmp1
movlw 0xC0 ;delay to decide new keypress
movwf tmp2 ;for keys that need to toggle
Still_High btfss IR_PORT, IR_In ;and wait until goes low
goto Next
incfsz tmp1,f
goto Still_High
incfsz tmp2,f
goto Still_High
bsf Flags2, New ;set New flag if no button pressed
goto Still_High
Next nop
nop
nop
nop
nop ;waste time to scale pulse
nop ;width to 8 bits
nop
nop
nop
nop
nop
nop
incf LoX, f
btfss IR_PORT, IR_In
goto Next ;loop until input high again
The section 'Next' is the part that actually measures the width of the pulse, the first part waits for the trailing edge of the first pulse - because it's measuring the width of the pulse, and not the time between them.