Rf transmitter/receiver program...need help


Closed Thread
Results 1 to 4 of 4
  1. #1
    Join Date
    Feb 2009
    Posts
    12

    Default Rf transmitter/receiver program...need help

    RECENTLY I TRY TO TRANSMIT MORE THAN ONE STRING LIKE INSTEAD OF "A", I WANT "AB". BUT THE RECEIVER ONLY RECEIVE "A" ONLY, IT CANNOT RECEIVE "AB". IS THAT ANY THING WRONG WITH MY SOURCE CODE.

    TRANSMITTER CODE:
    --------------------------------------------------------------------------
    ' Variable assign
    '--------------------------------------------------------------------------H VAR byte
    E VAR byte
    SYNCH VAR BYTE
    JUNK VAR BYTE
    '--------------------------------------------------------------------------INPUT PORTB.7
    junk = 126
    synch = "Z"
    H = 65 'STRING "A"
    E = 66 'STRING "B"
    '--------------------------------------------------------------------------' DATA SEND OUT
    '--------------------------------------------------------------------------DATA_TX:
    HIGH PORTC.0:PAUSE 50:LOW PORTC.0:PAUSE 50 'LED ON/OFF
    HIGH PORTC.0:PAUSE 50:LOW PORTC.0:PAUSE 50
    HIGH PORTC.0:PAUSE 50:LOW PORTC.0:PAUSE 50

    CON_TX:
    pause 1000
    for dat = 1 to 255
    serout PORTB.3,N2400,[junk,synch,H,E]
    pause 50
    next
    serout PORTB.3,N2400,[junk,synch,0]
    GOTO CON_TX
    --------------------------------------------------------------------------


    RECEIVER CODE:
    '--------------------------------------------------------------------------' Variable assign
    '--------------------------------------------------------------------------RX_DATA VAR BYTE[6]
    '--------------------------------------------------------------------------
    '--------------------------------------------------------------------------' DATA SEND OUT
    '--------------------------------------------------------------------------DATA_RX:
    HIGH PORTC.2:PAUSE 50:LOW PORTC.2:PAUSE 50 'LED ON/OFF
    HIGH PORTC.2:PAUSE 50:LOW PORTC.2:PAUSE 50
    HIGH PORTC.2:PAUSE 50:LOW PORTC.2:PAUSE 50
    RX_DATA[14] = 0

    CON_RX:
    SERIN PORTA.0,N2400,["Z"],RX_DATA
    DEBUG "DATA =",STR RX_DATA,10,13
    GOTO DATA_RX
    '--------------------------------------------------------------------------

    IS ANY ONE CAN HELP ME...PLEASE...TQ

  2. #2
    Join Date
    Nov 2003
    Location
    Greece
    Posts
    3,807


    Did you find this post helpful? Yes | No

    Default

    Quote Originally Posted by csooi08 View Post
    CON_RX:
    SERIN PORTA.0,N2400,["Z"],RX_DATA
    DEBUG "DATA =",STR RX_DATA,10,13
    ....
    On the SERIN line try this:

    Code:
    SERIN PORTA.0,N2400,["Z"],RX_DATA[0],RX_DATA[1]
    And on the DEBUG line this:

    Code:
    DEBUG "DATA =",RX_DATA[0], RX_DATA[1],10,13
    Does it work now for 2 characters?

    Ioannis

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


    Did you find this post helpful? Yes | No

    Default

    Rule #1:
    Dont post IN UPPERCASE, this is considered aS YELLING.

    Rule #2:
    post all details.. PIC model, crystal speed, Configuration fuses, schematic

    Rule #3:
    use code tags when you post your code, see my signature.
    Steve

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

  4. #4
    Join Date
    Feb 2009
    Posts
    12


    Did you find this post helpful? Yes | No

    Default

    Dear Ioannis,

    TQ for the code.
    Already try the code u post....but the result of debug through RS232 PC...get

    RX_DATA[0] = H, RX_DATA[1] = D.

    Why i get the "D", i don't know.

    FYI,

    i use PIC16F876A, 20MHz crystal to do this project.

    Dear mister e,
    I sorry about my post because i am new at here. Can u show me how to use the code tag?

    TQ

Similar Threads

  1. Presetting Configuration Fuses (PIC Defines) into your Program
    By Melanie in forum FAQ - Frequently Asked Questions
    Replies: 82
    Last Post: - 15th December 2013, 09:54
  2. Replies: 1
    Last Post: - 23rd May 2009, 09:22
  3. Making Program Code Space your playground...
    By Melanie in forum Code Examples
    Replies: 15
    Last Post: - 19th July 2008, 08:26
  4. PIC16F684 Program question
    By Nicholas in forum mel PIC BASIC Pro
    Replies: 2
    Last Post: - 28th December 2006, 14:30
  5. Interfacting RF Module
    By rastan in forum General
    Replies: 8
    Last Post: - 10th November 2004, 22:27

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