PCF8575 Does not work with my code....


Closed Thread
Results 1 to 20 of 20

Hybrid View

  1. #1
    Join Date
    Aug 2011
    Posts
    458


    Did you find this post helpful? Yes | No

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

    Commands to the PCF should be an even number of bytes (one for each port), and you seem to be showing 3.
    What's the extra byte after the address?

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


    Did you find this post helpful? Yes | No

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

    I tried to "bruteforce" all possible address locations - no change.

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

    Name:  writebit.jpg
Views: 1265
Size:  284.6 KB

  3. #3


    Did you find this post helpful? Yes | No

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

    PBP handles the read write bit if I remember correctly, leave your 0 out

    this is my code

    ADDR=78 PORTBYTE IS VALUE FOR PORTBITS

    i2cwrite sda,scl,ADDR,PORTBYTE 'ENSURE ALL OFF ON POWER UP

    So I think your code should be

    I2CWRITE SDAM,SCLM,%01000000,[%11111111,%11111111] 'enable outputs

  4. #4


    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 07:39.

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


    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....

  6. #6
    Join Date
    Aug 2011
    Posts
    458


    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.

  7. #7
    Join Date
    Feb 2013
    Posts
    1,154


    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.

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, 23: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, 18: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, 10:19
  4. Why doesn't this servo code work?
    By artswan in forum mel PIC BASIC Pro
    Replies: 3
    Last Post: - 5th December 2009, 23: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, 03: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