PDA

View Full Version : RF Transmitter/Reciver



Fredrick
- 9th February 2008, 16:56
Have anyone here used Parallax RF transmitter and reciver?
Does it work well?

I lookīs like there is no problem to use those with PBP! or??

The manual says upp to 150 meters, is that true or is the actual distans shorter?

http://www.parallax.com/Store/Accessories/Communication/tabid/161/CategoryID/36/List/0/Level/a/ProductID/111/Default.aspx?SortField=ProductName%2cProductName

mackrackit
- 9th February 2008, 22:20
IF you are going to use this type of RF, buy them here:
http://www.rentron.com/PicBasic/RemoteControl.htm
They work very well and the range is as advertised.

Bruce at rentron is one of the major contributors to this forum.

Fredrick
- 9th February 2008, 22:34
Canīt find the parallax RF moduls on www.renton.com...

mackrackit
- 9th February 2008, 22:39
On the left side of the screen in the link I gave. They are not parallax, but are made with the same Linx module.

Fredrick
- 10th February 2008, 14:16
Can i use one transmitter to send the temperature from an DS18S20 to 3 recivers?

mackrackit
- 10th February 2008, 14:40
Yep, as long as they are all the same frequency.

Fredrick
- 10th February 2008, 17:19
Whats the diffrents between 315MHz, 418MHz, 433MHz modul? Only the MHz or has it to do whit other things?

To write a program to those modules i use SEROUT and just send a text and recive it whit SERIN?

Acetronics2
- 10th February 2008, 17:21
Hi,

The answer is quite simple :

Some frequencies are allowed in your country ... and some not.

Think to verify it before buying ...

Alain

Fredrick
- 10th February 2008, 17:24
Ok, my remote controll to my car is 433MHz so i asume that that is what i should buy.

mackrackit
- 10th February 2008, 17:26
The frequency is the only difference.

Here is a thread with some sample code
http://www.picbasic.co.uk/forum/showthread.php?p=50584#post50584

dhouston
- 10th February 2008, 19:41
The frequency and the allowed output power differ depending on the region or country. Europe uses 433.92MHz and allows far more power than is allowed in N. America.

Fredrick
- 10th February 2008, 19:53
Have just placed an order for 2 433.9 MHz transmitters and 2 recivers..

The parallax manual says upp to 500+ feets and LINX says upp to 3000 Feets, what is the actul range?
Can i make parallax 433.9 MHz transmitter to send whit more power?

Fredrick
- 10th February 2008, 23:43
Have looked at the datasheet for the TXM-433-LR and find an intressting point.


USING LADJ
The Level Adjust (LADJ) line allows the transmitter’s output power to be easily
adjusted for range control, lower power consumption, or to meet legal
requirements. This is done by placing a resistor between VCC and LADJ. The
value of the resistor determines the output power level. When LADJ is connected
to VCC, the output power and current consumption will be at its maximum. Figure
4 on Page 3 shows a graph of the output power vs. LADJ resistance.
This line is very useful during FCC testing to compensate for antenna gain or
other product-specific issues that may cause the output power to exceed legal
limits. A variable resistor can be temporarily used so that the test lab can
precisely adjust the output power to the maximum level allowed by law. The
variable resistor’s value can be noted and a fixed resistor substituted for final
testing. Even in designs where attenuation is not anticipated, it is a good idea to
place a resistor pad connected to LADJ and VCC so that it can be used if needed.
For more sophisticated designs, LADJ can be also controlled by a DAC or digital
potentiometer to allow precise and digitally variable output power control.

Itīs look like i can easy modifie my RF module to work whit the range of 3000 feet or (900 meters) by removing or replace the resitor R5 (se Picture), and i think itīs still legal i sweden to transmit at this ranges on the private 433.92 MHz band.

http://www.parallax.com/Portals/0/Images/Prod/2/279/27980-L.jpg

mackrackit
- 11th February 2008, 00:25
As others have said check your local laws.

You are reading the data sheet, did you see the part about 3 volts. Do not make the mistake of using 5 volts like you normally would with a PIC.

Fredrick
- 11th February 2008, 00:58
As others have said check your local laws.

You are reading the data sheet, did you see the part about 3 volts. Do not make the mistake of using 5 volts like you normally would with a PIC.


The Typical voltage for the LINX module is 3 volts and the parallax module need 5 volts so i assume that there is an voltage regulator on board.

So if i measure the voltage between GND and infront of the resistor R5 and have 3 volts it shold not be an problem to just bypass the restistor to get maximun power or?

I just check the local law and there is no problem to run at maximun power on the 433.92 MHz band.

dhouston
- 11th February 2008, 01:03
The legal limits are on the radiated power not distance. Distance is heavily influenced by environment. It's impossible to say whether you are within the legal limits without some sophisticated and expensive test equipment. The tests required by the FCC for the USA cost about $US3000.

You can see the limits here...http://www.radiometrix.co.uk/apps/apnt102.htm
Of course, whether the authorities will catch you and punish you if you exceed the limits is another matter.

Fredrick
- 11th February 2008, 01:10
The legal limits are on the radiated power not distance. Distance is heavily influenced by environment. It's impossible to say whether you are within the legal limits without some sophisticated and expensive test equipment. The tests required by the FCC for the USA cost about $US3000.

You can see the limits here...http://www.radiometrix.co.uk/apps/apnt102.htm
Of course, whether the authorities will catch you and punish you if you exceed the limits is another matter.

Ok... but in teori (legel or not) i only have to bypass or change the resistor R5 to another value.... or?

In the doc i find the limit is Max 25 mW in sweden not 10mW.
http://www.scanner.nu/pdf/riks.pdf (itīs i swedish)

mackrackit
- 11th February 2008, 01:49
Ok... but in teori (legel or not) i only have to bypass or change the resistor R5 to another value.... or?

In the doc i find the limit is Max 25 mW in sweden not 10mW.
http://www.scanner.nu/pdf/riks.pdf (itīs i swedish)

If R5 is connected to LADJ then you may be right. Just remember the max voltage of 3 any place on the LINX.

Another way to get maximum distance from any radio is to use a good antenna. I doubt the , as we call them here "duckie" that is on the Parallax is very good. Most duckies are not very good for for distance.

