Pcf8574 & 16f877


Closed Thread
Results 1 to 3 of 3
  1. #1
    Join Date
    Feb 2007
    Posts
    37

    Default Pcf8574 & 16f877

    Hi to all.

    I need to use the PCF8574 to increase the number of I/O pins. I have e trouble to work with it.

    I use:

    SCL var PORTC.3 ' Clock pin pull up 4.7K
    SDA var PORTC.4 ' Data pin pull up 4.7K

    Cont = %01001000 'address of PCF8574 bits: A0=0 A1=0 A2=1

    start:
    for v = 0 to 255
    toggle LEDRED
    I2CWRITE SDA,SCL,Cont,[%11111111]
    PAUSE 500
    I2CWRITE SDA,SCL,Cont,[%00000000]
    PAUSE 500
    hserout ["v=", dec v, 13,10]
    next v
    toggle LEDGRE

    goto start
    End


    All works correctly but the I/O pins on the PCF8574 do not flip.

    Do you have any suggestions?

    Ciao

    Leo
    Last edited by Wirecut; - 11th July 2008 at 03:29. Reason: improper sending

  2. #2
    skimask's Avatar
    skimask Guest


    Did you find this post helpful? Yes | No

    Default

    Quote Originally Posted by Wirecut View Post
    I need to use the PCF8574 to increase the number of I/O pins. I have e trouble to work with it.
    Have you got a PCF8574 or PCF8574A?
    Control bytes are different between the two...

  3. #3
    Join Date
    Feb 2007
    Posts
    37


    Did you find this post helpful? Yes | No

    Smile

    Hi

    problem solved. I have swapped SDA with SCL. Now work perfectly.

    Thanks skimask for your suggestion.

    Ciao

    Leo

Similar Threads

  1. Replies: 3
    Last Post: - 15th October 2012, 09:06
  2. 16f877 and ps/2 keyboard error???
    By boraciner in forum mel PIC BASIC Pro
    Replies: 2
    Last Post: - 5th July 2009, 09:14
  3. serial communication between CMUcam and PIC 16F877
    By gengkeys in forum mel PIC BASIC Pro
    Replies: 5
    Last Post: - 30th March 2007, 07:43
  4. 4 Quadrant dc drive with 16F877
    By mns45 in forum mel PIC BASIC
    Replies: 2
    Last Post: - 23rd February 2006, 14:05
  5. how to get PCF8574 and PIC16F876A work together
    By nomada in forum mel PIC BASIC Pro
    Replies: 3
    Last Post: - 15th December 2004, 03:07

Members who have read this thread : 1

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