$regfile = "m8def.dat" $crystal = 4000000 Config Portb.1 = Output Config Portb.0 = Input ' CTC-Modus nicht direkt von BASCOM unterstützt, manuelle Einstellung Tccr1a = &B11000000 ' output compare A Tccr1b = &B00011001 ' CTC mode 12, prescaler 1 Portb.0 = 1 ' Pull up für Taster Compare1a = 5 ' Pulsbreite in Takten Do If Pinb.0 = 1 Then Capture1 = 39999 ' 100 Hz Else Capture1 = 17166 ' 233 Hz End If Loop End