A quarter wave with ground plane or a half wave will work the best for distance at any power.

I think dhouston has antenna info on his web site. Or google for a ham radio site for more info. The antenna is half of the radio in terms of performance.

dhouston
- 11th February 2008, 12:20
I've never used the Parallax receiver and transmitter so there may be reasons why the things I've learned with the simpler (and order of magnitude cheaper) TWS transmitters and receivers may not all be applicable.

From the LADJ excerpt that was quoted, shorting the resistor so that Vcc is applied to LADJ will give maximum output power from the transmitter.

The distance above the ground will also have a big effect on range. Reflections/refractions from the ground, buildings, trees, etc. degrade the signal. Most of the range estimates that accompany these devices are outdoor, line-of-sight figures. Indoors, my rule of thumb estimate is 20-25% of the outdoor figure.

An efficient, directional antenna (e.g. a yagi) on both the transmitter and receiver can give you large increases in range by concentrating the power in one direction rather than spreading it equally in all directions. The stubby antennas on the Parallax modules are not very efficient and are omni-directional. There are some yagi antennas for this frequency that are printed on circuit boards (or even mylar). Here's an example...http://www.wa5vjb.com/products1.htmlA wideband preamp between antenna and receiver can also give a big increase in range but this may not work with all receiver designs. In some cases, the increased signal can overwhelm a receiver but I've used them successfully with the TWS receivers and have even tested with 2-3 of them cascaded. This has one major advantage - it does not violate any of the legal limits on transmitted power levels.

Fredrick
- 11th February 2008, 16:36
Ok thanx for the information.

I agree that Parallax is expensive but i need the LINX module on an PCB becouse i donīt have the things needed to make my on PCBīs.

mackrackit
- 11th February 2008, 18:01
Ok thanx for the information.

I agree that Parallax is expensive but i need the LINX module on an PCB becouse i donīt have the things needed to make my on PCBīs.

http://www.rentron.com/remote_control/TXLC-XXX-LR.htm

Fredrick
- 11th February 2008, 18:04
Yes i have lookt at Rentron but 2 transmitter and 2 recivers + 2 anntena coast $111 and at parallax $109,95 with antenna.

mackrackit
- 11th February 2008, 18:43
Yes i have lookt at Rentron but 2 transmitter and 2 recivers + 2 anntena coast $111 and at parallax $109,95 with antenna.

OK, but the antennas from parallax do not look very good (very short ), the ones from rentron are 1/4 wave.

As I said before, the antenna will make all the difference for long range.

Let us know how it goes.

Fredrick
- 11th February 2008, 18:54
Yes i will inform how it goes, and maybe i will come with some questions on the PBP program for the recivers and transmitter. ;)

Fredrick
- 14th February 2008, 07:10
Are the Linx RF modules FM och AM?
Canīt find anything in the datasheet?

mackrackit
- 14th February 2008, 07:54
Neither, More like CM.
From the data sheet


When a logic ‘1’ is present on the DATA line and the PDN line is high, then the
Power Amplifier (PA) will be activated and the carrier frequency will be sent to
the antenna port. When a logic ‘0’ is present on the DATA line or the PDN line is
low, the PA is deactivated and the carrier is fully suppressed.

So, the only thing they can transmit is bits, think of Morse Code. ON OFF
That is why they work so well for serial communications.
Also, that is the reason for sending a "train" signal (010101010101) allows the receiver to balance the internal capacitor before receiving the real data.

I think the correct way of saying it is Carrier Present - Carrier Absent

dhouston
- 14th February 2008, 11:26
I think the correct way of saying it is Carrier Present - Carrier Absent
Or OOK (On-Off Keying), ASK (Amplitude Shift Keying) or AM (Amplitude Modulation). And FSK (Frequency Shift Keying) works much better but costs much more.

Fredrick
- 14th February 2008, 19:45
Thank you.

Now i have recived the Parallax RF modules and write this test programs

Transmitter PIC16F628A whit Internal RC OSC at 4 MHz


<html>
<head></head>
<body><!--StartFragment--><pre><code><font color="#008000"><i>
</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">&quot;modedefs.bas&quot;
</font>Counter <font color="#000080">VAR BYTE
</font>Synk <font color="#000080">VAR BYTE
</font>Synk = <font color="#808080">$55
</font><font color="#000080">DEFINE </font>CHAR_PACING <font color="#808080">1000
</font>Counter = <font color="#808080">0

</font>Main:
<font color="#000080">HIGH </font>LEDPin
<font color="#000080">PAUSE </font><font color="#808080">100
</font><font color="#000080">LOW </font>LEDPin
<font color="#000080">PAUSE </font><font color="#808080">100

</font><font color="#000080">SEROUT </font>TransmitterPIN,T1200,[Synk,Synk,Synk,Synk,Synk,Synk,<font color="#808080">9</font>,Counter]

<font color="#000080">HIGH </font>LEDPin
<font color="#000080">PAUSE </font><font color="#808080">100
</font><font color="#000080">LOW </font>LEDPin
<font color="#000080">PAUSE </font><font color="#808080">100

</font>Counter = Counter + <font color="#808080">1
</font><font color="#000080">PAUSE </font><font color="#808080">600
</font><font color="#000080">GOTO </font>Main
<font color="#000080">END


</font></code></pre><!--EndFragment--></body>
</html>


Reciver PIC16F872 with 20 MHz OSC


<html>
<head></head>
<body><!--StartFragment--><pre><code><font color="#008000"><i>
</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">INCLUDE </font><font color="#FF0000">&quot;modedefs.bas&quot;
</font>Counter <font color="#000080">VAR WORD
</font>ReciverPIN <font color="#000080">VAR </font>PORTC.<font color="#808080">0
</font>ADCON1 = <font color="#808080">7 </font><font color="#008000"><i>' Alla digitala
</i></font><font color="#000080">PAUSE </font><font color="#808080">500

</font>Main:
<font color="#000080">SERIN </font>ReciverPIN,T1200,[<font color="#808080">9</font>],Counter
<font color="#000080">GOSUB </font>LCD
<font color="#000080">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">PAUSE </font><font color="#808080">500
</font><font color="#000080">RETURN

