This codes works pretty well for upp to 50 meter if the antenna of the recviver is not moving and it uses True mode and SERIN/SEROUT and it does´t work with Inverted mode????
If i´m in the range of 30 meters it does´t miss any numbers or loos the value in the variable "Check".
Why does the the Serin2 and Serout2 thats used in the BS2 sampel for these 2 modules don´t work at all.
Are you living in a city area?
No.
If not, it is possible that there is another transmitter within 500m?
I don´t think so but you never know.
Do you have an oscilloscope?
Yes at work, but not here at home.
I´m going to test later whit a wire direkt to the PIC.
Maybe this modules does´t work better and this?
What is the diffrens for the LINX modules to be driven by Inverted mode or True mode?
inverted mode (as in the BS2 from Parallax sampel) shold be the best for these modules, or?
Code:
<html>
<head></head>
<body><!--StartFragment--><pre><code><font color="#008000"><i>'****************************************************************
'* Name : Transmitter.BAS *
'* Author : Fredrick *
'* Notice : Copyright (c) 2008 *
'* : All Rights Reserved *
'* Date : 2008-02-13 *
'* Version : 2008-02-16 *
'* Notes : PIC16F628A @ 4MHz INTORC *
'* : Använder INTORC BIT 4 1-0 FOSC 2 - FOSC0 = 1 0 0 *
'* : TransmitterPIN = PORTB.4 *
'* : LEDpin = PORTB.0 *
'****************************************************************
</i></font>CMCON = <font color="#808080">7 </font><font color="#008000"><i>'Alla I/O Digitala
</i></font>LEDPin <font color="#000080">VAR </font>PORTB.<font color="#808080">0
</font>TransmitterPIN <font color="#000080">VAR </font>PORTB.<font color="#808080">4
</font><font color="#000080">INCLUDE </font><font color="#FF0000">"modedefs.bas"
</font>Check <font color="#000080">VAR BYTE
</font>Counter <font color="#000080">VAR BYTE
CLEAR
</font>Check = <font color="#808080">254
</font>Main:
<font color="#000080">HIGH </font>LEDPin
<font color="#000080">SEROUT </font>TransmitterPIN,T2400,[<font color="#808080">$55</font>,<font color="#808080">$55</font>,<font color="#808080">$55</font>,<font color="#808080">63519</font>,Counter,Check]
<font color="#008000"><i>'PULSOUT TransmitterPIN, 1200
'SEROUT2 TransmitterPIN, 16468, ["!", Counter.HIGHBYTE, Counter.LOWBYTE]
</i></font><font color="#000080">LOW </font>LEDPin
Counter = Counter + <font color="#808080">1
</font><font color="#000080">PAUSE </font><font color="#808080">100
</font><font color="#000080">GOTO </font>Main
<font color="#000080">END
</font></code></pre><!--EndFragment--></body>
</html>
Code:
<html>
<head></head>
<body><!--StartFragment--><pre><code><font color="#008000"><i>'****************************************************************
'* Name : Reciver.BAS *
'* Author : Fredrick *
'* Notice : Copyright (c) 2008 *
'* : All Rights Reserved *
'* Date : 2008-02-13 *
'* Version : 2008-02-15 *
'* Notes : PIC16F872 @ 20 MHz *
'* * *
'* *
'****************************************************************
</i></font>ADCON1 = <font color="#808080">7 </font><font color="#008000"><i>' Alla digitala
</i></font><font color="#000080">DEFINE </font>OSC <font color="#808080">20
</font><font color="#000080">DEFINE </font>LCD_COMMANDUS <font color="#808080">3000 </font><font color="#008000"><i>'Set command delay time in us
</i></font><font color="#000080">DEFINE </font>LCD_DATAUS <font color="#808080">200 </font><font color="#008000"><i>'Set data delay time in us
</i></font><font color="#000080">DEFINE </font>DEBUG_BAUD <font color="#808080">2400
</font><font color="#000080">DEFINE </font>DEBUG_MODE <font color="#808080">0
</font><font color="#000080">DEFINE </font>DEBUG_REG PORTC
<font color="#000080">DEFINE </font>DEBUG_BIT <font color="#808080">7 </font><font color="#008000"><i>'PORTC.7 OLIMEX RS232Board
</i></font><font color="#000080">INCLUDE </font><font color="#FF0000">"modedefs.bas"
</font>ReciverPIN <font color="#000080">VAR </font>PORTC.<font color="#808080">0
</font>Check <font color="#000080">VAR BYTE
</font>Counter <font color="#000080">VAR BYTE
CLEAR
PAUSE </font><font color="#808080">500
</font>Main:
<font color="#000080">SERIN </font>ReciverPIN,T2400,<font color="#808080">500</font>,NoSignal,[<font color="#808080">63519</font>],Counter,Check
<font color="#008000"><i>'SERIN2 reciverpin, 16468, [WAIT("!"), Counter.HIGHBYTE, Counter.LOWBYTE]
</i></font><font color="#000080">IF </font>Check = <font color="#808080">254 </font><font color="#000080">THEN
GOSUB </font>LCD
<font color="#000080">ELSE
GOSUB </font>NoSignal
<font color="#000080">ENDIF
GOTO </font>Main
LCD:
<font color="#000080">LCDOUT </font><font color="#808080">$FE</font>,<font color="#808080">1
</font><font color="#000080">LCDOUT </font><font color="#808080">$FE</font>,<font color="#808080">$80</font>, #Counter
<font color="#000080">DEBUG </font>#Counter, <font color="#808080">13</font>,<font color="#808080">10
</font><font color="#000080">PAUSE </font><font color="#808080">50
</font><font color="#000080">GOTO </font>Main
NoSignal:
Check = <font color="#808080">0
</font><font color="#000080">LCDOUT </font><font color="#808080">$FE</font>,<font color="#808080">1
</font><font color="#000080">LCDOUT </font><font color="#808080">$FE</font>,<font color="#808080">$80</font>, <font color="#FF0000">"No signal!"
</font><font color="#000080">DEBUG </font><font color="#FF0000">"No signal!"</font>, <font color="#808080">13</font>,<font color="#808080">10
</font><font color="#000080">GOTO </font>Main
<font color="#000080">END
</font></code></pre><!--EndFragment--></body>
</html>
Bookmarks