xrf getting it to work

peatatnaples

New Member
Although I can transmit data from one 08M2 to another using serin/serout using a wire connection and by using a cheap 433mHz wireless connection I am consistently failing to get two xrf modules to talk to each other. The transmitting 08M2 is producing an increasing value from 1 to 10 in a loop and the receiving one uses this value to produce an increasingly longer flash on an LED.

Code:
Transmitter
init:setfreq m8
asktx:
for b0= 1 to 10
	pause 200
	serout 4, T9600_8,(88,88,88,88,b0)
	pulsout 1,200
	pause 4000
next b0
goto asktx

Receiver
init:setfreq m8
high 4
askrx:
pause 100
serin 4, T9600_8,(88,88,88,88), b0
pulsout 2,200
w1=b0*200
high 1
pause w1
low 1
goto askrx
I have studied SRNET's post about xrf working out of the box and info supplied with xrf and believe I have done every thing correctly. If I connect the heartbeat LEDs they are flashing so I presume the units are functional.
Suggestions please.
Peat
 

Attachments

srnet

Senior Member
A link to the post in question would help, even I dont remember the details of posts I have made several years ago ................
 

srnet

Senior Member
I have studied SRNET's post about xrf working out of the box and info supplied with xrf and believe I have done every thing correctly
Thanks to circuit we now have the post in question.

I did actually say here is a program (for 28X2) that will work with the xrfs out of the box, did you try that program ?

Your program (for 08M2) looks very different.
 

Blazemaguire

Senior Member
Having used these a few times with students, they can be confusing, but they're brilliant when they work (great range)

First, are you running it on 3.3V? ( I believe they are not rated to higher voltage) So hope you haven't fried them. Also, make sure you've got decent batteries in. They do chew through batteries quickly. Don't put them too close together on the bench either.... That seemed to cause issues.

Second. The pins labelled RX and TX (as per the datasheet... assuming you can find that!) are confusing to my mind (others might disagree) - From memory (it's been a while) The pin labelled TX, which you'd think would be the pin you connect the transmitting data pin of the PICAXE to is actually the pin that outputs transmitted data to the PICAXE (i.e, it's transmitting the received data) That stumbled me a few times from memory.

I also had problems getting them to work at standard clock speeds, I think I had to use 16mhz due to some issue with 9600 Baud on the 20m2 at default clock speed. Don't ask why, but it worked for me!
 

srnet

Senior Member
The pins labelled RX and TX (as per the datasheet... assuming you can find that!) are confusing to my mind (others might disagree) - From memory (it's been a while) The pin labelled TX, which you'd think would be the pin you connect the transmitting data pin of the PICAXE to is actually the pin that outputs transmitted data to the PICAXE (i.e, it's transmitting the received data)
Dealt with a lot of serial devices recently, cant think of one that is labeled the wrong way around, i.e its labelled on an assumption based on what other type of device you are going to connect it to.

TX in everything I come across these days is the pin thats doing the transmitting.
 

peatatnaples

New Member
Apologies for not labelling the thread referred to and thank you Circuit for showing it. Blazemaguire:Yes the units are running on a 3volt supply and thanks to SRNET's post I believe I have my inputs and outputs correct. The 08M2's are running at 8mhz so that I can use the xrf default baudrate 9600. The units are about 2 metres apart for testing.
I have also swapped the xrf units around so that they have both been used as a Tx or Rx. Still no joy.
 

peatatnaples

New Member
I have just read Oracacles current post about serial comms problems and Goeytex's reply about qualifiiers and unreliability at 9600_8 so I removed the qualifiers and everything now works as I hoped it would. I learn something new every day, the trouble is remembering it!
 

srnet

Senior Member
I have just read Oracacles current post about serial comms problems and Goeytex's reply about qualifiiers and unreliability at 9600_8 so I removed the qualifiers and everything now works as I hoped it would. I learn something new every day, the trouble is remembering it!
I dont think I used qualifiers in the programs you referred to earlier.
 

peatatnaples

New Member
I dont think I used qualifiers in the programs you referred to earlier.
No you did not and your code was very different to my simple snippet but that post confirmed in my mind that I was connecting things correctly etc. Is the XRF selective enough to operate without qualifiers or is it because I am in an isolated location?
 

srnet

Senior Member
No you did not and your code was very different to my simple snippet but that post confirmed in my mind that I was connecting things correctly etc. Is the XRF selective enough to operate without qualifiers or is it because I am in an isolated location?
They dont need qualifiers, which is why my code did not use them.

From the PICAXE Shop;

"The XRF transparently passes serial characters to and from individual or multiple radio devices. You don't need to use complex encoding or error checking as it is all done for you - simply send raw text/data via ‘serout’, and receive text/data via ‘serin’"
 
Top