PIC 2 PIC communication


Closed Thread
Results 1 to 17 of 17

Hybrid View

  1. #1
    Mario's Avatar
    Mario Guest

    Exclamation PIC 2 PIC communication

    I am using PIC to PIC communication with the help wireless module TLP/RLP 434A pair from laipac.com. I verified my output from serial transmition from PIC on the oscilloscope using this code.
    ………………………
    ' TX code
    ' OSC 4M
    TRISB=%10000000
    While portb.7 =1
    Serout2 0,16780,($55,$55,"A",170)
    wend
    End
    ……………………..
    My RF component can be viewed using spectrum analyzer and I realize that my transmitter block including PIC and TLP 434A working fine. But in the receiver (RLP 434A) digital and analog output I got garbage.

    So Finally, I decided not to overrun the receiver so I didn't use while in the following code:
    ……………………
    ' TX code
    ' OSC 4M
    TRISB=%10000000
    Serout2 0, 16780, [$55,$55,"A",170]
    End
    …………………..

    But also it is not succeeded…………!!!!!!!!
    Here my code for RX
    ……………………
    ' TX code
    ' OSC 4M
    TRISA=0
    Mydata var byte
    PORTA=0
    Pause 1000
    Serin2 0, 16780, [wait ("A"),Mydata ]
    PORTA = Mydata
    Pause 2000
    End

    I appreciate any kind of help……………………….

  2. #2
    Join Date
    Oct 2005
    Posts
    7


    Did you find this post helpful? Yes | No

    Default

    Mario,


    Your serin and serout commands are setup for a basic stamp, particularly your baud rates are wrong. You need to read the Pbasic manual and select the proper ones for Melabs Pbasic or Pbasic pro.
    Try changing them to the following.

    Serout2 0,N2400,($55,$55,"A",170)
    Serin2 0, N2400, [wait ("A"),Mydata ]


    Mike

  3. #3
    Join Date
    Nov 2005
    Location
    Perth, Australia
    Posts
    429


    Did you find this post helpful? Yes | No

    Default

    I'm attempting the same thing with RF PIC-PIC serial communication. Any chance you could clear up a few things for me?

    what is the reason for sending ($55,$55,"A",170) instead of just your data? I take it your data in this case is 170? Also, why is the sent data in curved brackets () and the recieved in square brackets []?

    Thanks

  4. #4
    Mario's Avatar
    Mario Guest


    Did you find this post helpful? Yes | No

    Default

    Quote Originally Posted by Kamikaze47
    I'm attempting the same thing with RF PIC-PIC serial communication. Any chance you could clear up a few things for me?

    what is the reason for sending ($55,$55,"A",170) instead of just your data? I take it your data in this case is 170? Also, why is the sent data in curved brackets () and the recieved in square brackets []?

    Thanks
    This $55 just to make you receiver (wake up) ready to receive your valuable data ,so the receiver will wait until it reach to "A" then save whatever you send in the variable....

    actually ,the correct bracket is [] for pic basic pro and () for basic one

  5. #5
    Join Date
    Oct 2005
    Posts
    34


    Did you find this post helpful? Yes | No

    Smile Pic 2 Pic

    Why using SerOut2 and SerIn2?
    The following code works perfect in RF applications, I construct my own transmitter with a BFR92A with a saw resonator and a RR3 receiver module with a range of up to 300M, your qualifier "A" or any other character is adequate handshaking.
    Transmitter:
    SerOut PORTA.6,N1400,["A",data,data,.....]
    Receiver:
    SerIn PORTA.5,N1400,["A"],B0,B1,B2,.... ' depending on how many bites you want to receive

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


    Did you find this post helpful? Yes | No

    Default

    If it was as this simple... Manchester and any other method would never exist

    It will depend of tons of elements.. this is why i hate RF stuff.

    Try to keep your lady Happy without any 'Preamble' and good method... May work sometimes...
    Last edited by mister_e; - 17th March 2006 at 00:57.
    Steve

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

Similar Threads

  1. communication of pic 18f4520 and cell phone
    By Alisha in forum mel PIC BASIC Pro
    Replies: 1
    Last Post: - 10th February 2010, 11:47
  2. Replies: 11
    Last Post: - 12th July 2008, 02:36
  3. pic to pic communication pic2pic
    By aftab in forum mel PIC BASIC Pro
    Replies: 6
    Last Post: - 8th October 2007, 17:16
  4. USB communication with pic
    By Shamir in forum mel PIC BASIC Pro
    Replies: 5
    Last Post: - 14th August 2006, 23:43
  5. Serial Pic to Pic using HSER
    By Chadhammer in forum mel PIC BASIC Pro
    Replies: 5
    Last Post: - 11th March 2005, 23:14

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