Hi, Pictron

So, THE correct answer you want is located in 3.04 manual ...see PULSIN, RCTIME and COUNT functions.
But 20 Mhz +/- 1Hz is a bit funny, then ...

Remember PicBasic uses "only" 16 bits ...

read you next time.
Alain