Fast yet reliable PIC-PIC communication?


Closed Thread
Results 1 to 7 of 7
  1. #1
    Join Date
    Nov 2005
    Location
    Perth, Australia
    Posts
    429

    Default Fast yet reliable PIC-PIC communication?

    I'm wondering what people think is the most reliable pic-pic communication that can achieve at least 14.4 kbps. The problem is, the receiving pic will have interrupts going off all the time that i suspect will mess things up? I would also prefer not to use interrupts for the comms itself.

    Any ideas?

    I looked at SHIFTIN/SHIFTOUT but it seems that they both generate a clock? Seems odd.
    "I think fish is nice, but then I think that rain is wet, so who am I to judge?" - Douglas Adams

  2. #2
    Join Date
    Nov 2003
    Location
    Wellton, U.S.A.
    Posts
    5,924


    Did you find this post helpful? Yes | No

    Default

    Not wanting to use an interrupt with the comms is going to be hard to not miss data.
    Why not use hardware serial and an interrupt?
    Dave
    Always wear safety glasses while programming.

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


    Did you find this post helpful? Yes | No

    Default

    I just didn't want the comms interrupting the other interrupts either :-/

    Perhaps I could use the hardware serial and simply poll the USART interrupt flag. The buffer should hopefully ensure that I dont miss anything. Will have to do some testing.
    "I think fish is nice, but then I think that rain is wet, so who am I to judge?" - Douglas Adams

  4. #4
    Join Date
    Mar 2006
    Location
    China
    Posts
    266


    Did you find this post helpful? Yes | No

    Default High low priority

    Hi,

    If your PIC have the option of high and low priority levels of interupts you can always put the RX as a low priority. Then the high level ones will not be blocked by the rx interupt.

    /me

  5. #5
    Join Date
    Nov 2003
    Location
    Wellton, U.S.A.
    Posts
    5,924


    Did you find this post helpful? Yes | No

    Default

    I still think you will need to use an interrupt or miss data now and then.
    Are you going to use DTs instants? Not knowing the rest of the setup hard to say what the best solution is. But I will bet DTs stuff will cover it.
    Dave
    Always wear safety glasses while programming.

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


    Did you find this post helpful? Yes | No

    Default

    Yeah i'm using DT's instant interrupts. My question is tho, what happens when the RX interrupt is low priority, it is triggered, and then is interrupted by a high priority interrupt? Will the lower priority interrupt continue after the high priority one is done?
    "I think fish is nice, but then I think that rain is wet, so who am I to judge?" - Douglas Adams

  7. #7


    Did you find this post helpful? Yes | No

    Default

    Why not use an acknowledge system...
    So, pic0 sends data to pic1, when pic1 recieves the data and verifies it it whole it sends and acknoledge back to pic0...
    If pic0 doesn't recieve the ACK then it re-sends after a time-out...
    If PIC0 resends the same piece of data more than 3 times it does a 'crashed' cpu subroutine and then stays their waiting for user intervention...

    This way, you could proberbly use some of the faster ways of communicating...

    Enhansements to this would include some form of CRC checking to make sure atleast the number of bytes has been recieved...

    So for example a data packet might look like this...

    Byte1: To PIC #
    Byte2: From PIC #
    Byte3: Data Type
    Byte4 to whatever: DATA
    Last Byte: Number of bytes in packet including last...

    So PIC1 sends and 'ACK X number of bytes' back to PIC0

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 : 2

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