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

    What is a typical application for a FSK chip?

  2. #2


    Did you find this post helpful? Yes | No

    Default

    I have updated my circuit to monitor the CD pin on the Receiver
    If high, I turn on an LED, but the LED switch on about every 10 seconds while the transmitter is still switched off?

  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
    I have updated my circuit to monitor the CD pin on the Receiver
    If high, I turn on an LED, but the LED switch on about every 10 seconds while the transmitter is still switched off?
    I'm not sure what you're saying. If you are using the recommended circuit (p6 of the PDF), the /CD signal goes low when there is a signal.

  4. #4


    Did you find this post helpful? Yes | No

    Default

    Oops!!
    I must have missed it and just assumed it must be high, sorry!

    Will this code do the job to just test the CD pin functioning?
    <code>
    ........
    &nbsp;IF CDPin = 0 THEN
    &nbsp;&nbsp;&nbsp;&nbsp;HIGH LEDPin
    &nbsp;&nbsp;&nbsp;&nbsp;Pause 1000
    &nbsp;&nbsp;&nbsp;&nbsp;LOW LEDPin
    &nbsp;&nbsp;&nbsp;&nbsp;PAUSE 1000
    &nbsp;ENDIF
    .......
    </code>

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


    Did you find this post helpful? Yes | No

    Default

    Pin 3 (CD) probably doesn't have enough swing to be sensed directly by a PIC pin. That's why the transistor is needed. In effect, it amplifies and inverts CD.

    I'm not sure what you want the LED to indicate. I would just capture and decode the RXD pin whenever /CD is low. What you get on RXD should match what you send with the transmitter.

    The PDF file says the CD signal has a fast response but doesn't say how fast. Instead of trying to use serin/serout I would first just look at the pulsetrain to determine if CD is fast enough that you won't miss bits.

  6. #6


    Did you find this post helpful? Yes | No

    Default

    Dave

    Thank you for all your help

    I'm not sure I know how to do this?
    Must I use something like the Pulsin command, I have not done this before?

    The PDF file says the CD signal has a fast response but doesn't say how fast. Instead of trying to use serin/serout I would first just look at the pulsetrain to determine if CD is fast enough that you won't miss bits.
    <hr>

    I am using the LED just to test if it goes low if I send data with the transmitter, just to make sure my circuit is wired correctly and that it only works if my receiver is sending data.

    I have added 2 LEDs for debugging purposes.
    A green one on PortB.4 and a Red one on PortB.5
    If CD is low, the green LED will blink, if CD is high, the Red LED will blink.
    While the transmitter is still powered down, I switch on the receiver, and the Green LED just constantly blink on and off, which tells me that the CD is Low from the beginning?
    When I then swith the Transmitter on and send data, the Green LED still blink at the same frequency?

    I'm not sure if I am missing something, but I am still in the amateur student phase.

    Here is my code.

    <code>
    '************************************************* ***************
    '* Name&nbsp;&nbsp;: Receiver.bas&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&n bsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbs p;&nbsp;&nbsp;&nbsp; *
    '************************************************* ***************

    Include "modedefs.bas"

    DEFINE&nbsp;&nbsp;&nbsp;&nbsp; OSC&nbsp;&nbsp; 4&nbsp;&nbsp;&nbsp;&nbsp; ' Set the Xtal frequency
    SerialInPin&nbsp;&nbsp; VAR&nbsp;&nbsp; PORTC.2 ' Serial Out
    LEDPin&nbsp;&nbsp;&nbsp;&nbsp; Var&nbsp;&nbsp; PORTC.3
    REDLed&nbsp;&nbsp;&nbsp;&nbsp; VAR&nbsp;&nbsp; PORTB.5
    GreenLED&nbsp;&nbsp;&nbsp;&nbsp;VAR&nbsp;&nbsp; PORTB.4
    CDPin&nbsp;&nbsp;&nbsp;&nbsp; VAR&nbsp;&nbsp; PORTD.2
    DATAReceived&nbsp;&nbsp;VAR&nbsp;&nbsp; Byte
    I&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; VAR&nbsp;&nbsp; BYTE
    ADCON1 = 7

    Main:
    HIGH LEDPin
    Pause 5000
    Low LEDPin
    &nbsp;&nbsp;
    Loop:

    &nbsp;&nbsp;IF CDPin = 0 THEN
    &nbsp;&nbsp;&nbsp;&nbsp;HIGH GreenLED
    &nbsp;&nbsp;&nbsp;&nbsp;Pause 100
    &nbsp;&nbsp;&nbsp;&nbsp;LOW GreenLED
    &nbsp;&nbsp;&nbsp;&nbsp;PAUSE 100
    &nbsp;&nbsp;else
    &nbsp;&nbsp;&nbsp;&nbsp;HIGH REDLed
    &nbsp;&nbsp;&nbsp;&nbsp;Pause 100
    &nbsp;&nbsp;&nbsp;&nbsp;LOW REDLed
    &nbsp;&nbsp;&nbsp;&nbsp;PAUSE 100
    &nbsp;&nbsp;ENDIF
    Goto LOOP

    END
    </code>

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

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


    Did you find this post helpful? Yes | No

    Default

    Quote Originally Posted by koossa View Post
    What is a typical application for a FSK chip?
    FSK is needed when higher data rates are desired. The pair you're using can go as high as 160kbps while ASK modules are usually limited to 4-8kbps. In simple terms, ASK is like AM radio which is subject to interference while FSK is like FM which has better noise rejection.

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