PCF 8577 I2C problem


The above data sheet is the chip I’m using. I have an LCD screen hooked to the PCF 8577 but all of the pins on the PCF 8577 are set at “0” so every segment is currently lit. I tried changing the values of the output pins with the following code, and nothing is happening. I think I might have the address for the chip wrong but I’m not sure. The Data Sheet says the address is “01110100” but it says that the chip has that automatically. However I have pins a0 -a2 set to ground, so maybe the address is different?

Hopefully someone can help. I’m stumped.

#include <Wire.h>

byte address = 01110100;   // address of PCF8577 with A0-A2 connected to GND 
byte input; // variable to receive the two bytes
byte c; // first of the two bytes to read
byte d; // second of the two bytes to read
void setup()
   Wire.begin();       // join i2c bus 
   Serial.begin(9600); // used to Debug 

void loop(){
   byte a = B00000000; //Should mean Bank 1 regester 0 
   byte b = B11111111; //controls pins 1-7 in register 0
  // by changing the 1's and 0's above you can control which pins are on and off. 
  // The chip sinks, So the 1's are off and the 0's are on.
      Wire.beginTransmission(address);   // send the address and the write cmnd
      Wire.send(a);                      // pack the first byte
      Wire.send(b);                      // second byte
      Wire.endTransmission();            // send the data
    input = Wire.requestFrom(01110100,2);
      c = Wire.receive();
      d = Wire.receive();
    Serial.println(c, BIN);  
    // delay(1000);

The read stuff at the end, is just because I was trying to use the serial monitor to see if I was actually effecting anything. But the monitor just spits out “0’s”

OK everyone, if you are using I2C devices you absolutely must visit the following link:


Nick Gammon has an I2C address scanner script for Arduino that reads the address of the slave device! It works Great!!!

Anyway, I did have my address wrong, and now my LCD display is working like it should.

I would like to thank Robillaart for steering me to that link.

And also a huge thanks to Nick Gammon for the great web site and scripts, not to mention thanks to my momma and Elvis!!!