rf problem


Closed Thread
Results 1 to 10 of 10

Thread: rf problem

  1. #1
    Join Date
    Jul 2007
    Posts
    38

    Default rf problem

    HI

    i'm using the

    AM-RT4-433 - 433mhz Am transmitter module and the
    AM-HRR3-433 - 433mhz am receiver

    i am experimenting with sending data wirelessly from one pic to another,
    but i do not receive anything on the receive end when using these am modules.


    Code:
    serout2 portb.1,n2400,[$55,$55,$60,transmit_data]
    
    serin2 portb.0,n2400,[wait($60),data_received]
    above are extract's from my transmit and receive code, there how i'm transmitting and receiving, this works via a wire link but not with these modules?

    am i missing something, do i have to change anything if my data is being sent wirelessly

    Thanks.

  2. #2
    Join Date
    Sep 2004
    Location
    montreal, canada
    Posts
    6,898


    Did you find this post helpful? Yes | No

    Default

    If you're using 1 PIC, your example is not going to work as it can't receive at the same time he send. Using the PIC hardware Usart may work with some tricks such as USART interrupt.

    As always, your PIC # and schematic would be welcome

    Make sure your module are not to close from each other, your supply lines are clean/noise free, and the output signal of your receiver is also noise free in idle mode.
    Last edited by mister_e; - 20th November 2007 at 14:42.
    Steve

    It's not a bug, it's a random feature.
    There's no problem, only learning opportunities.

  3. #3
    Join Date
    Jul 2007
    Posts
    38


    Did you find this post helpful? Yes | No

    Default

    sorry if i worded my post wrong, i am using 2 pic's one to transmit, and one to receive.

    it works with a direct link between the two mcu's

    and i'm using the good old 16f84a just wanted to start off simple


    transmitter code
    Code:
    include "modedefs.bas"
    
    
    
    'transmitter on portb.1
    
    trisb.1=0
    
    transmit_data var byte
    restart_counter var byte
    
    restart_counter=0
    
    init:
    
    pause500
    lcdout "Serial"
    lcdout $fe,$c0, "Transmitter"
    pause 1000
    main:
    
    for transmit_data=0 to 100
    serout2 portb.1,n2400,[$55,$55,$60,transmit_data]
    pause 500
    lcdout $fe,1
    lcdout "Transmitting"
    lcdout $fe,$c0,dec3 transmit_data, " "
    if transmit_data=100 then restart_timer
    next transmit_data
    goto main
    
    
    restart_timer:
    pause 500
    lcdout $fe,1 ' clear lcd
    for restart_counter=0 to 10
    lcdout "Data sent"
    lcdout $fe,$c0, "restart in10:",dec2 restart_counter," "
    pause 500
    if restart_counter=10 then main
    next restart_counter
    goto restart_timer
    receiver code

    Code:
    include "modedefs.bas"
    
    'receiver on portb.0
    
    trisb.0=1
    
    data_received var byte
    
    data_received=0
    
    init:
    pause500
    lcdout "Serial Data"
    lcdout $fe,$c0, "Receiver"
    pause 1000
    
    lcdout $fe,1
    lcdout "Waiting For"
    lcdout $fe,$c0, "Data"
    
    
    main:
    serin2 portb.0,n2400,[wait($60),data_received]
    pause 500
    lcdout $fe,1 ' clear lcd
    lcdout "Receiving Data"
    lcdout $fe,$c0,dec3 data_received," "
    goto main

  4. #4
    Join Date
    Sep 2004
    Location
    montreal, canada
    Posts
    6,898


    Did you find this post helpful? Yes | No

    Default

    out of curiosity, what happen if you use T2400 instead?

    which PIC?

    How far away your RF modules are ?

    Are they sharing the same psu?
    Steve

    It's not a bug, it's a random feature.
    There's no problem, only learning opportunities.

  5. #5
    Join Date
    Jul 2007
    Posts
    38


    Did you find this post helpful? Yes | No

    Default

    Quote Originally Posted by mister_e View Post
    out of curiosity, what happen if you use T2400 instead?

    which PIC?

    How far away your RF modules are ?

    Are they sharing the same psu?
    its a good old 16f84


    i shall try t2400 now

    i have my transmit setup - pic on one breadboard/ transmitter module on another connected up to each other

    same with receive, the transmit and receive part are not close to each other, tried them close and far still no result

    the transmit and receive side are individually powered with a 9v battery using a 5v voltage regulator

  6. #6
    Join Date
    Jul 2003
    Posts
    2,405


    Did you find this post helpful? Yes | No

    Default

    You're using the wrong serial mode numbers for SERIN2/SEROUT2.

    Drop the include modedefs.bas and use something like N2400 CON 16780.
    Regards,

    -Bruce
    tech at rentron.com
    http://www.rentron.com

  7. #7
    Join Date
    Jul 2007
    Posts
    38


    Did you find this post helpful? Yes | No

    Default

    Quote Originally Posted by Bruce View Post
    You're using the wrong serial mode numbers for SERIN2/SEROUT2.

    Drop the include modedefs.bas and use something like N2400 CON 16780.
    bruce, i cannot thank you enough

    this has been annoying me for ages


  8. #8
    Join Date
    Sep 2004
    Location
    montreal, canada
    Posts
    6,898


    Did you find this post helpful? Yes | No

    Default

    oops... missed that...
    STRONG AND BLACK COFFEE TIME!
    Steve

    It's not a bug, it's a random feature.
    There's no problem, only learning opportunities.

  9. #9
    Join Date
    Jul 2007
    Posts
    38


    Did you find this post helpful? Yes | No

    Default

    just looked up serin2 in the manual

    oops
    i thought modes were the same as serin when there ermm not..

    newbie mistakes..

    but at least i learnt from it


    another thing that it fixed..

    i was having strange timing issues to and that simple change fixed it

  10. #10
    Join Date
    Jul 2003
    Posts
    2,405


    Did you find this post helpful? Yes | No

    Default

    Hey! I learn more from my mistakes than anything else. And those lessons are the easiest
    ones to remember.

    But, like mister-e has pointed out, I am getting old so I jot things down so I don't
    forget...;o}
    Regards,

    -Bruce
    tech at rentron.com
    http://www.rentron.com

Similar Threads

  1. problem with sending data using RF module
    By rano_zen06 in forum mel PIC BASIC Pro
    Replies: 51
    Last Post: - 10th April 2008, 17:08
  2. Problem with manchester code for RF
    By Dhanushka in forum mel PIC BASIC Pro
    Replies: 11
    Last Post: - 6th August 2007, 11:46
  3. RF range problem
    By George in forum Off Topic
    Replies: 10
    Last Post: - 19th March 2007, 04:11
  4. a problem RF Signal with PULSIN
    By muskut in forum mel PIC BASIC Pro
    Replies: 6
    Last Post: - 22nd July 2005, 16:42
  5. problem with RF receiver
    By nanami7702002 in forum mel PIC BASIC Pro
    Replies: 13
    Last Post: - 31st January 2005, 21:55

Members who have read this thread : 1

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