Serial communication over RF (radio)
I am trying to figure out how to program one way serial communication using RF (radio) units from Quasar.
The transmitter module is connected to a Basis Stamp 1, and I am using SEROUT 7, T600, ("y") to send the character y when I push a button. Here is the TX module: http://www.quasaruk.co.uk/acatalog/FM_Transmitter_Module.html
The receiver module is connected to a Javelin Stamp. The data pin on the RX is connected directly to the rxUart pin on the Javelin. Here is the RX module: http://www.quasaruk.co.uk/acatalog/FM_Receiver_Module.html
I have a audio radio listening on the RX frequency and there is something transmitted over the air when I push the button, but the rxUart on the Javelin does not receive anything. BUT, if I turn the transmitter off completely, the rxUart starts receiving (random?) data.
I just dont know what to do. Do any of you have any tips for me?
The transmitter module is connected to a Basis Stamp 1, and I am using SEROUT 7, T600, ("y") to send the character y when I push a button. Here is the TX module: http://www.quasaruk.co.uk/acatalog/FM_Transmitter_Module.html
The receiver module is connected to a Javelin Stamp. The data pin on the RX is connected directly to the rxUart pin on the Javelin. Here is the RX module: http://www.quasaruk.co.uk/acatalog/FM_Receiver_Module.html
I have a audio radio listening on the RX frequency and there is something transmitted over the air when I push the button, but the rxUart on the Javelin does not receive anything. BUT, if I turn the transmitter off completely, the rxUart starts receiving (random?) data.
I just dont know what to do. Do any of you have any tips for me?

Comments
regards peter
bsTX source:
' {$STAMP BS1} ' {$PBASIC 1.0} ' BS1 TXC V2.1 Card Setup: DEBUG "Setup start" INPUT 0 ' Button pin OUTPUT 6 ' LED pin Main: IF PIN0 = 0 THEN SendData ' If button is pressed. Pin0 turns low when button is pressed PAUSE 100 GOTO Main SendData: GOSUB FlashLED GOSUB SOut GOTO Main FlashLED: PIN6 = 1 ' LED on PAUSE 100 PIN6 = 0 ' LED off PAUSE 100 RETURN SOut: SEROUT 7, T600, ("y") PAUSE 1000 RETURNjRX source:
import stamp.core.*; public class JavRX2 { final static int SERIAL_RX_PIN = CPU.pin0; static Uart rxUart = new Uart ( Uart.dirReceive, SERIAL_RX_PIN, Uart.invert, Uart.speed600, Uart.stop1 ); static StringBuffer buffer = new StringBuffer(128); static char c; static boolean a=true; static void bufferMessage(){ c = 0xff; while (c != '\r') { if (rxUart.byteAvailable()){ c = (char)rxUart.receiveByte(); buffer.append(c); } // END if } // END while } // END buffer message public static void main(){ System.out.println("Ready"); do{ buffer.clear(); bufferMessage(); System.out.println("Test"); c = (char) rxUart.receiveByte(); System.out.println("Byte received"); } while (a==true); //(c == 'y' || c != 'n'); // END do System.out.println("Goodbye!"); } // END main } // END public classBufferMessage can never exit if it does not receive '\r'
Try this:
··public·static·void·main(){
··System.out.println("Ready");
····do{
······//buffer.clear();
······//bufferMessage();
······//System.out.println("Test");
······c·=·(char)·rxUart.receiveByte();
······System.out.print(c); //this should display all "y"
····}·while·(a==true);·//(c·==·'y'·||·c·!=·'n');·//·END·do
····System.out.println("Goodbye!");
··}·//·END·main
Also, are you sure the javelin receives inverted data? Have you tried Uart.dontInvert?
regards peter
Your code worked and I am actually receiving the text I am sending over the radio now!
I really dont know if the data is inverted or not, but I think it is inverted, because if i choose dontInvert I get different characters on each button push.
I will work more on my code now.
thanks again.