I2C I/O Expander PCF8574 hanging?


Closed Thread
Results 1 to 13 of 13

Hybrid View

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

    Default

    NavMicroSystems, I have had this problem in the past and I found that if before reading the PCF8574's I reset the pins used for inputs to a high state the problem went away. I beleive the output register internal to the PCF8574's is being corrupted.

    Dave Purola,
    N8NTA

  2. #2
    Join Date
    Feb 2004
    Location
    Germany
    Posts
    762

    Default

    Dave,

    many thanks for the hint.

    Can you remember in detail how you solved the problem?

    The only way I see is to write $FF to the PCF right before reading it.
    regards

    Ralph

    _______________________________________________
    There are only 10 types of people:
    Those who understand binary, and those who don't ...
    _______________________________________________



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

    Default

    Yes, I used a scope and looked at the port I/O pins of the PCF's in question and found that pin's used as inputs and programmed for high states were indeed low and after removing the optoisolators from the sockets that were feeding the inputs the port I/O pins were still low. This prompted me to re-write the port I/O pins used for inputs to high states before reading there state's. I have had no problems since....

    Dave Purola,
    N8NTA

  4. #4
    Join Date
    Feb 2004
    Location
    Germany
    Posts
    762

    Default

    Dave,

    many thanks!
    regards

    Ralph

    _______________________________________________
    There are only 10 types of people:
    Those who understand binary, and those who don't ...
    _______________________________________________



  5. #5
    Join Date
    Sep 2004
    Location
    montreal, canada
    Posts
    6,898

    Default

    That's interesting. Kinda TRIS refresh. Well it make sense, if we RTFM they say clearly
    Quote Originally Posted by TFM
    ...The I/Os should be high before being used as inputs
    Something to remeber for all here!

    Thanks Dave.
    Steve

    It's not a bug, it's a random feature.
    There's no problem, only learning opportunities.

  6. #6
    Join Date
    Feb 2004
    Location
    Germany
    Posts
    762

    Default

    Quote Originally Posted by mister_e
    That's interesting. Kinda TRIS refresh. Well it make sense, if we RTFM they say clearly
    Originally Posted by TFM
    ...The I/Os should be high before being used as inputs
    Something to remeber for all here!

    Thanks Dave.
    Steve,
    you are right,
    that's what the datasheet says,
    but it is not really clear.

    When initialising the PCFs I do first write $FF to it.
    From that point on there are only READs.

    So the the I/Os have been set HIGH before being used as inputs.
    (The System has been running for about six months without any error, last week was the first time I found a gap in the log.)

    The DataSheet doesn't tell that you have to set the I/Os HIGH before every single READ.

    However,
    if that solves the problem I can live with it.
    (I have already changed my READPCF-Routine)

    Thanks again to Dave for pointing that out.

    EDIT
    OK, that takes some extra clock cycles, so I had to recalculate the timing.

    I'll put the new FIrmware Live on Monday and let you know wether or not the problem occurs again.
    Last edited by NavMicroSystems; - 14th July 2005 at 19:24.
    regards

    Ralph

    _______________________________________________
    There are only 10 types of people:
    Those who understand binary, and those who don't ...
    _______________________________________________



  7. #7
    badrad's Avatar
    badrad Guest

    Default

    I am trying out the PCF8575 - 16 bit expander in my application. The high byte will be connected to LEDs for output, and the low byte is connected to switches.

    For your application using the PCF8574 - did you use the I2CREAD and I2CWRITE commands control the bit expander? Would you mind posting a snippet of your code example on how you control the device?

    Thanks.

Similar Threads

  1. I2C Master/Slave 16F88/16F767 working code
    By DanPBP in forum Code Examples
    Replies: 2
    Last Post: - 23rd October 2012, 22:31
  2. HARDWARE I2C SAMPLE CODE question
    By Michael Wakileh in forum Code Examples
    Replies: 2
    Last Post: - 16th June 2009, 21:07
  3. I2C Master Slave issues.
    By cpayne in forum mel PIC BASIC Pro
    Replies: 9
    Last Post: - 29th March 2008, 19:33
  4. MCP23016 I2C serial I/O expander chip
    By GeoJoe in forum Serial
    Replies: 7
    Last Post: - 31st October 2007, 15:39
  5. MCP23016 I/O expander
    By Demon in forum mel PIC BASIC Pro
    Replies: 42
    Last Post: - 24th October 2005, 01:01

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