END
</font></code></pre><!--EndFragment--></body>
</html>


Itīs working very well whit in the rance of 50 - 60 meters whit the transmitter indoors and the reciver outdoors, but when i take the reciver also indoors in a house 50 - 60 meters away from the transmitter the counter on the reciver display starts to show wrong numbers sometimes but itīs still counting... but whit the reciver outdoors it does not miss a single number whit in 50 - 60 meters.

Any idé how i can to improve my code?

Iīgoing to do some more tests to tomorrow, itīs soon time to sleep here in sweden...

skimask
- 14th February 2008, 20:15
Any idé how i can to improve my code?

RF is tricky, no matter what you do. Just too many variables for the average joe to account for, circuit layout, power stability, sunspot cycle, and so on and so on...

My experiences: (which are far outweighted by a number of people on these forums when it comes to RF)
-Try changing the number of sync bytes in the transmitter...6 sync's is a good start. Try 2, try 10, try anything, see what happens.
-Try changing the baud rate. I had a TX434 from Rentron. The datasheets say it's only good for 4800bps. I got it to work very reliably at 9,600 and fairly decent up to 19,200, but it didn't like 2400bps. Try 2400, try 9600, try 4800...
-Change the PACING length. You have it set at 1000, a decent number. But...maybe the RF module wants less. If you have 1ms between each character, that also means that you have 1ms between each sync character, which may be screwing up your sync'ing, which may mean that the data slicer isn't being balanced completely. Try leaving out the PACING altogether, sending your sync bytes as fast as possible, then manually PACING your sent bytes with a slight pause in between each character.

dhouston
- 14th February 2008, 21:05
Any idé how i can to improve my code?
Get a better antenna at the receiver. You can build a very simple but very good one from plans on my web page. http://davehouston.org/eggbeater.htm
Any solid copper insulated wire will work (the bigger the wire diameter, the better) or you can even use copper tubing if you can insulate it, and you can cheat by using 75-ohm coax for the phasing line. If you still need more range, then add a wideband preamp between the receiving antenna and receiver - it's the Ten-Tec 1001.http://www.aoruk.com/tentec/kits/1001/1001.htm
Ignore the picture - it's the wrong one.

And try without pacing.

Fredrick
- 14th February 2008, 22:24
When i disconnect the power from the transmitter the reciver display still shows numbers, but does not count from 0 to 255, itīs shows 1, 244, 34, 55, 23, 99, 138, 232, 233 and so on.... where does this numbers come from?

mackrackit
- 14th February 2008, 22:51
Sounds like random noise. There is RF every where.

I think the internal "slicing" capacitor is wondering around giving false data.

If this is the case, depending on what you are going to use this for the solution can pretty easy.

If you are sending commands for a remote control the easy way is to have something like


SERIN ReciverPIN,T1200,[9],Counter
IF Counter = ??? THEN
XYZ
ELSE
QRS


If you are sending data like what you are now, you may need to set up a way to verify the data. Some sort of encoding / checksums...

The Linx web site has some info on this and dhoustion has a protocal on his web site.

Bruce
- 15th February 2008, 00:20
I'm not familiar with the Parallax modules, but if they use the Linx LR series, then this receiver will output random noise even if the transmitter is powered down.

Look at the examples on dhoustons' website, and others he has posted here. He knows what he's doing.

You might also try a search here. I have posted several code examples for RF communications that are very simple to implement, and work quite well with PBP & noisy receivers.

It's just not that simple to get a reliable wireless connection up & going, and it's for sure not going to be anywhere near as simple as a 'wired connection', but there are enough threads here 'with code examples' that cover this if you look hard enough.

dhouston
- 15th February 2008, 02:16
Like Bruce, I'm unfamiliar with the modules you chose. From your description it seems like they are superregenerative receivers. See http://davehouston.org/rf-noise.htm for an explanation of the noisy output. It can be caused by environmental factors or come from internal noise sources (e.g. resistors).

Using SerIn with this type of receiver creates two problems. One is that SerIn samples the data at the mid-point of the bit period. If the output is high at that time, you get a 1 bit and, if low, you get a 0 bit. Random noise can give you either state. The other problem is that you need to set the receiver AGC and ATC (Automatic Gain Control & Automatic Threshold Control) and you need to signal the receiver that some data is on the way. The sync bytes recommended by several people who post here are intended to serve those purposes. EDIT: If you look at the bottom picture at the above referenced link, you can see how a signal very much like the sync bytes only gradually emerges from the noise. There is a better way but it depends on the type of data that you wish to transmit.

I would only use SerOut/SerIn if I wanted to send text or lengthy data packets. And these receivers are not the best choice for either. FSK gets away from noise and the receiver has a CD (Carrier Detect) output that tells you when data is coming. FSK modules cost more than ASK but not as much as the ones you've chosen.

For short data packets, I prefer ASK and the NEC protocol illustrated in this thread http://www.picbasic.co.uk/forum/showthread.php?t=6261 The long lead-in pulse sets AGC & ATC and signals that a data packet follows. Since the output is only monitored after seeing the long lead-in, random noise is much less of an issue. Instead of sampling at mid-bit, the receive routine measures the length of the spaces between pulses so it's less likely to be fooled by noise or its absence at mid-bit. (It's even better to measure between rising edges but that requires interrupts.) And each byte is sent twice in bitwise complementary form so error detection is built-in.

What is the nature of the data that you want to transmit?

Fredrick
- 15th February 2008, 07:51
What is the nature of the data that you want to transmit?


I just buy them to play and try to learn something so i donīt have any nature of data to transmit. :)

mackrackit
- 15th February 2008, 08:24
I just buy them to play and try to learn something so i donīt have any nature of data to transmit. :)
COOL! :) Whats next?

Fredrick
- 15th February 2008, 12:09
COOL! :) Whats next?

I donīt know but now i will try to get this to work better.

Luciano
- 15th February 2008, 12:56
Hi,

From page 3:
http://www.parallax.com/Portals/0/Downloads/docs/prod/rf/27981-ParallaxRFReceive-v1.0.pdf


