Hallo zusammen,
also erstmal hat mich das ein gutes Stück vorangebracht, vielen Dank.
Ich habe mal ein neues Programm geschrieben, und wollte das mit dem Bascom simulator mal testen bevor ich es auf den Controller lade, da ich hierfür auch noch die Hardware umbasteln muss (ICP Pin ist PB0 beim Atmega 
Im Simulator spring er mir allerdings nie in den Interrupt, jetzt weiß ich nicht obs am Simulator liegt, oder ob ich den Controller noch mal speziell Konfigurieren muss für diesen Betrieb.
Hier mal mein Code so weit, vielleicht fällt ja jemandem auf wenn noch was bestimmtes fehlen sollte:
Code:
'---------------------------------------------------------
$sim
$regfile = "m8def.dat"
$crystal = 16000000 'Quarz: 16,000 MHz
'---------------------------------------------------------
Dim Counterstand As Word 'Zählerstand des Counters
Dim Altercounterstand As Word 'Vorheriger Zählerstand
Dim Cntdifferenz As word 'Cnts die zwischen zwei interrupts vergangen sind
Config Pinb.0 = Input
Enable Interrupts
Config Timer1 = Counter , Edge = Falling , Prescale = 1024 , Noise Cancel = 1 , Capture Edge = Falling
'============================================
Do
On Capture1 Puls_kommt
Loop
Puls_kommt:
Altercounterstand = Counterstand
Counterstand = Capture1
Cntdifferenz = Counterstand - Altercounterstand
Print Cntdifferenz
Return
End
Lesezeichen