Shop OBEX P1 Docs P2 Docs Learn Events
RF UART Code for Transmitter — Parallax Forums

RF UART Code for Transmitter

Jeff_5_Jeff_5_ Posts: 36
edited 2011-11-20 12:07 in Accessories
I an having trouble sending a four byte data array wirelessly with my 433mhz transmitter and receiver. I want to send it at 9600kps. I can read one tag fine but my problem is when i try to read two tags at the same time. It seems the receiver just locks up. I have a pic programed with PIC basic for my transmitter. The reciever is connected right to my basic stamp . Here is the code for the transmitter.

TAG1

Include "modedefs.bas"

ANSEL = %00000000 '
SEND VAR PORTA.4
LED Var PORTA.2
Code Var Byte[4]
mainloop:
code(0)="!"
Code(1)="0"
Code(2)="0"
Code(3)="1"

high SEND
Serout2 PORTA.5, 9600, [str Code\4]
low SEND
Goto mainloop

End

TAG 2

Include "modedefs.bas"

ANSEL = %00000000 '
SEND VAR PORTA.4
LED Var PORTA.2
Code Var Byte[4]
mainloop:
code(0)="!"
Code(1)="0"
Code(2)="0"
Code(3)="2"

high SEND
Serout2 PORTA.5, 9600, [str Code\4]
low SEND
Goto mainloop

End

Tag1 is !001 Tag2 is !002

Here is the code to read the tag in to my basic stamp.

SERIN 3,9600,[ STR Tag\4]
DEBUG STR Tag, CR

My problem is i cant read both tags at the same time. It will read each tag by its self just fine, Also it acts kind of funny in the debug window at 9600 but works fine at 2400.

Comments

  • Mike GreenMike Green Posts: 23,101
    edited 2011-11-20 07:33
    What do you mean by "both tags at the same time"? If you have two transmitters and one receiver, that won't work when both transmitters are on. They interfere with each other.

    Also, the transmitter / receiver pair is marginal at 9600 Baud. It works better at lower speeds (like 2400 Baud or 4800 Baud) and really requires some kind of error checking even at the lower speeds.
  • Jeff_5_Jeff_5_ Posts: 36
    edited 2011-11-20 12:07
    Yes mike i have two transmitters and one receiver. The whole idea behind the circuit is to read in and program a transmitter code and then just check to see if its still in range from the receiver. But i need to make sure that if another transmitter is read by the receiver it wont interfere with the programed one. The problem is my receiver wont read both the transmitters when they are both on. It can read both of them at 2400bps but not at 9600 bps. It will read on just fine at 9600 but when i turn on the other it will lock up. Like i said it works fine at 2400 but it dosnt run fast enough. The FCC says that on 433mhz i can only transmitter for a total of 2 seconds every hour. i want to transmit a code every 3 seconds at most 5 seconds. My transmit data is 4 bytes or 32 bits "!001" so im not sure how i can do this and comply with the FCC.
Sign In or Register to comment.