I2C issue w/ 18F6722


Closed Thread
Results 1 to 6 of 6

Hybrid View

  1. #1
    Join Date
    Dec 2008
    Location
    Los Angeles, CA
    Posts
    156


    Did you find this post helpful? Yes | No

    Unhappy

    No difference. It is behaving the same way

  2. #2


    Did you find this post helpful? Yes | No

    Default

    Quote Originally Posted by circuitpro View Post
    No difference. It is behaving the same way

    Do you have a schematic? Which pins on the pic go to which pins on PCF chip?


    Take a look in the manual under I2CREAD, you have to set your datapin and clockpin to match
    the physical connection to the pic. Also TRIS must be set to match.

  3. #3
    Join Date
    Dec 2008
    Location
    Los Angeles, CA
    Posts
    156


    Did you find this post helpful? Yes | No

    Default

    After reading thru the datasheet section on the MSSP modules, I'm sure it's my error in not setting something in the MSSP up properly. I will have to get down and really figure out what all these setup bits actually do when I get back in front of hardware later today. My first post was a little misleading by saying the second I2C port 'worked'. It returned '0', but there wasn't any hardware on the buss either. It also did not work with hardware on the buss. It just kept returning '0's. That points away from hardware (I've used this PCF8574's for years, and the hardware is connected right). It's the dummy driving the new PIC that's at fault. :-(
    Last edited by circuitpro; - 16th July 2010 at 18:44. Reason: additional

  4. #4
    Join Date
    Dec 2008
    Location
    Los Angeles, CA
    Posts
    156


    Did you find this post helpful? Yes | No

    Smile

    Code:
    SSP1CON1.5=1                                 'ENABLE I2C #1
    SSP1CON1.3=1                                 'SET I2C#1 FOR MASTER MODE
    SSP1CON1.2=0                                 'SET I2C#1 FOR MASTER MODE
    SSP1CON1.1=0                                 'SET I2C#1 FOR MASTER MODE
    SSP1CON1.0=0                                 'SET I2C#1 FOR MASTER MODE
    fixed my problem. Apparently the PBP I2C command doesn't do any setting of this stuff for hardware I2C pins, so must be set.

    Thanks for your help Mark.

    Len

Members who have read this thread : 0

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