Witam. Napisałem program do sterowania pompą i na Atmedze8 działa bez problemu a gdy go przerobiłem pod ATtiny25 to nawet nie moge go skompilowac bo wywala jakieś błędy nie wiem jak to uruchomić prosze o pomoc.
przy próbie kompilacji wywala Error 46, Error 31, Error 350
Program dla Atmegi8
Program dla ATtiny25
przy próbie kompilacji wywala Error 46, Error 31, Error 350
Program dla Atmegi8
$regfile = "m8def.dat"
$crystal = 8000000
Config Pinb.2 = Output ' pompa
Config Pinb.1 = Output ' dioda
Config Timer1 = Timer , Prescale = 256
On Timer1 Sekunda
Dim Sekundy As Byte
Dim Minuty As Byte
Enable Interrupts
Enable Timer1
Counter1 = 34286
Set Portb.2
Set Portb.1
Do
If Minuty = 0 Then
Gosub Pompastart
Elseif Minuty = 3 Then
Gosub Pompastop
Elseif Minuty = 30 Then
Gosub Pompastart
Elseif Minuty = 33 Then
Gosub Pompastop
End If
Loop
Sekunda:
Toggle Portb.1
Counter1 = Counter1 + 34286
Incr Sekundy
If Sekundy = 60 Then
Sekundy = 0
Incr Minuty
If Minuty = 60 Then
Minuty = 0
End If
End If
Return
Pompastart:
Portb.2 = 0
Return
Pompastop:
Portb.2 = 1
Return
Program dla ATtiny25
$regfile = "ATtiny25.dat"
$crystal = 8000000
Config Pinb.2 = Output ' pompa
Config Pinb.1 = Output ' dioda
Config Timer1 = Timer , Prescale = 256
On Timer1 Sekunda
Dim Sekundy As Byte
Dim Minuty As Byte
Enable Interrupts
Enable Timer1
Counter1 = 34286
Set Portb.2
Set Portb.1
Do
If Minuty = 0 Then
Gosub Pompastart
Elseif Minuty = 3 Then
Gosub Pompastop
Elseif Minuty = 30 Then
Gosub Pompastart
Elseif Minuty = 33 Then
Gosub Pompastop
End If
Loop
Sekunda:
Toggle Portb.1
Counter1 = Counter1 + 34286
Incr Sekundy
If Sekundy = 60 Then
Sekundy = 0
Incr Minuty
If Minuty = 60 Then
Minuty = 0
End If
End If
Return
Pompastart:
Portb.2 = 0
Return
Pompastop:
Portb.2 = 1
Return
