Measuring pulse shorter than 1 microsecond

Author Message

Joined: 09/05/2014
Location: Australia
Posts: 12
Posted: 04:46am 07 Sep 2022      

My erudite colleagues,
I wish to measure a period of less than 1 uS  ,   every 100 mS.

Since mmbasic  has PULSIN with a resolution of 1 uS, it wont do.
The classic way is to measure  the number of clock cycles (ie from 40 MHz clock) that are counted between  when a gate is opened and closed, which would give 40 counts for a one uS pulse. These can be averaged

Are there any Csubs that can access the CPU clock, count the number of clock cycles that occur within  a digital pulse of duration say 0.1 uS   ( 100 nS)  on say PIN(4)?

Am using the 28 pin PIC32MX170F 256, but can upgrade, but prefer the single chip route for embedded control application