'RECEIVE PIC
'same includes and defines as the other versions
temp var word : tempf var word : count var byte
input portb.2 : pause 1000
loop:
count = count + 1 : lcdout $fe , $c0 , "Waiting......" , DEC3 count
serin portb.2 , t2400 , temp
tempf = temp * 9 : tempf = tempf / 5 : tempf = tempf + 32
lcdout $fe , $80 , "Tc=" , DEC3 temp , "C,Tf=" , DEC3 tempf , "F."
lcdout $fe , $c0 , "Received....." , DEC3 count
goto loop
End
'TRANSMIT PIC
'same includes and defines as the other versions
count var byte : temp var word : output portb.2 : high portb.2
input portb.3 : dq var portb.4 : pause 1000
loop:
lcdout $fe , $c0 , "Getting......" , DEC3 count
owout DQ , 1 , [ $cc ] : owout DQ , 0 , [ $44 ] : Pause 500
owout DQ , 1 , [ $cc ] : owout DQ , 0 , [ $be ]
owin DQ , 0 , [ temp.LOWBYTE , temp.HIGHBYTE , skip 6 ]
lcdout $fe , $80 , "Tc=" , DEC3 temp
lcdout $fe , $c0 , "Sending......" , DEC3 count
serout portb.2 , t2400 , [ temp.lowbyte ]
count = count + 1
goto loop
If it doesn't work, try putting a 'high portb.2' in front of the serout statement.
Bookmarks