ok
i use 2 pic16f84a.
1 for send variable data. (pic1)
1 for receive the varia ble data.(pic2)
pic1
INCLUDE "modedefs.bas"
DEFINE CHAR_PACING 1000
define osc 4
digit1 var word
digit2 var word
digit1=0
digit2=0
start:
if portb.0=1 then
digit1=digit1+1
end if
if portb.1=1 then
digit2=digit2+1
endif
serout porta.0,n2400, ["OK",digit2,digit1] ' send OK 1st, digit2 2nd and digit1 3rd
goto start
end
pic2
INCLUDE "modedefs.bas"
define osc 4
nilai1 var word
nilai2 var word
nilai1=0
nilai2=0
lcdout $FE,1
lcdout "ready"
start:
serin porta.0,n2400, ["OK"],nilai2,nilai1 ' recieve OK 1st (true),2nd put digit2 to nilai2 and 3rd put digit1 to nilai1
'for see the input value
lcdout $FE,1
lcdout "Nilai"
lcdout $FE,$CO
lcdout DEC3 nilai2,DEC3 nilai1
goto start
end
i hope this help u abit
if u send data( serout) the another must ready to recieve data(serin).
that is very importent




Bookmarks