i2C with PIC16F87, need help


Closed Thread
Results 1 to 12 of 12

Hybrid View

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


    Did you find this post helpful? Yes | No

    Default Re: i2C with PIC16F87, need help

    Quote Originally Posted by Lazuli View Post
    ...
    I am struggling with I2C to communicate between PIC16F877A and a PIC16F87.
    ...

    Olivier,

    Do you HAVE to use I2C?

    Is there any reason why you couldn't use USART to communicate between the 16F877A and 16F87?

    16F87 p.99 section 11 AUSART

    The AUSART can be configured in the following
    modes:
    • Asynchronous (full-duplex)
    • Synchronous – Master (half-duplex)
    • Synchronous – Slave (half-duplex)
    16F877A p.113 section 10 USART

    The USART can be configured in the following modes:
    • Asynchronous (full-duplex)
    • Synchronous – Master (half-duplex)
    • Synchronous – Slave (half-duplex)
    The acronym is slightly different, but when you read the descriptions, they are the identical.

  2. #2
    Join Date
    Sep 2005
    Location
    Campbell, CA
    Posts
    1,107


    Did you find this post helpful? Yes | No

    Default Re: i2C with PIC16F87, need help

    You can either use RS-232 or I2C or SPI or PSP or ... to talk between two PICs.

    If you use RS-232, and you have only two chips in your little 'network' then it is trivial - just hook TXD to RXD and RXD to TXD. If you send two characters or less, you don't need interrupts - just check for PIR1.5 being set (that is what it is in 18F chips, anyway), then read the characters using HSERIN.

    But the problem is - if your chips have only 1 RS-232 port, you have no RS-232 ports left. So, the solution is to use at least one chip that has two RS-232 ports, or to use a chip that has one RS-232 port and one I2C port. Your choice.

    My example doesn't use bit-banging. It uses hardware. It uses real interrupts. It works on my chips.
    Charles Linquist

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