troubles using more than one PCF8574


Closed Thread
Results 1 to 5 of 5
  1. #1
    Join Date
    Oct 2005
    Posts
    14

    Question troubles using more than one PCF8574

    I have a problem when i want to use I2CWRITE on 2 different adressed PCF8574 chips

    here's a snippet of my code:

    pic16F876a at 8 Mhz crystal

    ADRESS1 con %01110000
    ADRESS2 con %01111110
    DEFINE I2C_HOLD 1
    DEFINE I2C_SLOW 1
    SCL var portc.3
    SDA var portc.4
    i2cwrite SDA,SCL,ADRESS1,[0]
    pause 50
    i2cwrite SDA,SCL,ADRESS2,[0]
    pause 50

    start:
    'this is just a test !

    if portb.6=1 then out0=2
    if portb.7=1 then out1=4

    i2cwrite SDA,SCL,ADRESS1,out0
    pause 50
    i2cwrite SDA,SCL,ADRESS2,out2
    pause 50

    goto start

    this is what happens:


    port 6 should set output 2 out PCF at addres 1 and port7 should set output 4 out PCF at addres 2, but when i do it like in the example, if i activate port 7
    then output 4 of PCF at adress1 is activated instead of output 4 of PCF 2

    What goes wrong here,

    hardware (chips etc) have been replaced several times, adresses also

    who encountered this problem also ?

  2. #2
    Join Date
    Mar 2003
    Location
    Commerce Michigan USA
    Posts
    1,166


    Did you find this post helpful? Yes | No

    Default

    maus, Make sure they are both the same suffix character ie. both have an "N" at the end or not. The parts have a different base address which allows 2 banks of 8 devices to be used in a system. Look at the data sheet.... I have used 16 devices in a couple of systems I have designed and had no problems....

    Dave Purola,
    N8NTA

  3. #3
    Join Date
    Mar 2003
    Location
    Commerce Michigan USA
    Posts
    1,166


    Did you find this post helpful? Yes | No

    Default

    maus, Also I noticed that you are sending it:i2cwrite SDA,SCL,ADRESS2,out2. Where is out2 being set? I beleive it should be out1?

    Dave Purola,
    N8NTA

  4. #4
    Join Date
    Oct 2005
    Posts
    14


    Did you find this post helpful? Yes | No

    Default

    thank you for your replies dave,

    Yes i used two "A" types, and indeed out2 should be out1, but this is just a short test program, so in my code it still doesn't work right, cause the out which should be sent to the second PCF is activating the first one,

    So anybody any more ideas, let me know

    thanx

  5. #5
    Join Date
    Mar 2003
    Location
    Commerce Michigan USA
    Posts
    1,166


    Did you find this post helpful? Yes | No

    Default

    maus, Without seeing the actual circuit I can't say anything else other than check with a multimeter that all 3 programmable address bits are in different strapped states. You have 1 IC strapped for an address of 0 and the other for an address of 7.

    Dave Purola,
    N8NTA

Similar Threads

  1. Replies: 3
    Last Post: - 15th October 2012, 08:06
  2. Pcf8574 & 16f877
    By Wirecut in forum mel PIC BASIC
    Replies: 2
    Last Post: - 11th July 2008, 14:49
  3. I2C I/O Expander PCF8574 hanging?
    By NavMicroSystems in forum Serial
    Replies: 12
    Last Post: - 4th August 2005, 02:26
  4. how to get PCF8574 and PIC16F876A work together
    By nomada in forum mel PIC BASIC Pro
    Replies: 3
    Last Post: - 15th December 2004, 02:07
  5. Pcf8574
    By larryt in forum mel PIC BASIC Pro
    Replies: 5
    Last Post: - 4th December 2004, 21:24

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