Someone pls help me.. its real urgent..
proGodLik3
Posts: 13
hi im workin on basic stamp 2 project and currently wanna connect 2 basic stamps wirelessly so one basic stamp acts as the receiver end and the other the transmitting end.. im using 27981 RF Receiver and 27980 RF Transmitter to establish the connection... problem is i have tried the sample programs and it dosent seem to work like no values pops up.. im pretty sure my wiring is correct im just unsure on how to program it in order for the transmitter to transmit data to the receiver which will then be displayed on my pc..
pls help..
anyother sample progs will be well appreciated
pls help..
anyother sample progs will be well appreciated
Comments
Is each stamp on?
Are they reasonably close?
And, most important:
Do the pin #s in the program match those in the hardware?
Past that, post more details, like what Stamp you are using and the code you are trying.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
www.madlabs.info - Home of the Hydrogen Fuel Cell Robot
Saying just that the sample programs don't work isn't very helpful. They do work for other people, so the question is "what's different about what you've done?". It's best to describe exactly what setup you have and check it against the documentation. Did you use the sample program file supplied by Parallax or did you enter it yourself from the documentation? If the latter, make sure it's correct. If the former, make sure you downloaded the right program to the right Stamp.
Make sure your power source is adequate. The most common failure that people have is a run down battery.
TxCode_v_1.0.bs2
' TxCode_v_1.0.bs2
'{$STAMP BS2}
'{$PBASIC 2.5}
'
'Parallax 433.92 MHz RF Receiver (#27981) Sample Tx Code (BS2)
'Connect Pin 8 of the BS2 to the DATA line on the RF module
'Connect +5v to the 5v line, connect Ground to the GND line
'This code will transmit two word sized counters, byte at a time.
'
'Note the PULSOUT instruction: this helps the receiver sync with
'the transmitter, especially after lapses in communication
'This code transmits at 9600 baud, inverted.
x VAR Word
y VAR Word
DO
PULSOUT 8, 1200 'Sync pulse for the receiver
SEROUT 8, 16468, [noparse][[/noparse] "!", x.HIGHBYTE, x.LOWBYTE, y.HIGHBYTE, y.LOWBYTE ]
x = x + 1
y = y + 1
PAUSE
LOOP
RxCode_v_1.0.bs2
'RxCode_v_1.0.bs2
'{$STAMP BS2}
'{$PBASIC 2.5}
'Parallax 433.92 MHz RF Receiver (#27981) Sample Rx Code (BS2)
'Connect I/O Pin 7 of the BS2 to the DATA line on the RF module
'Connect +5v (Vdd) to the 5v line, connect Ground (Vss) to the GND line
'This code will look for an "!", then read in four bytes.
'The first two bytes will be the high and low bytes of a word variable (x),
'the second two bytes will be the high and low bytes of a second word variable (y).
'The values of x and y will be sent out to the DEBUG terminal.
'An optional LED (with proper current limiting resistor) may be connected to the
'BS2 I/O pin 0, this will blink when data is received.
'This code receives at 9600 baud, inverted.
x VAR Word
y VAR Word
DO
LOW 0
SERIN 7, 16468, [noparse][[/noparse]WAIT("!"), x.HIGHBYTE, x.LOWBYTE, y.HIGHBYTE, y.LOWBYTE]
HIGH 0
DEBUG ? x
DEBUG ? y
LOOP
the thing is i dunno wat im supposed to expect when the debug box pops out.. soo when i have done programmin the receiver and transmitter the debug box is blank.. can u pls brief me on wat to expect in the screen for the programs shown above.. by the way im workin on a project which is supposed just transmit data from the basic stamp to the receiver side and display it on pc..
Are you certain you're running that code on the BS2 that is connected to the transmitter? Are you certain that you have Pin 8 of that BS2 connected to the data line of the transmitter, and the 5v and ground connections also set up correctly?
Are you certain that you're running the receiver code on the BS2 that is connected to the receiver? Are you certain that you have Pin 7 of that BS2 connected to the data line of the receiver, and that the 5v and ground connections are set up correctly there as well?
I'd test this with none of that other stuff (accelerometer, temp sensor) connected, just to make sure you've got the communications working.
The BS2 connected to the receiver also needs to be connected to a computer, so that you get data from the DEBUG commands displayed on your monitor. They're set up to just show you whatever data are received for the X and Y variables. If you have the receiver setup turned on before you turn on the transmitter setup, you should see something like this:
x=1
y=1
x=2
y=2
x=3
y=3
.
.
.
If you turn on the transmitter unit first, it will have sent out some of the numbers before you get a chance to receive and display them, so you might get something like
x=260
y=260
x=261
y=261
x=262
y=262
.
.
.
Post Edited (proGodLik3) : 10/15/2008 3:36:56 AM GMT
Once you've done that, you'll know how much power you'll need and you'll be able to figure out how much of that the Stamp's regulator can supply. Then you can choose a secondary regulator that can provide power to those devices that the Stamp can't handle and the regulator's datasheet will show you a sample circuit that should work.
Accelerometer : 10mA
Temp sensor : 4mA
Transmitter : 5.1mA
Total : 19.1mA
the value is below the 50mA u told me.. so will it work or do i still have to create a secondary regulator?
···· I have an Idea!!!! How·About takein A look @ what You Have and what program needs to go in what Stamp.!!! And w/ what RF module.????.....A transceiver program in a receiver only Model will struggle every time...I don't care how good of A Programer You are.A receiver model can only "Receive"it CAN'T Transceive
· Take another look·@ the downloads from parallax for the 27981 & the 27980,I think it will come to You..
··········· ______________$WMc%_________out___
With regard to power/voltage/Vdd, place a voltmeter at the tx/rx power pins; either it's "5V" or it's not right.
The test program just transmits a couple of incrementing numbers (X, Y), something predictable,·with the receiver dutifully·capturing them and knocking them out on the DEBUG.
A photo of your set-up might help (if it's quality sufficient·for detail.)
Post Edit -- The receiver has a pin labelled "RSSI".· You'll need a voltmeter for this, too, but it provides an analog voltage related to the signal quality, indicative of your link status, like a tuning meter.
Post Edited (PJ Allen) : 10/18/2008 2:05:44 PM GMT
Frankly, you're going to need to spend more time providing information and less time asking for help. From what you're describing so far, it should be working. I suspect that you have something connected wrong, or that you're not understanding something basic about how this works.
Here's what you need to do:
1 - make certain that you have the receiver and transmitter each connected correctly to a BS2. I have one of each of them sitting in front of me right now. You will need to connect a +5v supply to the transmitter's 5V pin, ground to the gnd pin, and one of the BS2 pins to the data pin.
2 - Then load the sample transmitter program into that BS2, and make sure it runs. You might want to put some Debug statements into the program to send the data to your screen so that you can see that it's working. That's a very basic programming hint that you'll use often as you write code.
Then disconnect that BS2 from your computer, and work on the receiver.
3 - Connect +5V and gnd to the appropriate pins as before. Connect one of the second BS2 module's pins to the data pin of the receiver module.
4 - Load the sample receiver program into that BS2 and make sure it runs.
5 - Power up the BS2 connected to the transmitter.
6 - Power up the BS2 connected to the receiver. Make sure it is also still connected to your computer, so that the Debug statements can send the received data to your screen.
If everything is connected correctly, you should see the results I described in an earlier post.
If you do not, then no amount of guiding you through this is going to help - you will either need to post photos of your setup (close enough that we can see how the pins are connected to the BS2 modules), or work through what is wrong yourself.
This may sound snotty - please don't take it that way. I'm trying to give you the best advice:
To do the kinds of things that you're trying to do, you're going to need to understand how to program your Basic Stamps. You should certainly be able to figure out how to put Debug statements into the transmitter code to show you that the program is actually running. Putting Debug statements into code is extremely simple. If you don't know how to do that, you should download the "What's a Microprocessor?" book, and work your way through most of that before you tackle the project that you're working on. If you don't understand how to put Debugging flags into your code, you will most certainly not be able to complete your project.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Chris Savage
Parallax Engineering