RF Transmitter/Reciver


Closed Thread
Results 1 to 40 of 76

Hybrid View

  1. #1
    Join Date
    Oct 2004
    Location
    Italy
    Posts
    695


    Did you find this post helpful? Yes | No

    Default

    Before you test with the RF modules, make sure that your system works when the
    two microcontrollers are connected with a 1k ohm resistor.
    Make sure that the two PIC microcontrollers share the same ground. (GND).

    Code:
    PIC #1                 PIC #2
                 1k
    TX Pin-----/\/\/\------RX pin
    
    GND -------------------GND
    Both microcontrollers must use inverted logic.

  2. #2
    Join Date
    Jan 2008
    Location
    Sweden
    Posts
    187


    Did you find this post helpful? Yes | No

    Default

    I have done the Test now.. and here we have the problem

    It dosen´t work whit the BS2 code (SERIN2/SEROUT2) whit wires between the pic´s but the other code whit SERIN and SEROUT works fine.

    What could be the problem?

    Code:
    SERIN2 reciverpin, 16468, [WAIT("!"),Counter]
    Code:
    PULSOUT TransmitterPIN, 1200 
    SEROUT2 TransmitterPIN, 16468, ["!",Counter]
    i´m not sure if the "16468" in the BS2 program shold be the same in a PBP program, i dont understand how to set those bits. but if there shold be "16468" then what else could be wrong?

    EDIT:
    Just find that 9600 baud may be unreliable with 4MHz clock, but it´s still not working when i try to lower the baud to 2400.
    It´s not working in inverted mode whit both SERIN/SEROUT and SERIN2/SEROUT2

    http://www.microengineeringlabs.com/.../ser2modes.htm

    What are i´m doing wrong?

    EDIT2:
    Can it have someting to do whit that i´m using a 4MHz inernal RC on the transmitter? shold i clock it up to 20MHz whit an external crystal like the reciver?
    Last edited by Fredrick; - 17th February 2008 at 00:31. Reason: More info

  3. #3
    Join Date
    Oct 2004
    Location
    Italy
    Posts
    695


    Did you find this post helpful? Yes | No

    Default

    Hi Fredrick,

    A sync pulse of 3000 µs is what is used in the BS1 example visible at page 5 of this doc:
    http://www.parallax.com/Portals/0/Do...ceive-v1.0.pdf
    (In the BS1 sample code the baud rate is 2400).

    I am not a PicBasic Pro user or a Basic Stamp user, so what I can do is very limited
    and based only on the user manuals.

    Here is my version of the PBP code:

    Code:
    ' Transmitter code 
    ' (Clock = 4MHz).
    '
    ' At 4MHz, a PULSEOUT of 300 is OK. 
    ' 300 * 10 µs = 3000 µs 
    ' (See PBP Manual PULSEOUT). 
    '
    ' BAUD MODE = 16780 (Baud rate 2400, 8-bit, no-parity, inverted, output DRIVEN).
    '
    '
    PULSOUT TransmitterPIN, 300  ' sync pulse of 3000 µs 
    SEROUT2 TransmitterPIN,16780,["!",Counter] 
    '

    Code:
    ' Receiver code 
    ' (Clock = From 4MHz to 20 MHz).
    '
    ' BAUD MODE = 16780 (Baud rate 2400, 8-bit, no-parity, inverted).
    '
    '
    SERIN2 reciverpin, 16780, [WAIT("!"),Counter]
    '

    Best regards,

    Luciano

  4. #4
    Join Date
    Jan 2008
    Location
    Sweden
    Posts
    187


    Did you find this post helpful? Yes | No

    Default

    Does´t work....

    The PIC (16F872) stops at
    SERIN2 reciverpin, 16780, [WAIT("!"),Counter]

    Is there a bug in PBP like the one whit OWOUT that make a never ending loop
    I have version PBP 2.50a

    http://www.picbasic.co.uk/forum/show...79&postcount=4

    Note that both SERIN and SERIN2 make´s the PIC stops when i try to use them whit Inverted mode. whit SERIN and True mode it works..

    UPDATE:
    When i remove "PULSOUT TransmitterPIN, 300" it works....... ??
    Last edited by Fredrick; - 17th February 2008 at 13:30.

  5. #5
    Join Date
    Oct 2004
    Location
    Italy
    Posts
    695


    Did you find this post helpful? Yes | No

    Default

    Hi Fredrick,

    Here is how you can test the TX code and the RX with a terminal emulator.

    * * *

    You can test the TX code if you connect the PIC to the serial
    port of your PC. The 1k resistor is mandatory.

    Open your terminal emulator with these settings:

    2400 baud, 8 data bits, No-parity, 1 stop bit.


    Code:
    '                       1k
    ' PIC TX pin ---------/\/\/\---------- DB9 (Pin 2) RS232 port RX data
    '
    '
    ' PIC GND -----------------------------DB9 (pin 5) RS232 port GND 
    '
    '
    '
    Counter = 65  '65 = character A
    SEROUT2 TransmitterPIN,16780,["!",Counter]
    If you run this code you should see in the terminal emulator: !A


    * * *


    You can test the RX code if you connect the PIC to the serial
    port of your PC. The 22k resistor is mandatory.

    Open your terminal emulator with these settings:

    2400 baud, 8 data bits, No-parity, 1 stop bit.


    Code:
    '                       22k
    ' PIC RX pin ---------/\/\/\---------- DB9 (Pin 3) RS232 port TX data
    '
    '
    ' PIC GND -----------------------------DB9 (pin 5) RS232 port GND 
    '
    '
    '
    SERIN2 reciverpin, 16780, [WAIT("!"),Counter]
    After you run the code you must type !A in the terminal emulator.

    * * *

    Note that this direct connection with series resistors works only if you
    use Inverted logic for SEROUT2 and SERIN2.

    Best regards,

    Luciano

  6. #6
    Join Date
    Jan 2008
    Location
    Sweden
    Posts
    187


    Did you find this post helpful? Yes | No

    Default

    I give upp now..... Inverted mode does not work but True mode work just fine whit SERIN, i think it has someting to do whit noise in the air becous when i hold my hand over the antenna of the reciver it works a better but not good.

    My solution will be to pull down PDN line when i don´t want to transmitt and pull it high when i want to transmitt or just drive the hole modul from an +5v high PIN on the PIC that is active when i want to transmitt and then pull it low.

    Transmitter supply current is 5.2 mA so a pin from the 16F628A that have 20mA is enought.

    Then i can use True mode whitout have an RF carrier when i don´t send.

  7. #7
    Join Date
    Jan 2008
    Location
    Sweden
    Posts
    187


    Did you find this post helpful? Yes | No

    Default

    The maximun output power for the transmitter is 14DBm or 25.11mW
    Is that correct?

    http://www.linxtechnologies.com/Docu...Data_Guide.pdf

Similar Threads

  1. Generic RF Receiver
    By dhouston in forum Code Examples
    Replies: 0
    Last Post: - 8th September 2009, 14:35
  2. Interfacing 16F88 to RF module
    By scomi85 in forum General
    Replies: 2
    Last Post: - 19th February 2009, 12:52
  3. Help with CC1100 RF Modules.
    By charudatt in forum mel PIC BASIC Pro
    Replies: 13
    Last Post: - 27th November 2006, 20:58
  4. RF designs
    By Travin77 in forum mel PIC BASIC Pro
    Replies: 3
    Last Post: - 14th June 2006, 07:50
  5. Interfacting RF Module
    By rastan in forum General
    Replies: 8
    Last Post: - 10th November 2004, 22:27

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