PDA

View Full Version : Help With Easy Radio Modules



hughgoodbody
- 19th May 2005, 15:38
I am trying to send some data wirelessly using easy radio modules. I want to transmit the value read on a potentiometer to a receiver. I am having a little trouble with the code and the timing! I am a bit of a novice at this! I am using the SEROUT and SERIN command which I assume is the correct method.

On the transmit side the command is:

SerOut PORTB.5\PORTB.7, 32, [Dec PotResult]

and on the receive side, the command is:

SerIn PORTB.6\PORTB.4, 32, [Dec PotResult]

I am receiving some data, but it is a little muddled.

Has anyone tried this before? Do I need to incorporate any delays into the commands? I would most appreciate any assisstance!

Hugh

mister_e
- 19th May 2005, 18:13
for wirless comunication, you should use Manchester encoding/decoding. do a search on this forum. You should have some tip to mak everything work as you want.

OR you can also use Holtek encoder/decoder ICs.

Have a look http://www.rentron.com/remote.htm for some examples.

nimonia
- 20th May 2005, 05:43
wat modules? cm02 and rf04? arent they i2c?

Ron Marcus
- 20th May 2005, 13:36
Unless you are sending a long string of data, Manchester encoding is unneccessary. What IS neccessary, is to stablize the receiver's data slicer to the center point of the incoming data. There is a comparator that has one leg tied to the average voltage of the incoming signal, or lack thereof. If there is no signal, then the noise level can be anywhere in the normal output range. In AM receivers, it tends to be low with no signal, in FM,high.
When that data starts coming in, it slowly brings the average voltage towards the center of the output voltage range. If you try to send data before the comparator stablizes, you get garbage. What you need to do is send a character that is balanced, enough times to "warm up" the data slicer.
I use $55, or $AA say, ten times. On the receive side, I look for three consecutive $55s, then wait for the next non $55 characters. Now, if your data could include $55, it sucks being you! No, only kidding! Send the preamble $55s, say, ten times, then send a $AA. In your receiver, do a serin wait for three $55s, then do another serin waiting for a $AA. THe next few characters will be your validated data. Even at short range, you'd be amazed at how much noise can get into the link. If the data is important, send the string a number of times. The shorter the packet of info after the preamble and qualifier, the more likely it will get through intact. More that five characters, then Manchester is a good choice.

Hope this helps,
Ron

hughgoodbody
- 23rd May 2005, 11:59
Thanks Ron, that has indeed helped! It all seems to be progressing now. Many thanks.

Hugh

Beavis
- 25th May 2005, 10:14
I am trying to send some data wirelessly using easy radio modules. I want to transmit the value read on a potentiometer to a receiver. I am having a little trouble with the code and the timing! I am a bit of a novice at this! I am using the SEROUT and SERIN command which I assume is the correct method.

On the transmit side the command is:

SerOut PORTB.5\PORTB.7, 32, [Dec PotResult]

and on the receive side, the command is:

SerIn PORTB.6\PORTB.4, 32, [Dec PotResult]

I am receiving some data, but it is a little muddled.

Has anyone tried this before? Do I need to incorporate any delays into the commands? I would most appreciate any assisstance!

Hugh


use serin2/serout2 and send as binary, it solved my problem, works like a charm, I suppose your using those 433mhz tx/rx modules...