Calibration
When initiating communication between the RF modules, a sync pulse should be sent
to re-establish the radio connection between the modules. Sending several characters
can accomplish this, however sending a pulse (which maintains a high state during the
synchronization) is more efficient.

See page 6 for the BS2 code samples.


* * *

RSSI PIN (Received Signal Strength Indicator)

This line will supply an analog voltage that is proportional
to the strength of the received signal.


Can you test that and post the results?

(Do not connect the PIC microcontrollers during this test).


Step 1: Connect a digital voltmeter to the RSSI PIN of the receiver.
(Make sure the multimeter is set to DC volt and that you measure from the RSSI PIN to GND).
Power on the receiver and make sure the transmitter is powered off.
Q1: What voltage do you get on the RSSI PIN of the receiver?


Step 2: Power on the transmitter.
Q2: What voltage do you get on the RSSI PIN of the receiver?
(The transmitter and the Receiver are powered on).

Step 3: Connect +5V via a 1k ohm series resistor to the DATA pin of the transmitter.
(The transmitter and the receiver are powered on).
Q3: What voltage do you get on the RSSI PIN of the receiver?

Step 4: Connect GND via a 1k ohm series resistor to the DATA pin of the transmitter.
(The transmitter and the receiver are powered on).
Q4: What voltage do you get on the RSSI PIN of the receiver?

Best regards,

Luciano

* * *
EDIT:

These are the RF modules used by Parallax:

LR Series RF Transmitter Module Data Guide
http://www.linxtechnologies.com/Documents/TXM-xxx-LR_Data_Guide.pdf

LR Series RF Receiver Module Data Guide
http://www.linxtechnologies.com/Documents/RXM-xxx-LR_Data_Guide.pdf

dhouston
- 15th February 2008, 13:05
I just buy them to play and try to learn something so i donīt have any nature of data to transmit. :)
I looked briefly at the datasheet and these do use the Lynx RXM-433-LR-S chip which is a superhet design (the same one Bruce sells). This has a little better sensitivity and a little less noise than a superregenerative receiver like the RWS-434 but, in essence, it's an AM radio receiver and the noise you see in the absence of a signal is equivalent to the noise you hear on an AM radio when it's tuned between stations.

You can make use of the RSSI pin. Connect it to one of the PIC's ADC pins to get a measure of signal strength. You can use this to compare different antennas, etc.

You can also see the output signal using the techniques I've described here.http://davehouston.org/learn.htm

Fredrick
- 15th February 2008, 16:31
Calibration
When initiating communication between the RF modules, a sync pulse should be sent
to re-establish the radio connection between the modules. Sending several characters
can accomplish this, however sending a pulse (which maintains a high state during the
synchronization) is more efficient.


How to i know how the the period of the puls?

There is diffrent periods for BS1 and BS2 and mybe another period for my PIC?

Luciano
- 15th February 2008, 17:12
Hi,

From page 3:
http://www.parallax.com/Portals/0/Downloads/docs/prod/rf/27981-ParallaxRFReceive-v1.0.pdf

===========================
Basic Stamp 1:

PULSOUT 1, 300

300 = 300 * 10 ĩs = 3000 ĩs
===========================
Basic Stamp 2:

PULSOUT 8, 1200

1200 = 1200 * 2 ĩs = 2400 ĩs
===========================

See page 339 of the Basic Stamp manual:
http://www.parallax.com/dl/docs/prod/stamps/BasicStampMan.pdf

Best regards,

Luciano

Fredrick
- 15th February 2008, 19:27
But whats is the value for my PIC16F628? how do i calculate that valu?

Luciano
- 15th February 2008, 19:43
Hi,

The synchronization is for the microcontroller connected to the receiver.
The duration of the synchronization pulse depends from the used baud rate.

Here is the duration of a frame at 1200 baud.
http://img147.imageshack.us/img147/8470/frameif3.th.png (http://img147.imageshack.us/img147/8470/frameif3.png)
(Click to enlarge the picture).

Make sure you use 8 data bits, no parity, one stop bit.
Must be INVERTED. (See PicBasic manual).

Best regards,

Luciano

