Declare Function Lopulse() As Word Dim T As Word Dim Value As Word Dim Time As Word Config Timer0 = Counter , Edge = Falling Cls Config Lcd = 16 * 2 Inputpin Alias Pind.4 Portd.4 = 1 Do If Tcnt0 <> 0 Then Value = Lopulse() : Cls : Lcd ">" ; Value : Wait 2 Loop End Function Lopulse() As Word Tcnt0 = 0 ' reset Time For T = 0 To 10000 Time = Tcnt0 Next Lopulse = Time End Function