Communication PIC to PIC?


Closed Thread
Results 1 to 20 of 20

Hybrid View

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


    Did you find this post helpful? Yes | No

    Default

    Master:
    SEROUT SerPin,Baud,[YourVar]

    Slave:
    SERIN SerPin,Baud,[YourVar]

    ---- OR ----

    Master:
    SEROUT SerPin,Baud,[#YourVar]

    Slave:
    SERIN SerPin,Baud,[#YourVar]

    ---- OR ----

    Master:
    SEROUT2 SerPin,Baud,[DEC YourVar]

    Slave:
    SERIN2 SerPin,Baud,[DEC YourVar]

    ---- OR ----
    .
    .
    .
    .

    ---- OR -----
    .
    .
    .
    .
    Steve

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

  2. #2
    Join Date
    Nov 2004
    Location
    Calabasas, CA
    Posts
    84


    Did you find this post helpful? Yes | No

    Default

    Thanks Steve, I'll give her a try.
    James

  3. #3
    Rhatidbwoy's Avatar
    Rhatidbwoy Guest


    Did you find this post helpful? Yes | No

    Default

    what do you do if you have 39 things to send and you do not want to eat up all that space with serin commands.

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


    Did you find this post helpful? Yes | No

    Default

    39 things to send or receive?

    To send => you can even use internal EEPROM or use an array variable.

    To receive = > With SERIN2, look for the STR modifier.
    Steve

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

  5. #5
    Rhatidbwoy's Avatar
    Rhatidbwoy Guest


    Did you find this post helpful? Yes | No

    Default

    ok. I think that I have found a way to get this moving. The problem that I have is that I broke my 16f648a and do not have another. I will be waiting for a while. But between what I have I think that it will work.

    I have the programs of my work if you want to look. ironing out the little details to trans u2 ver 7 and still working on trans u1 ver2.

    Ah quick question. the attachment MATH is part of u1 ver2. I am getting error leaving me to understand that I don't understand the math behind what is happening within the chip. Since I am doing multiplication and division my information is base 32 rather than 16? Is that what I am to understand?
    Attached Files Attached Files

  6. #6


    Did you find this post helpful? Yes | No

    Default

    Very crude but it works. A while back I had to send 1 of 8 numbers to a slave PIC. I used SOUND command on master & COUNT command on slave. First number was near 100HZ, 2 was 200HZ, etc. Worked perfectly. Count command was limited to 100ms and allowed fast response. Count command needs a "window" like IF PULSESRECEIVED > 8 and < 12 THEN LET X = 0. Hope this helps.

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


    Did you find this post helpful? Yes | No

    Default

    for your math you can't use float directly like that.

    0.5 * x ===> still the same if you divide by 2

    If x=1.5 ===> you should multiply by 10 then read IF x=15 depending of the previous math...

    Well you should think integer than float.
    Last edited by mister_e; - 16th January 2006 at 19:09.
    Steve

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

  8. #8
    Join Date
    Nov 2004
    Location
    Calabasas, CA
    Posts
    84


    Did you find this post helpful? Yes | No

    Default

    Quote Originally Posted by mister_e
    Master:
    SEROUT SerPin,Baud,[YourVar]

    Slave:
    SERIN SerPin,Baud,[YourVar]

    ---- OR ----

    Master:
    SEROUT SerPin,Baud,[#YourVar]

    Slave:
    SERIN SerPin,Baud,[#YourVar]

    ---- OR ----

    Master:
    SEROUT2 SerPin,Baud,[DEC YourVar]

    Slave:
    SERIN2 SerPin,Baud,[DEC YourVar]

    .
    SerOut B.6,N2400,[w2]

    SerOut B.6,N2400,[#w2]

    Referrrencing my above example, both get "bad expression" errors when compiling, whats wrong?
    James

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


    Did you find this post helpful? Yes | No

    Default

    What about
    Code:
    SerOut PORTB.6,N2400,[w2] 
    
    SerOut PORTB.6,N2400,[#w2]
    Steve

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

  10. #10
    Join Date
    Nov 2004
    Location
    Calabasas, CA
    Posts
    84


    Did you find this post helpful? Yes | No

    Default

    Sho Nuff! Thanks Steve.
    James

  11. #11
    Join Date
    Nov 2004
    Location
    Calabasas, CA
    Posts
    84


    Did you find this post helpful? Yes | No

    Default sync data transfer?

    After being unsuccessful in transferrring the data from master to server, I now realize there must be some timing issues involved. How to time the transfer, or have slave wait until a successful serin has been made?
    James

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


    Did you find this post helpful? Yes | No

    Default

    use timeout of SERIN2 or DEBUGIN... PBP manual.
    Steve

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

  13. #13
    Rhatidbwoy's Avatar
    Rhatidbwoy Guest


    Did you find this post helpful? Yes | No

    Default

    ok I have got the pics that I have been waiting for. I have tried one crued method mentions earlier in the this thread. If I had to set up one pic to wait for the command how would I go about that. That is of course using the SEROUT and SERIN command.

    This is were it starts to get hairy.
    Last edited by Rhatidbwoy; - 30th January 2006 at 22:47.

Similar Threads

  1. 2 PIC, serial communication
    By lightgreen in forum Serial
    Replies: 6
    Last Post: - 21st November 2009, 15:20
  2. PIC to PIC "wired" serial one-way communication - SERIN2/SEROUT2
    By flotulopex in forum mel PIC BASIC Pro
    Replies: 5
    Last Post: - 14th April 2008, 20:02
  3. PIC 2 PIC communication
    By Mario in forum Forum Requests
    Replies: 16
    Last Post: - 28th April 2006, 01:56
  4. Serial communication PIC to PIC help.
    By Rubicon in forum mel PIC BASIC Pro
    Replies: 3
    Last Post: - 24th January 2005, 15:45
  5. Pic to Pic communication?
    By Rob Martin in forum mel PIC BASIC Pro
    Replies: 5
    Last Post: - 11th April 2004, 19:41

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