zamierzeniem programu, jest możliwość wyłączenia działania programu w dowolnym momencie przez naciśnięcie przycisku na porcie D2. Jest to mój pierwszy program z użyciem TIMER0 i nie wiem gdzie jest błąd, program po wgraniu do atmega8 kompletnie nie działa, tzn nawet dioda się nie zaświeci. Może mi ktoś wytłumaczyć o co chodzi z tym TIMER0?
$regfile = "m8def.dat"
$crystal = 1000000
Config Portb = Output
Portb = &B00000000
Config Portd = Input
Portd = &B11111111
Config Timer0 = Timer , Prescale = 256
Enable Interrupts
Enable Timer0
On Timer0 Co_25ms
Do
Pr:
Debounce Portd.0 , 0 , Pr_1
Debounce Portd.1 , 0 , Pr_2
Loop
Pr_1:
Portb.1 = 1
Wait 1
Portb.5 = 0
Return
Pr_2:
Portb.4 = 1
Wait 2
Portb.4 = 0
Return
Co_25ms:
If Portd.2 = 0 Then
Waitms 25
If Portd.2 = 0 Then Gosub Pr_stop
End If
Pr_stop:
Portb.5 = 0
Portb.4 = 0
Goto Pr
Return