languer
- 16th February 2008, 00:32
You can get more noise "filtering" by making your pre-amble more unique. Right now you are using 9, which is 0b00001001. So anytime the receiver puts this out the PIC will display the next character. You can see (in particular if you look at David's plots) that you can almost guarantee the receiver will output this at any particular time. That is, a noisy receiver will output ones randomly.

So if you make your pre-amble longer and more "unique" you gain some advantage over the noisy output of the receiver.

Say:

SEROUT TransmitterPIN,T1200,[Synk,Synk,Synk,Synk,Synk,Synk,42590,Counter]

and:

SERIN ReciverPIN,T1200,[42590],Counter

This of course is in addition to all that has been said here. The RSSI output is a nifty way to create a "listen to me" or "wake-up" signal, and FM-based systems (e.g. FSK) modules have an inherent advantage over noise. However you can get the AM-based (e.g. ASK) modules to work ok if you understand the limitations and caveats.

Luciano
- 16th February 2008, 08:02
Hi,


The Parallax example:

http://www.parallax.com/Portals/0/Downloads/docs/prod/rf/27981-ParallaxRFReceive-v1.0.pdf

From page 6:

'===TX CODE ===========================
PULSOUT 8, 1200 'Sync pulse for the receiver
SEROUT 8, 16468, [ "!", x.HIGHBYTE, x.LOWBYTE, y.HIGHBYTE, y.LOWBYTE ]
'======================================

'===RX CODE ==========================
SERIN 7, 16468, [WAIT("!"), x.HIGHBYTE, x.LOWBYTE, y.HIGHBYTE, y.LOWBYTE]
'======================================


In the Parallax example, SERIN waits to receive an explanation mark "!".
This is called a "qualifier" in the PicBasic manual. If the character
received does not match the qualifier "!", the qualification process starts over.
Once the qualifier is satisfied, SERIN begins storing data in the variables
we have specified.

The synchronization pulse (PULSEOUT) triggers the qualification process of
SERIN and makes sure that SERIN will be ready to receive the next character
which is "!" in the Parallax example. With PULSEOUT we simulate a character
NULL. (NULL = Binary 0, inverted logic is used).

* * *

When a logic "1" is present on the DATA line and the PDN line is high, then
the power amplifier will be activated and the carrier frequency will be sent
to the antenna. When a logic "0" is present on the DATA line and the PDN line
is high, the power amplifier is deactivated and the carrier is fully suppressed.

When "Inverted logic" is used, then there is no RF carrier when the data line
is idle. Note that the inverted logic is not a must, but if you don't use it, the
code will be more complicated and you will have to use an I/O pin of the PIC
in order to control the PDN line of the transmitter.


Best regards,

Luciano

Fredrick
- 16th February 2008, 12:09
When "Inverted logic" is used, then there is no RF carrier when the data line
is idle. Note that the inverted logic is not a must, but if you don't use it, the
code will be more complicated and you will have to use an I/O pin of the PIC
in order to control the PDN line of the transmitter.


When i trying to send in inverted mode whit SERIN (N2400 insted of T2400) the reciver doest work very well it misses many numbers.

If we look on the BS2 sample they using this

SEROUT TransmitterPIN, 84, [ "!", x.HIGHBYTE, x.LOWBYTE, y.HIGHBYTE, y.LOWBYTE ]

Shold i try to use SERIN2 insted like this?

SEROUT2 TransmitterPIN, 16468, ["!", x.HIGHBYTE, x.LOWBYTE, y.HIGHBYTE, y.LOWBYTE]

Luciano
- 16th February 2008, 12:38
Hi,

Can you post the results of the RSSI test?

http://www.picbasic.co.uk/forum/showpost.php?p=51158&postcount=38

If you do so we will know if somebody else is transmitting on the same frequency.

Best regards,

Luciano

Fredrick
- 16th February 2008, 13:25
Step 1: Connect a digital voltmeter to the RSSI PIN of the receiver.
(Make sure the multimeter is set to DC volt and that you measure from the RSSI PIN to GND).
Power on the receiver and make sure the transmitter is powered off.
Q1: What voltage do you get on the RSSI PIN of the receiver?

A1: 1,22V


Step 2: Power on the transmitter.
Q2: What voltage do you get on the RSSI PIN of the receiver?
(The transmitter and the Receiver are powered on).

A2: 1,22V


Step 3: Connect +5V via a 1k ohm series resistor to the DATA pin of the transmitter.
(The transmitter and the receiver are powered on).
Q3: What voltage do you get on the RSSI PIN of the receiver?

A3: 1,77V


Step 4: Connect GND via a 1k ohm series resistor to the DATA pin of the transmitter.
(The transmitter and the receiver are powered on).
Q4: What voltage do you get on the RSSI PIN of the receiver?

A3: 1,22

dhouston
- 16th February 2008, 14:00
If you do so we will know if somebody else is transmitting on the same frequency.
Everyone in Europe is transmitting on that frequency. It's the only one allowed for this type of use. There are restrictions on how often & how long you can transmit because so many share the frequency. Allowing 25mW when everyone uses the same band is sure to lead to problems.

An RSSI output, in and of itself, may be of little help as noise can generate a high RSSI - it depends on the details of both the circuit and the methodology - it's not equivalent to CD on FSK. With the RWS superregenerative receivers, I measure the modulation depth (difference between the pulse and following space) of the lead-in pulse which has proven to be a good proxy for signal strength.

Recording or viewing the data output line is the best way to determine whether it's random noise or a signal (or signals) from the transmitter (or other transmitters). It's easy to do by recording with a soundcard and viewing it in a soundfile editor or with soundcard oscilloscope software (Google Virtins) or even the Parallax USB oscilloscope. The data output will be audible. You can even distinguish noise from signal by listening to it with a sound card.

You can also grasp why a relatively long lead-in pulse is needed by looking at a the output in graphical form. The noise pulses tend to be of short duration so a long lead-in makes it easy to separate wheat from chaff..

Fredrick
- 16th February 2008, 14:54
When i trying to use the BS2 sampel code i does not work at all, isīt the BS2 SERIN/SEROUT comand like PBPīs SEROUT2/SERIN2?

Whats wrong.


SERIN2 reciverpin, 16468, [WAIT("!"), x.HIGHBYTE, x.LOWBYTE, y.HIGHBYTE, y.LOWBYTE]




PULSOUT TransmitterPIN, 1200
SEROUT2 TransmitterPIN, 16468, ["!", x.HIGHBYTE, x.LOWBYTE, y.HIGHBYTE, y.LOWBYTE]


This at least works.. it counts from 0 to 255 whit maby a total off 1 - 10 numbers that are wrong, maybe thats normal and i must let that problem over to the program to handle.
And it only work whit True mode not whit Inverted...


SEROUT transmitterpin,T2400,[synk,synk,synk,synk,9,Counter]



SERIN reciverpin,T2400,[9],Counter


But i still wonder why the BS2 code doesīt work at all, i shold do that i think?

Luciano
- 16th February 2008, 16:01
Hi Fredrick,

Are you living in a city area?
If not, it is possible that there is another transmitter within 500m?

Do you have an oscilloscope? If yes, try to see what do you get on the DATA pin
of the receiver when the transmitter is powered off.

See also these links:

LinxTechnologies.com Linx Knowledgebase - RF Modules - LR Series Long Range Wireless Communication Modules
The DATA line of the LR receiver seems to switch randomly when the transmitter is not on.
http://www.linxtechnologies.com/Support/Knowledgebase/RF-Modules/LR-Series-Long-Range-Wireless-Communication-Modules/

APPLICATION NOTE AN-00160
Considerations For Sending Data Over a Wireless Link
http://www.linxtechnologies.com/Documents/AN-00160.pdf

* * *

Before you test with the RF modules, make sure that your system works when the
two microcontrollers are connected with a 1k ohm resistor.
Make sure that the two PIC microcontrollers share the same ground. (GND).


PIC #1 PIC #2
1k
TX Pin-----/\/\/\------RX pin

GND -------------------GND


Best regards,


Luciano

Fredrick
- 16th February 2008, 17:57
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?



<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&auml;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">&quot;modedefs.bas&quot;
</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, [&quot;!&quot;, 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>






<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">&quot;modedefs.bas&quot;
</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(&quot;!&quot;), 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">&quot;No signal!&quot;
</font><font color="#000080">DEBUG </font><font color="#FF0000">&quot;No signal!&quot;</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>

Luciano
- 16th February 2008, 18:09
What is the diffrens for the LINX modules to be driven by Inverted mode or True mode?

When Inverted logic is used there is no RF carrier while the data line is idle.
The power amplifier is activated only when a logic "1" is present on the DATA line.

This is what you have on the DATA line when you use the Inverted logic.
http://img147.imageshack.us/img147/8470/frameif3.png

Best regards,

Luciano

Fredrick
- 16th February 2008, 18:50
Ok, and in True mode you have RF carrier when the DATA line i in idle.

But iīm still not understanding why its a problem to drive it in true mode, and in my case i have to drive it in true mode for inverted mode doesīt work at all.

Luciano
- 16th February 2008, 18:57
Before you test with the RF modules, make sure that your system works when the
two microcontrollers are connected with a 1k ohm resistor.
Make sure that the two PIC microcontrollers share the same ground. (GND).


PIC #1 PIC #2
1k
TX Pin-----/\/\/\------RX pin

GND -------------------GND

Both microcontrollers must use inverted logic.

Fredrick
- 16th February 2008, 19:55
I have done the Test now.. and here we have the problem

It dosenīt work whit the BS2 code (SERIN2/SEROUT2) whit wires between the picīs but the other code whit SERIN and SEROUT works fine.

What could be the problem?



SERIN2 reciverpin, 16468, [WAIT("!"),Counter]




PULSOUT TransmitterPIN, 1200
SEROUT2 TransmitterPIN, 16468, ["!",Counter]


iīm not sure if the "16468" in the BS2 program shold be the same in a PBP program, i dont understand how to set those bits. but if there shold be "16468" then what else could be wrong?

EDIT:
Just find that 9600 baud may be unreliable with 4MHz clock, but itīs still not working when i try to lower the baud to 2400.
Itīs not working in inverted mode whit both SERIN/SEROUT and SERIN2/SEROUT2

http://www.microengineeringlabs.com/resources/ser2modes.htm

What are iīm doing wrong?

EDIT2:
Can it have someting to do whit that iīm using a 4MHz inernal RC on the transmitter? shold i clock it up to 20MHz whit an external crystal like the reciver?

Luciano
- 17th February 2008, 09:46
Hi Fredrick,

A sync pulse of 3000 ĩs is what is used in the BS1 example visible at page 5 of this doc:
http://www.parallax.com/Portals/0/Downloads/docs/prod/rf/27981-ParallaxRFReceive-v1.0.pdf
(In the BS1 sample code the baud rate is 2400).

I am not a PicBasic Pro user or a Basic Stamp user, so what I can do is very limited
and based only on the user manuals.

Here is my version of the PBP code:


' Transmitter code
' (Clock = 4MHz).
'
' At 4MHz, a PULSEOUT of 300 is OK.
' 300 * 10 ĩs = 3000 ĩs
' (See PBP Manual PULSEOUT).
'
' BAUD MODE = 16780 (Baud rate 2400, 8-bit, no-parity, inverted, output DRIVEN).
'
'
PULSOUT TransmitterPIN, 300 ' sync pulse of 3000 ĩs
SEROUT2 TransmitterPIN,16780,["!",Counter]
'




' Receiver code
' (Clock = From 4MHz to 20 MHz).
'
' BAUD MODE = 16780 (Baud rate 2400, 8-bit, no-parity, inverted).
'
'
SERIN2 reciverpin, 16780, [WAIT("!"),Counter]
'



Best regards,

Luciano

Fredrick
- 17th February 2008, 12:23
Doesīt work....

The PIC (16F872) stops at
SERIN2 reciverpin, 16780, [WAIT("!"),Counter]

Is there a bug in PBP like the one whit OWOUT that make a never ending loop
I have version PBP 2.50a

http://www.picbasic.co.uk/forum/showpost.php?p=47679&postcount=4

Note that both SERIN and SERIN2 makeīs the PIC stops when i try to use them whit Inverted mode. whit SERIN and True mode it works..

UPDATE:
When i remove "PULSOUT TransmitterPIN, 300" it works....... ??

Luciano
- 17th February 2008, 13:43
Hi Fredrick,

Here is how you can test the TX code and the RX with a terminal emulator.

* * *

You can test the TX code if you connect the PIC to the serial
port of your PC. The 1k resistor is mandatory.

Open your terminal emulator with these settings:

2400 baud, 8 data bits, No-parity, 1 stop bit.




' 1k
' PIC TX pin ---------/\/\/\---------- DB9 (Pin 2) RS232 port RX data
'
'
' PIC GND -----------------------------DB9 (pin 5) RS232 port GND
'
'
'
Counter = 65 '65 = character A
SEROUT2 TransmitterPIN,16780,["!",Counter]


If you run this code you should see in the terminal emulator: !A


* * *


You can test the RX code if you connect the PIC to the serial
port of your PC. The 22k resistor is mandatory.

Open your terminal emulator with these settings:

2400 baud, 8 data bits, No-parity, 1 stop bit.




' 22k
' PIC RX pin ---------/\/\/\---------- DB9 (Pin 3) RS232 port TX data
'
'
' PIC GND -----------------------------DB9 (pin 5) RS232 port GND
'
'
'
SERIN2 reciverpin, 16780, [WAIT("!"),Counter]


After you run the code you must type !A in the terminal emulator.

* * *

Note that this direct connection with series resistors works only if you
use Inverted logic for SEROUT2 and SERIN2.

Best regards,

Luciano

Fredrick
- 17th February 2008, 15:09
I give upp now..... Inverted mode does not work but True mode work just fine whit SERIN, i think it has someting to do whit noise in the air becous when i hold my hand over the antenna of the reciver it works a better but not good.

My solution will be to pull down PDN line when i donīt want to transmitt and pull it high when i want to transmitt or just drive the hole modul from an +5v high PIN on the PIC that is active when i want to transmitt and then pull it low.

Transmitter supply current is 5.2 mA so a pin from the 16F628A that have 20mA is enought.

Then i can use True mode whitout have an RF carrier when i donīt send.

Fredrick
- 18th February 2008, 10:28
The maximun output power for the transmitter is 14DBm or 25.11mW
Is that correct?

http://www.linxtechnologies.com/Documents/TXM-xxx-LR_Data_Guide.pdf

skimask
- 18th February 2008, 10:35
My solution will be to pull down PDN line when i donīt want to transmitt and pull it high when i want to transmitt or just drive the hole modul from an +5v high PIN on the PIC that is active when i want to transmitt and then pull it low.

Transmitter supply current is 5.2 mA so a pin from the 16F628A that have 20mA is enought.

Then i can use True mode whitout have an RF carrier when i donīt send.


The maximun output power for the transmitter is 14DBm or 25.11mW
Is that correct?

http://www.linxtechnologies.com/Documents/TXM-xxx-LR_Data_Guide.pdf

The datasheet that you just posted...page 2, lower left corner, ABSOLUTE MAXIMUM RATINGS...might have something to do with something...

Fredrick
- 18th February 2008, 10:53
The datasheet that you just posted...page 2, lower left corner, ABSOLUTE MAXIMUM RATINGS...might have something to do with something...

There is an voltage regulator circut on the parrallax bord allowing it to be driven and controlled from a 5V source, so iīm not extend the maximum.

Archangel
- 18th February 2008, 11:11
Hi Fredrick,
Ha, Skimask was thinking the same thing I was, overdriving the transmitter chip, but I guess that is not it, so . . . I would make sure the transmitter is away from the power supply a bit, and make sure to tie the grounds together all in the same place, it will help if you can tie to an earth ground. One question, are you still using serin and serout? I ask only because HERSERIN and HERSEROUT will only work in TRUE mode and not INVERTED.
HTH
JS

Luciano
- 18th February 2008, 12:07
The maximun output power for the transmitter is 14DBm or 25.11mW
Is that correct?

No.

From ELECTRICAL SPECIFICATIONS/TRANSMITTER SECTION/Output Power:

At 2.1V the power is - 4dBm = 0.398 mW
At 3.0V the power is 0dBm = 1 mW
At 3.6V the power is 4dBm = 2.511 mW

Do not modify the hardware you got from Parallax.
1 mW or 2.5 mW do not make any difference.

Fredrick
- 18th February 2008, 12:37
but 1mW and 25mW makes diffrents...
Connect the LADJ to vcc will give +10DB and itīs allowd in sweden.

By the way i have get my code to work now whit inverted mode, idonīt know exaktly what makes it work but i think it have something whit the sync to.

there maybe som other solution to it but this works.

FOR I = 1 TO 3
SEROUT TransmitterPIN,N2400,[$55,$55,$55,63519,Counter,Check]
NEXT I

and yes i sending the code whitout pauses three times i think this helps the transmitter to syncronise.



The Level Adjust (LADJ) line allows the transmitter’s output power to be easily
adjusted for range control, lower power consumption, or to meet legal
requirements. This is done by placing a resistor between VCC and LADJ. The
value of the resistor determines the output power level. When LADJ is connected
to VCC, the output power and current consumption will be at its maximum. Figure
4 on Page 3 shows a graph of the output power vs. LADJ resistance.
This line is very useful during FCC testing to compensate for antenna gain or
other product-specific issues that may cause the output power to exceed legal
limits. A variable resistor can be temporarily used so that the test lab can
precisely adjust the output power to the maximum level allowed by law. The
variable resistor’s value can be noted and a fixed resistor substituted for final
testing. Even in designs where attenuation is not anticipated, it is a good idea to
place a resistor pad connected to LADJ and VCC so that it can be used if needed.
For more sophisticated designs, LADJ can be also controlled by a DAC or digital
potentiometer to allow precise and digitally variable output power control.


Output Power Control Range -80 – +10 dB

Luciano
- 18th February 2008, 13:51
From Figure 4:

Diagram Output Power vs. LADJ Resistance:
When LADJ Resistance = 0 then the output power is 9 dBm (7.943mW).

In theory you can get 10mW but then when you read:

The LR Series transmitter is designed to generate 1mW of output power into a
50-ohm single-ended antenna while suppressing harmonics and spurious emissions
to within legal limits.

* * *

In unidirectional links, a good designed transmission protocol will make the difference.
Use redundant data for the purpose of error correction.

mackrackit
- 18th February 2008, 14:43
And I will add again.
A good antenna is a must!

Fredrick
- 18th February 2008, 21:17
Yes... Now i have get the program to work very well whit inverted mode, tested it at 100 meters and there no errors or missing numbers.

But then we come to the next problem, I have searched the forum and I find out that iīm not alone whit this problem, but the solution for it doesīt work for me.

I canīt get the SERIN timeout to work, and yes the input is switching between high and low when the transmitter is off. i have tryed whit an 1K, 3K, 4.7K, 10K resistor between GND and the input pin but when the timeout works the recive module does not and when the reciver work the timeout does not.

So what else can i do? is there an software solution for this or must i use an hardware solution?

mackrackit
- 18th February 2008, 22:07
Hi,

Could you post your current code? It may be some thing simple that has been over looked.

Fredrick
- 18th February 2008, 22:35
<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-16 *
'* 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">&quot;modedefs.bas&quot;
</font>ReciverPIN <font color="#000080">VAR </font>PORTC.<font color="#808080">0
</font>Check1 <font color="#000080">VAR BYTE
</font>Check2 <font color="#000080">VAR BYTE
</font>Counter <font color="#000080">VAR BYTE
</font>Errors <font color="#000080">VAR WORD


CLEAR
PAUSE </font><font color="#808080">500
</font><font color="#000080">LCDOUT </font><font color="#808080">$FE</font>,<font color="#808080">1

</font>Main:
<font color="#000080">SERIN </font>ReciverPIN,N2400,<font color="#808080">100</font>,NoSignal,[<font color="#808080">$55</font>,<font color="#808080">$55</font>,<font color="#808080">$55</font>,<font color="#808080">63519</font>],Counter,Check1,Check2

<font color="#000080">IF </font>Check1 = <font color="#808080">121 </font><font color="#000080">AND </font>Check2 = <font color="#808080">212 </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">$80</font>, #Counter, <font color="#FF0000">&quot; &quot;
</font><font color="#000080">DEBUG </font>#Counter, <font color="#808080">13</font>,<font color="#808080">10
</font>Check1 = <font color="#808080">0
</font>Check2 = <font color="#808080">0
</font><font color="#000080">GOTO </font>Main

NoSignal:
Errors = Errors + <font color="#808080">1

</font><font color="#000080">LCDOUT </font><font color="#808080">$FE</font>,<font color="#808080">$C0</font>, <font color="#FF0000">&quot;ERROR:&quot;</font>,#Errors,<font color="#FF0000">&quot; &quot;</font>,#Check1,<font color="#FF0000">&quot; &quot;</font>,#Check2
<font color="#000080">DEBUG </font>#Counter, <font color="#FF0000">&quot;ERROR:&quot;</font>,#Errors,<font color="#FF0000">&quot; &quot;</font>,#Check1,<font color="#FF0000">&quot; &quot;</font>,#Check2, <font color="#808080">13</font>,<font color="#808080">10
</font>Check1 = <font color="#808080">0
</font>Check2 = <font color="#808080">0
</font><font color="#000080">GOTO </font>Main
<font color="#000080">END
</font></code></pre><!--EndFragment--></body>
</html>

languer
- 19th February 2008, 06:29
I canīt get the SERIN timeout to work

Fredrick, what you are seeing is the receiver "wait" loop is being re-triggered continuously by the noise (as you probably know by now). There is no proper way to get the "wait" command to work with software only.

I would suggest the following (this is a simple way to create your own squelch circuit):
Add a comparator to the RSSI output (unfortunately the 16F872 does not have one built-in).
Set the threshold for an RSSI level equivalent to a good signal (above that which you capture noise only). This would give you a cleaner mark-space signal (need to make sure the comparator is high speed).
Output of comparator is "ANDed" with the RX-DATA output and sent to SERIN.

Luciano
- 19th February 2008, 09:10
From Linx Technologies - Linx Knowledgebase

The DATA line of the LR receiver seems to switch randomly when the transmitter is not on.

This is a result of the increased sensitivity of the LR receiver. The sensitivity is below the noise floor of the board, so it is picking up thermal noise and other random signals and outputting it as data. This is generally not a problem for off-the-shelf decoders and can be resolved in software for custom microcontrollers (see Application Note AN-00160 for protocol recommendations), but an external squelch circuit can also be used. Using a squelch circuit will allow the designer to only allow data when the received signal is above a certain threshold, but it will sacrifice the range. This allows the user to make the tradeoff between random noise and range.

Attached is a circuit schematic for a squelch circuit for the LR Series receiver (or any receiver with an RSSI output). The RSSI line will output a voltage that is relative to the strength of the received signal. Since the LR Series is On-Off-Keyed, this output will follow the data and look like a square wave, so it will be at a lower voltage when receiving a '0' and at a higher voltage when receiving a '1'. D1, C1, and R1 form a peak detector that will follow the peak voltage of the ones.

This voltage is then fed into the non-inverting input of a comparator where it is compared to a reference level set by a potentiometer. When the signal level becomes greater than the reference voltage set by the potentiometer, the comparator will release the output line. When the signal level falls below the reference voltage, the comparator will pull the output line to ground. Most comparators have open collector outputs, meaning that they can only pull the line to ground or release it. They cannot pull the line high, so a weak external pull-up resistor (R3) is needed to pull the line to Vcc when the comparator releases it. The feedback resistor (R4) is used to stabilize the output.

The output of the comparator is used to control an analog switch that will pass the received data to whatever external circuitry the application requires. When the control line is high, the data gets passed, otherwise it is not connected. This means that when the received signal is greater than the threshold, the switch is closed and the data is passed. When laying out the board, it is a good idea to place the output of the analog switch close to the device that will be using the data. A long trace or wire here has the potential to couple AC noise onto the data line while it is squelched.

A discreet voltage divider or a voltage reference IC can be used in place of the potentiometer, and the values for C1 and R1 can be adjusted to tune the response as needed.


Attached File: LR Series Receiver Squelch Circuit - 56K
http://www.linxtechnologies.com/Knowledgebase/Attachments/LR%20Squelch.jpg

APPLICATION NOTE AN-00160
Considerations For Sending Data Over a Wireless Link
http://www.linxtechnologies.com/Documents/AN-00160.pdf

earltyso
- 3rd May 2008, 23:58
Hello out there,
I am looking at using the LINX TXM/RXM LR series of serial modules to send real time data for a depth monitoring system. They sure don't look as easy to implement as the LINX TXM KH2 modules with simple bits and adressing with built in encoders and decoders.
I was hoping to get away with not using any error checking or checksum, just a simple test for one transmitter to pass ...something like....



'transmitter module
main:
B0 = 12345
SEROUT2 TXPORTPIN, 84, ["TEST", B0]
pause 100
goto main




'reciever module
main:
SERIN2 TXPORTPIN, 84, [WAIT("TEST"),DEC5 B0]
pause 100
goto main


if you pass the test (which is a string), send the simple data and wait for the next time the test is sent/passed to collect the data. Another idea I had to was to create my own adressing with one of the ports for security....
Are there any other suggestions out there?
how about using an encoder chipset for serial data? I have not looked at this yet, I will do some more looking and get back with what I find.

mister_e
- 4th May 2008, 00:25
You can still add a variable who will pass the channel to write to, on the receiver side you just need to monitor that variable an proceed if it match.


'transmitter module
MyData = 12345
Channel = 1
SEROUT2 TXPORTPIN, 84, ["TEST", DEC2 Channel, DEC5 MyData]



'receiver
SERIN2 TXPORTPIN, 84, [WAIT("TEST"),DEC2 Channel, DEC5 Mydata]
If Channel = Myaddress then
' process MyData
ENDIF


You also want to use some encoding, Manchester or else.

earltyso
- 4th May 2008, 01:19
Steve,
thanks again for all the help along the way with my serial project... I will give it your advice a shot, I feel that my hardware design will follow linx requirements well enough, just want to make sure my firmware is equal to the task.
I will let you know how it goes.