Good day All
I am playing around with RF and just want to send something from one PIC to another.
I'm using the Radiometrix RX2 (RX2-433-160-5V) and TX2 (TX2-433-160-5V) (http://www.radiometrix.com/html/products/emc.html) on a standard bread board.
It only works about every 30th time I test it.
Do anyone have an idea why this is happening?
Attached is the Schematics, Photos and Below the Source.
<hr>
<code>
'************************************************* ***************
'* Name : Transmit.bas *
'************************************************* ***************
Include "modedefs.bas"
DEFINE OSC 4 ' Set the Xtal frequency
SerialOutPin VAR PORTC.2 ' Serial Out
LEDPin Var PORTC.3
DEFINE CHAR_PACING 1000
ADCON1 = 7
Main:
PAUSE 5000
Serout SerialOutPin, N2400, ["go"] ' Send Data
HIGH LEDPin
Pause 1000
LOW LEDPin
PAUSE 1000
END
</code>
<hr>
<code>
'************************************************* ***************
'* Name : Receiver.bas *
'************************************************* ***************
Include "modedefs.bas"
DEFINE OSC 4 ' Set the Xtal frequency
SerialInPin VAR PORTC.2 ' Serial Out
LEDPin Var PORTC.3
DATAReceived VAR Byte
I VAR BYTE
ADCON1 = 7
Main:
HIGH LEDPin
Pause 5000
Low LEDPin
Loop:
Serin SerialInPin, N2400, 1000, Loop, ["g"], DATAReceived
If (DATAReceived = "o") Then
for I = 1 to 10
HIGH LEDPin
Pause 100
LOW LEDPin
PAUSE 100
next I
ENDIF
NOTFound:
Goto LOOP
END
</code>
Bookmarks