How can I "see" if a PCF8574 is "alive" in the I2C bus


+ Reply to Thread
Results 1 to 4 of 4
  1. #1
    Join Date
    Oct 2004
    Location
    Porto - Portugal
    Posts
    28

    Default How can I "see" if a PCF8574 is "alive" in the I2C bus

    Hi to you all

    My question has to do with a project in which I got involved as is something like this:

    There are 4 pcf8574, each takes care of 8 micro-switches (with pull-up resistors) each micro-switch senses the presence (or not) of a product over it.

    So, with the product over the micro-switch the pcf reads a "zero" (and assumes there is a product), without the product it reads a "one".

    If for any reason I disconnect (or it became dammaged) one of the boards that has a pcf8574, when I tell the PIC to read the bus it sees the absent pcf8574 as having all the inputs with "zeros".

    Can anyone sugest a way to check if there is really a pcf on the I2C bus or I'm seeig a ghost pcf.

    Thanks in advance.

    Thanks Lester for this comunication thread, hope everybody follow these new rules
    nomada

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

    Default

    nomada, personally I would write 01010101 to each of the pcf8574's then read back the contents of the input register. With all inputs open circuited you should read the exact same patern as you wrote to it. Then I would change the pattern to 10101010 and read the contents once again making sure the readback is the same as the programed value. After this I would write all 1's to the pcf8574's and start reading them in a normal situation. The verify siquence could ba a subroutine you would run at a timed interval to ensure the integrity of the reading ability of the pcf8574's.

    Dave Purola,
    N8NTA

  3. #3
    Join Date
    Oct 2004
    Location
    Porto - Portugal
    Posts
    28

    Thumbs up Thanks!

    Hi, Dave

    Sorry for the late reply, I've been away.

    I've tried your sugestion and it looks like that IT WORKS.

    I've supposed that writing to a PCF that is configurated to act like an input might cause some damage... well, credit should be given to those who knows.

    Once again, thank you!
    nomada

  4. #4
    Join Date
    Jan 2005
    Location
    France
    Posts
    85

    Default Re: How can I "see" if a PCF8574 is "alive" in the I2C bus

    hello I will not answer about the PCF8574 (who is sometimes very strange !)
    but to the question "how to see if a I2C unit is alive"
    I use for a long time, a very simple programm TEST I2C
    see here : http://mbouget.perso.neuf.fr/telecharge.html
    you can search, read,write on a I2C line (from a window/dos command line)
    I use it all the time to check my "I2C sentence"
    hope this will help other PIC user from this super Forum list !
    francois F1CHF

Similar Threads

  1. I2C Master/Slave 16F88/16F767 working code
    By DanPBP in forum Code Examples
    Replies: 2
    Last Post: - 23rd October 2012, 23:31
  2. HARDWARE I2C SAMPLE CODE question
    By Michael Wakileh in forum Code Examples
    Replies: 2
    Last Post: - 16th June 2009, 22:07
  3. I2C Master Slave issues.
    By cpayne in forum mel PIC BASIC Pro
    Replies: 9
    Last Post: - 29th March 2008, 20:33
  4. Compass module and I2C bus
    By vladimir059@hot in forum mel PIC BASIC Pro
    Replies: 12
    Last Post: - 26th December 2006, 21:29
  5. I2C Bus (max wire lenght)
    By NavMicroSystems in forum mel PIC BASIC Pro
    Replies: 8
    Last Post: - 24th November 2004, 23:15

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts