Ok, I understand.
Check this new code. There is very strange things happening in pic work. THis code was compiled and after pushing button and timer iz on, after relay is 1, the portb.2 is on?! and then nothing happens. Second compiling the same code in chip, results different cycle. I was wondering if something is wrong with power or chip ? What is difference betwen 16F84A and 16F628, can I use 628 with same code but compile with this type? Maybe that is the problem.
TRISA = $FF 'Postavi sve pinove porta A kao ulazne
TRISB = $00 'Postavi sve pinove porta B kao izlazne
B0 var byte
i var byte
symbol t1 = porta.1
symbol tajmer = portb.0
symbol rele = porta.0
begin:
gosub petlja
pause 1000
gosub petlja1
pause 1000
gosub petlja2
goto begin
petlja:
pause 100 'vrlo bitna pauza'
while tajmer = 1 and rele = 1
PAUSE 500
tajmer = 0 'iskljuci tajmer'
portb.1 = 0 'ukljuci crvenu diodu veliku'
pause 3000
tajmer = 1
return
wend
petlja1:
pause 100 'vrlo bitna pauza'
while tajmer = 1 and rele = 1
PAUSE 100
tajmer = 0 'iskljuci tajmer'
portb.1 = 1 'ukljuci crvenu diodu veliku'
pause 3000
portb.2 = 0
tajmer = 1
return
wend 'vrlo bitna pauza'
petlja2:
pause 100 'vrlo bitna pauza'
while tajmer = 1 and rele = 1
PAUSE 100
tajmer = 0 'iskljuci tajmer'
portb.1 = 1 'ukljuci crvenu diodu veliku'
pause 3000
portb.2 = 1
portb.3 = 0
return
wend
B0 = 0
button t1,0,255,0,B0,1,ukljucenje 'ako je taster pritisnut idi na ukljucenje'
goto begin
ukljucenje:
tajmer = 1
goto begin
End
Bookmarks