Ive set up 2 16F84A's to talk to eachother via RF using a 433Mhz Trans/Recv pair running at 4800 baud.
My code is below, but something must be wrong becuase the range is a mere 1m. Any further than 1m and it just doesnt work.
Anyone have any ideas on what could be wrong?
These are the data sheets of my RF units:
http://www.altronics.com.au/download...eets/Z6905.pdf
http://www.altronics.com.au/download...eets/Z6900.pdf
Transmitter Code:
Code:
low PORTB.1 ' Initialise RB1
start:
Serout2 PORTB.1,16572,[$55,$55,$66,$95] ' Transmit "$95"
Pause 500 ' Wait
Serout2 PORTB.1,16572,[$55,$55,$66,$99] ' Transmit "$99"
Pause 500 ' Wait
Goto start ' Repeat
End
Reciever Code:
Code:
recvd var word ' variable decrarations
recvd=0 ' clear recvd
low PORTB.0 ' turn off LED
input PORTB.1 ' set RB1 to input
start:
Serin2 PORTB.1,16572,[wait ($66),recvd] ' wait for $66, then store data
if recvd=$95 then High PORTB.0 ' if recvd=1 turn on LED
if recvd=$99 then Low PORTB.0 ' if recvd=2 turn off LED
goto start ' loop
end
Bookmarks