PIC to PIC communication

Discussion in 'Embedded Systems and Microcontrollers' started by LittleEars, Dec 27, 2008.

  1. LittleEars

    Thread Starter New Member

    Dec 27, 2008

    I want to get 2 PICs communicating with each other using RS232. Anyone know how I could do this using no more than 2 pins per chip?

    I have tried googling what the commands/method of communication needs to be to achieve this but I can't find anything that seems to be right.

    Any link would be appreciated!

  2. beenthere

    Retired Moderator

    Apr 20, 2004
    RS-232 is a communications protocol. You could always look up the spec sheet for a MAX232 to see some of what is involved.

    Using two pins only will require a different methodology entirely. You can always look into 2 wire protocols, or see what I/O interfaces are already built into the PIC's you are using.

    Limiting comms to 2 pins is a bit difficult. The use of two more pins to do handshaking makes life easier. Still, radios manage - you can just arrange to send messages back and forth, with some fixed schedule.
  3. Alberto

    Active Member

    Nov 7, 2008
    Use two pics with uart on board. Then you can use interupts on received byte and jump to a listening routine without loosing any bytes transmitted. this naturally apply for both chips.

  4. AlexR

    Well-Known Member

    Jan 16, 2008
    Unless you have some overwhelming reason we don't know about for using RS232 I would go for SPI to communicate between chips. Its much faster and more efficient than RS232 and many PIC chips SPI support built in making it simple to use.
  5. FBorges22

    Senior Member

    Sep 11, 2008
  6. John P

    AAC Fanatic!

    Oct 14, 2008
    Well, yeah. It's trivial, assuming you have processors with built-in UARTs. Connect RX of one chip to TX of the other, and vice versa, and you're all done, as far as the hardware is concerned. But that's not "RS232". It's a "serial link"; it would have to be communicating at the official RS232 voltage levels to be an official port, and there's no reason to do that (and good reasons not to) if you don't need it.

    The SPI or I2C options are usable too, though that would make the processors inherently unequal, with one chip needing to be "master". You might or might not think that was a good idea.