PIC to PIC communication between 18F4620 & 10F202


Closed Thread
Results 1 to 9 of 9

Hybrid View

  1. #1
    Join Date
    May 2014
    Posts
    7


    Did you find this post helpful? Yes | No

    Default Re: PIC to PIC communication between 18F4620 & 10F202

    Re: CuriousOne

    Yes, OSC has been defined on both chips, however they are different from each other. 18F4620 is using OSC 20 (external), 10F202 is using OSC 4 (internal). Could this be the reason?

    Re: mackrackit

    I tried with loops, interrupts but nothing has worked so far. I think the main problem is synchronization. Let me try to explain:

    In an ideal case it should be (skipping definitions):

    18F4620
    --------
    PAUSE 1000
    SEROUT PORTA.1,N9600,[GG]
    SERIN PORTA.0,N9600,[TT]
    lcdout $FE,214,"SERIN:[",#tt,"]"

    10F202
    -------
    SERIN GPIO.1,N9600,[RR]
    SEROUT GPIO.0,N9600,[RR]

    time analysis:
    TIME | 18F4620 ----------| 10F202
    ---------------------------------------
    0 ---| PAUSE 1000 ------|SERIN (waiting)
    1 ---| SEROUT ----------| message received
    2 ---| SERIN (waiting) ---| SEROUT
    3 ---| message received -|
    4 ---| LCDOUT ----------|

    I think 2-pic communications usually go in 1-way. Pic_1 receives data from Pic_2 and lights a led or something. But in this case both pics sending and receiving messages in a very short time should be causing the problem.

  2. #2
    Join Date
    Jan 2005
    Location
    Montreal, Quebec, Canada
    Posts
    3,172


    Did you find this post helpful? Yes | No

    Default Re: PIC to PIC communication between 18F4620 & 10F202

    I've had PICs talk together with different osc speeds.

    As long as the registers and communication commands are set properly, the hardware wired properly, it should work.

    Robert

  3. #3
    Join Date
    Jan 2005
    Location
    Montreal, Quebec, Canada
    Posts
    3,172


    Did you find this post helpful? Yes | No

    Default Re: PIC to PIC communication between 18F4620 & 10F202

    10F202 should wait to receive data, the master should wait to receive reply.

    I don't see any waiting in the code above.

    But in this case both pics sending and receiving messages in a very short time should be causing the problem.
    Most likely.

    Robert

Similar Threads

  1. Fast yet reliable PIC-PIC communication?
    By Kamikaze47 in forum mel PIC BASIC Pro
    Replies: 6
    Last Post: - 27th September 2009, 16:34
  2. Pic 18f4620
    By 78Davide in forum mel PIC BASIC Pro
    Replies: 3
    Last Post: - 6th May 2009, 20:24
  3. Coding Style - PIC 18F4620 config fuses
    By BrianT in forum mel PIC BASIC Pro
    Replies: 3
    Last Post: - 8th January 2008, 21:05
  4. SPI PIC to PIC Bi-Directional Communication
    By CocaColaKid in forum Serial
    Replies: 5
    Last Post: - 23rd December 2006, 23:44
  5. PIC to PIC RS485 with users the communication
    By x0914667 in forum Serial
    Replies: 2
    Last Post: - 21st July 2005, 01:20

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