Simple RF Transmit and Receive


Closed Thread
Results 1 to 40 of 43

Hybrid View

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


    Did you find this post helpful? Yes | No

    Default

    If you are connecting the receiver CD pin (pin 3) directly to PORTD.2, CD may not go high enough to be seen as HIGH by PORTD.2. That's why the transistor is needed and why you need to monitor /CD (refer to p6 of the PDF specs for the receiver).

    Look at the code I referenced earlier in Code Examples for how to encode/transmit and receive/decode a pulse train. It's all you need for this application. It sends two bytes. Both bytes are followed by their complement so some basic error detection is built in. One can be an ID and the other indicate motion or all clear. All clear is sent when motion is followed by a period with no motion plus every hour or so to indicate "all's well".

  2. #2


    Did you find this post helpful? Yes | No

    Default

    Dave, I will implement your code, thank you!

    Will it be possible for me to connect the Receiver's RF In Pin to the PC's Comm Port?

    Thx!!

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


    Did you find this post helpful? Yes | No

    Default

    Quote Originally Posted by koossa View Post
    Will it be possible for me to connect the Receiver's RF In Pin to the PC's Comm Port?
    No. The Receiver RF IN pin is where you connect the antenna.

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


    Did you find this post helpful? Yes | No

    Default

    Quote Originally Posted by koossa View Post
    Will it be possible for me to connect the Receiver's RF In Pin to the PC's Comm Port?
    No. The Receiver RF IN pin is where you connect the antenna.

  5. #5


    Did you find this post helpful? Yes | No

    Default

    What I mean is the RXD pin, can I connect it to the PC's Comm port.
    Or do I have the wrong understanding of the RXD pin?

  6. #6
    Join Date
    Oct 2007
    Posts
    8


    Did you find this post helpful? Yes | No

    Default

    Hi....I'm new here and a beginner in PICBasic Pro...

    I'm using PIC 16F877A for Tx and Rx project also....what is the simple code for Tx and Rx?

    Thanks a lot....

  7. #7


    Did you find this post helpful? Yes | No

    Default

    Dave

    In your code for the receiver there is a pin for the pulsout, GPIO.1.
    Is this the CD Pin?

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


    Did you find this post helpful? Yes | No

    Default

    If you continue to use SerOut with the transmitter, then the receiver RXD pin output timing will be the same as RS232 but the polarity will depend on what polarity you use at the transmitter. The COM port on a PC expects inverted polarity.

    However, the RF link in the example code I'm suggesting is not RS232 compatible. It is an example of the NEC protocol which is widely used for remote control and for applications like yours. X-10 uses it for all of their RF applications, including motion sensors. For an RF link it's much simpler to implement than SerIn/SerOut and is very reliable for small amounts of data. It does use Debug to output the received codes to a PC serial port. See the PBP manual for how to implement this.

    I think you mean GPIO.1 and PulsIn. That is equivalent to your RXD pin. The code was written for ASK modules which have no CD so you can ignore CD if you try to adapt my code.

Similar Threads

  1. rf problem
    By -Dan- in forum General
    Replies: 9
    Last Post: - 20th November 2007, 16:05
  2. 16F876 Usart Receive
    By syscoder in forum mel PIC BASIC Pro
    Replies: 7
    Last Post: - 21st March 2007, 15:43
  3. Help with CC1100 RF Modules.
    By charudatt in forum mel PIC BASIC Pro
    Replies: 13
    Last Post: - 27th November 2006, 20:58
  4. USB Interface using PIC
    By Tissy in forum mel PIC BASIC Pro
    Replies: 21
    Last Post: - 22nd May 2006, 16:04
  5. RF Transmitter
    By et_Fong in forum mel PIC BASIC Pro
    Replies: 4
    Last Post: - 27th October 2005, 16:34

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