$regfile = "2313def.dat" $crystal = 4000000 Config Pind.6 = Output Config Timer1 = Counter , Edge = Falling , Prescale = 1 Dim Wtime As Byte Dim Timercounter As Word Dim Overflcounter As Word Dim Totalcounter As Long On Counter1 Uphigh Wtime = 100 Timercounter = 0 Totalcounter = 0 Enable Interrupts Enable Counter1 Do Set Portd.6 Waitms Wtime Reset Portd.6 Waitms Wtime Cls Timercounter = Counter1 Lcd Timercounter ; " " ; Overflcounter Lowerline Totalcounter = Overflcounter Shift Totalcounter , Left , 16 Totalcounter = Totalcounter + Timercounter Lcd "total: " ; Totalcounter Loop Uphigh: Incr Overflcounter Return End