• AVR Freaks

i2c vs uart overhead

Author
acharnley
Super Member
  • Total Posts : 377
  • Reward points : 0
  • Joined: 2016/05/01 06:51:28
  • Location: 0
  • Status: offline
2019/10/16 01:39:32 (permalink)
0

i2c vs uart overhead

Hi,

I haven't played with I2C before but I'll soon have communication between two PIC's coming up. I'd usually default to serial but wonder if I2C is a better method in terms of connection overhead (is the protocol overhead all done in hardware)?

The communication will be low volume and both chips will know each other so baud rate and the like can be pre-known. There's no other devices so it does seem the advantages of I2C here don't apply, but do let me know if otherwise. Keeping CPU overhead to a minimum is probably the most important aspect.

Cheers, Andrew
#1

3 Replies Related Threads

    mbrowning
    USNA79
    • Total Posts : 1552
    • Reward points : 0
    • Joined: 2005/03/16 14:32:56
    • Location: Melbourne, FL
    • Status: offline
    Re: i2c vs uart overhead 2019/10/16 04:17:28 (permalink)
    0
    Between two devices uart is much easier. Far less software overhead. Full duplex. To me it’s a no-brainer.

    Go Navy! Beat Army!
    #2
    pcbbc
    Super Member
    • Total Posts : 1373
    • Reward points : 0
    • Joined: 2014/03/27 07:04:41
    • Location: 0
    • Status: offline
    Re: i2c vs uart overhead 2019/10/16 05:03:14 (permalink)
    +1 (1)
    The low level signal protocol for transferring bytes between end points is done in hardware for either UART or I2C.

    On top of that, in all bust the most trivial of implementations, you will need some higher level protocol to define packets of data and check for errors. That’s entirely up to you and needs to be done in software.

    Agree with browning that serial is almost certainly the way to go for bidirectional communication between just two endpoints.
    #3
    ric
    Super Member
    • Total Posts : 24217
    • Reward points : 0
    • Joined: 2003/11/07 12:41:26
    • Location: Australia, Melbourne
    • Status: online
    Re: i2c vs uart overhead 2019/10/16 05:28:43 (permalink)
    +1 (1)
    pcbbc
    The low level signal protocol for transferring bytes between end points is done in hardware for either UART or I2C.

    But as mbrowning hints at, there is more work involved for every byte in I2C than there is in serial.
    Hands down, serial is less work.

    I also post at: PicForum
    Links to useful PIC information: http://picforum.ric323.co...opic.php?f=59&t=15
    NEW USERS: Posting images, links and code - workaround for restrictions.
    To get a useful answer, always state which PIC you are using!
    #4
    Jump to:
    © 2019 APG vNext Commercial Version 4.5