Shop OBEX P1 Docs P2 Docs Learn Events
Someone pls help me.. its real urgent.. — Parallax Forums

Someone pls help me.. its real urgent..

proGodLik3proGodLik3 Posts: 13
edited 2008-10-22 09:41 in BASIC Stamp
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 =)

Comments

  • SRLMSRLM Posts: 5,045
    edited 2008-10-14 14:42
    Are you using the right stamp version?
    Is each stamp on?
    Are they reasonably close?

    And, most important:

    Do the pin #s in the program match those in the hardware?
  • JonathanJonathan Posts: 1,023
    edited 2008-10-14 14:49
    To test the RF setup you can put an LED with a 220 ohm resistor in series from the output of the RX side. Using a jumper wire, toggle the input of the TX side to VDD and VSS. You should see the LED on the RX side blink. If that is working, connect a jumper to your Stamp pin and try sending some data using serout in a loop, with a 500 mSec pause. You should see the activty on the RX LED. Then hook a stamp pin to the RX output and try debugging and see what you get.

    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
  • Mike GreenMike Green Posts: 23,101
    edited 2008-10-14 15:13
    First you have to make sure the standard sample programs work as expected. Until they work properly, you can't move on to do your own programming because you don't know if the wireless link works. The sample programs that come with the transmitter/receiver documentation are pretty minimal. If you can't get them to work, you won't get any other, more complex, programs to work.

    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.
  • proGodLik3proGodLik3 Posts: 13
    edited 2008-10-15 02:19
    hi thanks to all for replyin.. Jonathan i will try ur method later.. Mike Green i have tried using a new 9v battery ready.. the thing is i dunno if the 5volts which come from the Vdd of the basic stamp 2 is enough to support a temp sensor + accelerometer + transmitter.. anyway the program i used just to test the receiver and transmitter are the parallax sample progs as shown below:

    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..
  • sylvie369sylvie369 Posts: 1,622
    edited 2008-10-15 02:56
    Did you lose the "10" after the PAUSE in the transmitter code? That line should read "PAUSE 10".

    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
    .
    .
    .
  • proGodLik3proGodLik3 Posts: 13
    edited 2008-10-15 03:08
    yeah sorry i missed out the 10 while pastin it here but its in my prog.. and im very certain all my wiring is connected and yes the receiver is connected to the computer.. i dunno wats the prob.. the batteries are brand new.. maybe i will try it again later after removin the accelerometer and temp sensor.. hope it works.. but i doubt it will..
  • Mike GreenMike Green Posts: 23,101
    edited 2008-10-15 03:16
    The regulator on the Stamp module can only supply about 50mA and part of that is used by the Stamp itself. You realistically cannot provide power for other devices using the regulator on the Stamp module. They need their own regulator. This is especially true when you're powering the Stamp from 9V. The regulator has to dissipate the extra voltage (at the rated current) as heat and it doesn't really have a heatsink. It will quickly overheat and shut down. Look at the documentation for the various parts (like the transmitter, accelerometer, and temp sensor) and add up the current requirements. You'll see.
  • proGodLik3proGodLik3 Posts: 13
    edited 2008-10-15 03:25
    Oh ok which means i gotta provide seperate power supply for the temp sensor and the accelerometer.. for the transmitter i just tap the regulator from the bs2.. correct? ok i try and rewire and provide additional supply.. then retry and get back to u guys k.. thanks alot =)

    Post Edited (proGodLik3) : 10/15/2008 3:36:56 AM GMT
  • Mike GreenMike Green Posts: 23,101
    edited 2008-10-15 03:34
    That's not what I said
  • proGodLik3proGodLik3 Posts: 13
    edited 2008-10-15 03:36
    oh then wat am i supposed to do?
  • Mike GreenMike Green Posts: 23,101
    edited 2008-10-15 03:59
    "Look at the documentation for the various parts (like the transmitter, accelerometer, and temp sensor) and add up the current requirements."

    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.
  • proGodLik3proGodLik3 Posts: 13
    edited 2008-10-15 09:23
    max current requirements:

    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?
  • proGodLik3proGodLik3 Posts: 13
    edited 2008-10-16 00:28
    Hi Mike Green.. the value seems to be smaller than the 50mA u stated which comes out of the regulator pin on the basic stamp.. so wat is the problem?
  • $WMc%$WMc% Posts: 1,884
    edited 2008-10-18 03:07
    ·Hello proGodLik3

    ···· 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___
  • proGodLik3proGodLik3 Posts: 13
    edited 2008-10-18 11:00
    erm hello.. 1st of all its a transmitter and yeah i programmed it to the rite stamps.. and yeah i only need to receive stuff not transmit.. but i cant get it to work.. haiz
  • proGodLik3proGodLik3 Posts: 13
    edited 2008-10-18 11:45
    Ok i tried out and i think the transmitter is not working dunno its cause there is not enough supply or if its faulty :S i really need assistance on this its real urgent anyone who is good with this stuff willing to share their IM address hopefully MSN an guide me through.. pls
  • PJAllenPJAllen Banned Posts: 5,065
    edited 2008-10-18 13:46
    Suggest that you just work the transmit/receive angle·and then bring in that other jazz later.
    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
  • sylvie369sylvie369 Posts: 1,622
    edited 2008-10-18 14:19
    proGodLik3 said...
    Ok i tried out and i think the transmitter is not working dunno its cause there is not enough supply or if its faulty :S i really need assistance on this its real urgent anyone who is good with this stuff willing to share their IM address hopefully MSN an guide me through.. pls

    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.
  • proGodLik3proGodLik3 Posts: 13
    edited 2008-10-18 14:58
    sylvie369 thanks alot for ur advice.. yea i dont exactly understand the programming.. if would be helpful if u can send the transmitter side program with the Debug statements and then i give it a try and tell u the results can? [noparse]:)[/noparse]
  • proGodLik3proGodLik3 Posts: 13
    edited 2008-10-18 14:59
    PJ Allen yea there is 5v i check it already
  • sylvie369sylvie369 Posts: 1,622
    edited 2008-10-18 21:26
    proGodLik3 said...
    sylvie369 thanks alot for ur advice.. yea i dont exactly understand the programming.. if would be helpful if u can send the transmitter side program with the Debug statements and then i give it a try and tell u the results can? [noparse]:)[/noparse]

    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 SavageChris Savage Parallax Engineering Posts: 14,406
    edited 2008-10-21 21:40
    Your post really lacks a descriptive subject line. It is frowned upon to use subject lines like, “HELP!” and “Urgent!”. In the future please use a descriptive subject line in your posts.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Chris Savage
    Parallax Engineering
  • DeeLuxxDeeLuxx Posts: 14
    edited 2008-10-22 09:41
    Hey it would be REALLY helpful if you could post a pic of your circuit so we can see all your wiring etc. . .
Sign In or Register to comment.