Shop OBEX P1 Docs P2 Docs Learn Events
433MHz RF Modules and USB2SER - HELP! — Parallax Forums

433MHz RF Modules and USB2SER - HELP!

ChristianChristian Posts: 10
edited 2006-08-26 17:33 in BASIC Stamp
I am trying to use a USB2SER connected to a 27981 reciever and 27980 transmitter to talk to a BOE that is also equipped with a 27981 and 27890. I can't seem to make it work and I'm not sure how the Tx/RX modules wouldn't be confused anyway (i.e.·a transmission from the·USB2SER transmitter might be recieved by both the USB2SER and BOE recievers).

My configuration is as follows:
1. BOE Vdd connected to 5V inputs of all transmitters and receivers
2. BOE Vss connected to GND on all transmitters and receivers
3. BOE pin 0 connected to reciever A
4. BOE pin 1 connected to transmitter A
5. USB2SER RX connected to reciever B
6. USB2SER TX connected to transmitter B

These are all direct connects and there are no other wires or equipment wired in.

I programmed the BS2 with the following code:
x VAR Word
y VAR Word

DO
·· PULSOUT 1, 1200
·· SEROUT 1, 16468, [noparse][[/noparse]"!", x.HIGHBYTE, x.LOWBYTE, y. HIGHBYTE, y.LOWBYTE]
·· x=x+1
·· y=y+1
·· DEBUG ? x
·· PAUSE 10
LOOP

I then used the StampDAQ program connected to COM 4 (USB2SER) to attempt to recieve data. I notice in the debug window that I see x=1 and then nothing else. Also the StampDAQ shows no input. Am I doing something wrong?

My end goal is to send a signal from the PC, recieve it with the BOE, then transmit a response, and finally recieve that response on the PC and display the value. Can anyone help with this?

Comments

  • Chris SavageChris Savage Parallax Engineering Posts: 14,406
    edited 2006-08-21 14:22
    Hello,

    ·· Perhaps you should confirm that you are continually receiving data outside of StampDAQ, perhas using the Stamp Editor DEBUG Window.· That would be a good place to start.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Chris Savage
    Parallax Tech Support
    csavage@parallax.com
  • ChristianChristian Posts: 10
    edited 2006-08-22 03:15
    Perhaps I misunderstood the post, but as I said previously, the debug only shows x=1 and then stops. Since I don't have a STOP line in my code, I think I am only getting the first shot, if any.
  • ChristianChristian Posts: 10
    edited 2006-08-22 03:19
    I tired it again and realized that the x=1 is not being sent, it is just a code output. I don't have a code to read from the USB2SER outside of STAMPDaq. Is there some other way to access the USB2SER and read the input?
  • ChristianChristian Posts: 10
    edited 2006-08-22 03:40
    I wrote a simple serial comm control in C# using the following read statement:

    if (serialPort1.IsOpen)

    {

    textBox2.Text = serialPort1.ReadExisting();

    }

    I saw the following output in the recieve text box: [noparse][[/noparse][noparse][[/noparse]???[noparse][[/noparse]?

    It only showed up after pressing the reset button on the basic stamp, so I think I am getting a signal. I'm just not sure what the signal means. After continual recieves, I get no response unless I reset the basic stamp. Each time I reset, I get another response. The basic stamp program is as follows:

    '{$STAMP BS2}
    '{$PBASIC 2.0}
    '{$PORT COM1}
    x VAR Word
    y VAR Word
    DO
    · PULSOUT 1, 1200
    · SEROUT 1, 16468, [noparse][[/noparse]"!", x.HIGHBYTE, x.LOWBYTE, y.HIGHBYTE, y.LOWBYTE]
    · x=x+1
    · y=y+1
    · PAUSE 10
    · DEBUG· ? x
    LOOP

    It almost seems like it doesn't get the DO loop.
  • ChristianChristian Posts: 10
    edited 2006-08-24 03:40
    Still need some help. How do I make sure that what I transmit is not recieved and processed·by both recievers? Are there any exmaple programs for using the USB2SER with a 27891 and 27890 to communicate with a BS2 that also has a·27891 and 27890?
  • ChristianChristian Posts: 10
    edited 2006-08-26 16:47
    Well, I figured out that PBASIC 2.0 doesn't seem to support DO Loops. I inserted the following line into the code and the transmit looped: '{$PBASIC 2.5}. The recieve program still does not seem to work. I have a C# program that contains a text box. When I press send in C# the contents of the test box are "!1234". This is sent as text to the 27891 on the BOE board. Is this the correct string to send·for the following reciever code?

    Sending the string "!1234" from Com4

    '{$STAMP BS2}
    '{$PBASIC 2.5}
    '{$PORT COM1}
    x VAR Word
    y VAR Word

    PAUSE 100
    DO
    SERIN 2, 16468, [noparse][[/noparse]WAIT("8"), x.HIGHBYTE, x.LOWBYTE, y.HIGHBYTE, y.LOWBYTE]
    DEBUG ? x
    DEBUG ? y
    LOOP
  • ChristianChristian Posts: 10
    edited 2006-08-26 17:33
    I was finally able to get some communication with the USB2SER transmitting and the BOE board recieving, but I can't quite understand the language.

    I loaded the following into the basic stamp:
    '{$STAMP BS2}
    '{$PBASIC 2.5}
    '{$PORT COM1}
    x VAR Byte
    DO
    SERIN 2, 16468, [noparse][[/noparse]x]
    DEBUG ASC ? x
    LOOP

    I then opened hyperterm and typed 1. The debug screen shows the following:

    x="E" where·E is a character that I cannot type into this message box.

    Typing 2 returns the same character as 1. Typing 3 returns just ". Typing lower case a returns the same as 1 and 2.

    Any ideas as to what is going on?
Sign In or Register to comment.