PCF8575 Does not work with my code....


Closed Thread
Results 1 to 20 of 20

Hybrid View

  1. #1


    Did you find this post helpful? Yes | No

    Default Re: PCF8575 Does not work with my code....

    Meant to have said my code is for the 8 port version, the 16 port version would have another byte added after, as you have got.

    "The extra byte is write statement, as said in datasheet?"

    Your extra byte is a bit not byte.
    Last edited by aerostar; - 22nd October 2023 at 06:39.

  2. #2
    Join Date
    Feb 2013
    Posts
    1,124


    Did you find this post helpful? Yes | No

    Default Re: PCF8575 Does not work with my code....

    Yes, with 8574 I also had no issues....

  3. #3
    Join Date
    Aug 2011
    Posts
    453


    Did you find this post helpful? Yes | No

    Default Re: PCF8575 Does not work with my code....

    So I think your code should be

    I2CWRITE SDAM,SCLM,%01000000,[%11111111,%11111111] 'enable outputs
    That looks correct to me (an even number of bytes, one for each port), and matches the datasheet shown in post #4.

  4. #4
    Join Date
    Feb 2013
    Posts
    1,124


    Did you find this post helpful? Yes | No

    Default Re: PCF8575 Does not work with my code....

    I think there is a hardware issue.
    That code works with standalone module with PCF8575. But does not work with the chip directly soldered to my PCB, so I will swap the IC today later and see, if there's any difference.

  5. #5
    Join Date
    Feb 2013
    Posts
    1,124


    Did you find this post helpful? Yes | No

    Default Re: PCF8575 Does not work with my code....

    I figured out the reason, and it is not the code.
    For some reason, PCF8575 can't drive ULN2803.
    When I run it alone, outputs change as they should do
    but when I connect output to ULN2803, output voltage of PCF8575 changes only from 0 to 0.6 volts and ULN2803 does not open.

  6. #6
    Join Date
    Feb 2013
    Posts
    1,124


    1 out of 1 members found this post helpful. Did you find this post helpful? Yes | No

    Default Re: PCF8575 Does not work with my code....

    Solved.
    Output current of PCF8575 is not enough to drive ULN2803, so I had to add 2.2K pull-up resistors, and now it works just fine.

  7. #7
    Join Date
    Nov 2003
    Location
    Greece
    Posts
    4,132


    Did you find this post helpful? Yes | No

    Default Re: PCF8575 Does not work with my code....

    It makes no sense. From datasheet, page 7 and figures 6 and 10, seems that the 8575 can drive more than 25mA.

    I am sure that ULN needs much less than that. Maybe you have a faulty chip? Be very careful with static discharge (ESD) problems.

    Ioannis

Similar Threads

  1. Code doesn't work on 16F648A
    By Mr_Joe in forum mel PIC BASIC Pro
    Replies: 4
    Last Post: - 1st September 2018, 22:09
  2. Is anyone willing to work with me to rewrite some code?
    By Ramius in forum mel PIC BASIC Pro
    Replies: 8
    Last Post: - 4th June 2017, 17:23
  3. pls help me verify my code not work, why???
    By chai98a in forum mel PIC BASIC Pro
    Replies: 1
    Last Post: - 18th January 2010, 09:19
  4. Why doesn't this servo code work?
    By artswan in forum mel PIC BASIC Pro
    Replies: 3
    Last Post: - 5th December 2009, 22:18
  5. Why doesn't my code for 18f452 work on 18f252?
    By senojlr in forum mel PIC BASIC Pro
    Replies: 4
    Last Post: - 23rd December 2005, 02:42

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