witam!
Chcialem prosic o pomoc osoby bardziej doswiadczone, mianowicie mam problem w tym, ze nie chce mi uklad wejsc w obsluge przerwania od timera1, ktory ma liczyc.
Projekt ma dzilac tak, by po pojawieniu sie zbocza opadajacego ma wejsc w obsluge przerwania, a nei chce tego mi zrobic
oto wycinki programu...:
Chcialem prosic o pomoc osoby bardziej doswiadczone, mianowicie mam problem w tym, ze nie chce mi uklad wejsc w obsluge przerwania od timera1, ktory ma liczyc.
Projekt ma dzilac tak, by po pojawieniu sie zbocza opadajacego ma wejsc w obsluge przerwania, a nei chce tego mi zrobic
oto wycinki programu...:
$lib "glcdks108.lbx"
$crystal = 16000000
$regfile = "m32def.dat"
$include "font8x8.font"
Config Graphlcd = 128 * 64sed , Dataport = Porta , Controlport = Portc , Ce = 7 , Ce2 = 2 , Cd = 3 , Rd = 4 , Reset = 6 , Enable = 5
Disable Adc
Config 1wire = Pind.7
Config Pinb.1 = Input
Config Pind.2 = Input
Config Pinb.6 = Output
Config Timer1 = Counter , Edge = Falling
On Timer1 Pomiar_drogi
Set Portb.1
Set Portd.2
Dim Zmienna As Word
Dim Przycisk As Byte
Dim Droga_setki As Byte
Enable Interrupts
Enable Int0
Enable Timer1
Load Timer1 , 5
Przycisk = 1
Portb.6 = 1
On Int0 Zmien_funkcje
Droga_setki = 0
Cls
Wait 1
Showpic 0 , 17 , Lcd_zuzycie_chwilowe
Showpic 64 , 17 , Lcd_przebyta_droga
do
Setfont Font8x8
If Pinb.1 = 0 Then Incr Zmienna ' to mi dziala bo inkrementuje mi ta zmienna i wyswietla mi ja, ale zmniennej droga_setki nie chce mi inkrementowac.
Lcdat 4 , 15 , Zmienna
Lcdat 4 , 71 , Droga_setki
loop
Pomiar_drogi:
Load Timer1 , 5
Incr Droga_setki
If Droga_setki = 10 Then
Droga_setki = 0
Incr Droga
End If
Do
Loop
Load Timer1 , 5
Return