Simple RF Transmit and Receive


Closed Thread
Results 1 to 40 of 43

Hybrid View

  1. #1


    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?

  2. #2
    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.

  3. #3


    Did you find this post helpful? Yes | No

    Default

    Dave

    I am busy implementing your code and all your suggestions.
    What must the Comm. port settings be on the PC Side (see attachment)?
    I'm using MS Terminal to monitor the incoming data on the PC.
    Attached Images Attached Images  

  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
    What must the Comm. port settings be on the PC Side (see attachment)?
    9600 8N1 - See the Define statements in my example.
    Code:
    DEFINE DEBUG_REG GPIO
    DEFINE DEBUG_BIT 2 				'GPIO.2
    DEFINE DEBUG_MODE 1 				'Inverted
    DEFINE DEBUG_BAUD 9600
    You will need to change DEBUG_REG and DEBUG_BIT to reflect the pin you use for output to the PC. I wrote this for a 12F629.

  5. #5


    Did you find this post helpful? Yes | No

    Default

    Ok, so my settings is correct, but it does not work?
    I will upload my new schematics and code.
    Mayby I have missed something.

  6. #6


    Did you find this post helpful? Yes | No

    Default

    Dave

    I have updated my Schematics and used your source code.
    I have made a couple of mods on the code, but it does not seem to work, don't know if I have missed something.

    I am using MS Terminal to view the incomming data on the PC. The data did only came through once and it was a couple of junk characters.

    Thank you very much for all your help!!
    Attached Images Attached Images

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


    Did you find this post helpful? Yes | No

    Default

    In your schematic, change both 22K resistors to 1K. These merely limit the current to what is safe. 5V / 1000R = 0.005A (5mA). The 22K is needed only when the voltage is higher as with an input from a PC using RS232 voltage levels. Here, all the voltages are 5V max.

    In the code, comment out IF (space<40) OR (space>175) THEN init.

    In the code, modify DEBUG (RF[i] REV 8) to send either hex or decimal representations of the bytes. I'll let you consult the manual for details. My code sends the Ascii byte values which may not all be printable characters, especially in MS Terminal.

    HEX 50 AF 42 DB
    DEC 80, 175, 66, 189
    ASC P, », B, ╜

    The protocol is explained at http://davehouston.net/rf.htm
    Last edited by dhouston; - 26th October 2007 at 17:20.

Similar Threads

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