RF link


Closed Thread
Results 1 to 15 of 15

Thread: RF link

  1. #1
    Join Date
    Aug 2007
    Posts
    15

    Default RF link

    im currently using a pic16f88 and have a rtfq1 (tx) and a rrfq1 (rx) and i simply want to transmit an identifier (so that the receiver knows it is data from the tx) and either a 1 or 0 on the end of the string to perform and action when a 1 is received at the other end, but im am new to this and need some help.

    I have looked at Ioannis code for the manchester encoding, but i am kind of stuck. Any help would be greatly appreciated. Thanks

  2. #2
    Join Date
    Nov 2003
    Location
    Greece
    Posts
    4,115


    Did you find this post helpful? Yes | No

    Default

    First of all, check if you have a good pin to pin link of the 2 PIC you are using and then move on to RF link.

    Second, a schematic and your up to this moment code would be needed to debug your errors. As I stated in another thread, we cannot provide a solution in a plate...

    Ioannis

  3. #3
    Join Date
    Aug 2007
    Posts
    15


    Did you find this post helpful? Yes | No

    Default

    how do you go about going from pic to pic then. I am planning to use the usart on the pic but dont really know how to use serial communications.

  4. #4
    Join Date
    Nov 2003
    Location
    Wellton, U.S.A.
    Posts
    5,924


    Did you find this post helpful? Yes | No

    Default

    For sending
    First the receiver needs "trained" by sending 01010101.....
    Then send in this example "9" then the next character is used to do something.
    Code:
    TRAIN	VAR BYTE
    
    TRAIN=$55
    SEROUT PORTC.4,T2400,[TRAIN,TRAIN,TRAIN,TRAIN,TRAIN,9,3]
    For receiving
    Code:
    net 	VAR WORD
    SERIN PORTC.4,T2400,[9],net
    IF net = 3 THEN DO SOMETHING
    This is the basics, when you get this working try for some type of encoding.
    Dave
    Always wear safety glasses while programming.

  5. #5
    Join Date
    Nov 2003
    Location
    Greece
    Posts
    4,115


    Did you find this post helpful? Yes | No

    Default

    Quote Originally Posted by n qwerty View Post
    how do you go about going from pic to pic then.
    Just put a wire from the transmitter pic to the receiver pic!

    Quote Originally Posted by n qwerty View Post
    I am planning to use the usart on the pic but dont really know how to use serial communications.
    Hmm, what projects have you already completed with success in PBP?

    Ioannis

  6. #6
    Join Date
    Aug 2007
    Posts
    15


    Did you find this post helpful? Yes | No

    Default

    thanks for the advice, admittedly im not that experienced with pics but have done a couple of projects using them. Will try training the receiver and hopefully i get some good results.

  7. #7
    Join Date
    Nov 2003
    Location
    Wellton, U.S.A.
    Posts
    5,924


    Did you find this post helpful? Yes | No

    Default

    The first step is to setup communications with wires, then go for the RF.
    Dave
    Always wear safety glasses while programming.

  8. #8
    Join Date
    Nov 2003
    Location
    Greece
    Posts
    4,115


    Did you find this post helpful? Yes | No

    Default

    As macrackit stated, taken it easy. RF link is a medium to difficult project. Start by doing simple steps, one at a time.

    Send one character from the Tx pic to the Rx pic with wires.

    Then use some sort of encoding.

    Then use some sort of CRC or Checksum stuff.

    Then move on RF link.

    All the above steps are well documented in the forum threads.

    Ioannis

  9. #9
    Join Date
    Aug 2007
    Posts
    15


    Did you find this post helpful? Yes | No

    Default n qwerty

    Using the FM-RTFQ1-433 transmitter and a FM-RRFQ1-433CTC receiver to send some data across a short range from one PIC to another. Using the code above

    Tx code

    include "modedefs.bas"

    TRISA=%00000000
    TRISB=%00001000

    OPTION_REG.7=0 'Enable Pull-Up's on PORTB

    ANSEL = 0 'turns off analogue inputs

    OSCCON =$60 'sets internal osc to 4MHz

    TRAIN VAR BYTE

    PORTB.4 = 1 'turn enable pin high
    TRAIN=$55

    SEROUT PORTB.5,T2400,[TRAIN,TRAIN,TRAIN,TRAIN,TRAIN,9,3]

    goto main

    Rx code (part of)

    test VAR WORD
    SERIN PORTC.7,T2400,[9],test
    IF test = 3 THEN

    T1CON.0 = 1 ‘start timer module


    When I try this code using a wire from pic to pic the timer starts but when I try to send the data over the rf link the timer doesn’t work. I can see the data out on the receiving module and I know rf is present since I have connected it to a spectrum analyser and there is a nice peak at 433Mhz. The pins have supply voltage and ground where required. Is there anything in particular that I am doing wrong in order to get the rf link to work?

    Any help would be good since im getting stuck

    Thanks

  10. #10
    skimask's Avatar
    skimask Guest


    Did you find this post helpful? Yes | No

    Default

    Is there anything in particular that I am doing wrong in order to get the rf link to work?
    vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv vvvv
    OSCCON =$60 'sets internal osc to 4MHz
    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

    I might not know what's wrong...but I know what's probably not helping matters any...

  11. #11
    Join Date
    Aug 2007
    Posts
    15


    Did you find this post helpful? Yes | No

    Default

    yes, sorry my mistake.

    I have taken that bit of code out but it still doesnt work.

    Well, it does work occasionally when disconnecting and then connecting the power to the transmitting circuit, but it seems very unreliable that it may as well not work, but at least i no it is receiving data sent across the rf link. Is there something to make it more reliable. I have tried several different baud rates and pre ambles but nothing seems to make it more reliable.

    thanks

  12. #12
    Join Date
    Nov 2003
    Location
    Wellton, U.S.A.
    Posts
    5,924


    Did you find this post helpful? Yes | No

    Default

    I agree with Mr.mask. Lucky the internal osc works with wires, RF is even more touchy.

    If changing the osc does not help, test the RF.

    The 010101... is for setting up the receiver for serial input. Test the RF by sending a HIGH and then a LOW. Have maybe a half second pause between the signals.
    Dave
    Always wear safety glasses while programming.

  13. #13
    Join Date
    Dec 2005
    Posts
    1,073


    Did you find this post helpful? Yes | No

    Default

    Quote Originally Posted by n qwerty View Post
    Using the FM-RTFQ1-433 transmitter and a FM-RRFQ1-433CTC receiver to send some data across a short range from one PIC to another. Using the code above the timer starts but when I try to send the data over the rf link the timer doesn’t work. I can see the data out on the receiving module and I know rf is present since I have connected it to a spectrum analyser and there is a nice peak at 433Mhz. The pins have supply voltage and ground where required. Is there anything in particular that I am doing wrong in order to get the rf link to work?
    See p4 of the datasheet for the receiver. The RSSI pin outputs a voltage that is proportional to the received signal strength. This should be zero in the absence of a signal. You can use it with an ADC pin to determine when a signal is being received or amplify it and use it as a Carrier Detect signal.. Since these are FSK (i.e. FM), I would dispense with the TRAIN,TRAIN,TRAIN chain (personally, I dispense with it for ASK, also). What is the application?

    EDIT: If you are not using the pins for something else, you can use one of the 16F88 comparators to create a CD (carrier Detect) signal. With the RSSI pin as one input and the other input to GND, configure the comparator so the output is high when there's a signal and low when there's no signal.
    Last edited by dhouston; - 5th March 2008 at 17:29.

  14. #14
    Join Date
    Aug 2007
    Posts
    15


    Did you find this post helpful? Yes | No

    Default

    ok thanks for the advice, i will give it a try and no doubt will be back on here.

  15. #15
    Join Date
    Nov 2003
    Location
    Greece
    Posts
    4,115


    Did you find this post helpful? Yes | No

    Default

    Quote Originally Posted by n qwerty View Post
    ...
    '
    SEROUT PORTB.5,T2400,[TRAIN,TRAIN,TRAIN,TRAIN,TRAIN,9,3]

    goto main
    1. Where is <main>?

    2. As I stated on post #8 you have to take specific steps.
    a. Did you implement some sort of encoding? (Manchester or Bi-phase?)
    b. Did you implement some sort of error detection (Checksum or CRC?)
    c. If the transmission was not succesful, do you have any way to re-transmit the packet?

    All of the above are documented on the forum. Use the google search tool that D. Taylor has offered to all (http://www.picbasic.co.uk/forum/showthread.php?t=4751).

    Ioannis

Similar Threads

  1. RF Modules (Zigbee)
    By Chris Barron in forum mel PIC BASIC Pro
    Replies: 10
    Last Post: - 4th March 2010, 18:28
  2. RF Code example + BOD + POR
    By financecatalyst in forum mel PIC BASIC Pro
    Replies: 2
    Last Post: - 14th January 2009, 18:24
  3. pic to pic ir link versus wired link : help please anyone
    By xnihilo in forum mel PIC BASIC Pro
    Replies: 13
    Last Post: - 30th May 2008, 21:01
  4. RF Transceiver modules help
    By davewanna in forum mel PIC BASIC Pro
    Replies: 3
    Last Post: - 16th May 2008, 14:54
  5. Serout And Serin Via Rf Link
    By MARAD75 in forum mel PIC BASIC Pro
    Replies: 4
    Last Post: - 27th April 2007, 22:19

Members who have read this thread : 0

You do not have permission to view the list of names.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts