I2C on LCD driver

Good evening

I’m try to control LCD (40 pin) display with Arduino. I use an IC: PCF8576, connected to Arduino with I2C.

I use this code to debug devices:

#include <Wire.h>

#define ADDRESS          0x70//B0111000      //  I2C Address of PCF8576
#define DEVICE_SELECT    B11100000    //  Device select   [Command]    [1100]    [A2 A1 A0]
#define MODE_SET         B11001000//B11011001//B11001000    //  MODE SET      [C]   [10]   [LowPower]   [Enable]   [Bias]   [Mux]
#define BANK_SELECT        B11111000      //  no effect in 1:4 multiplex mode

#define zero             B11110011
#define one              B01100000
#define two              B11010110
#define three            B11110100
#define four             B01100101
#define five               B10110101
#define six                B10110111
#define seven           B01110000
#define eight           B11110111
#define nine            B11110101

#define pointer_digit1     B00001100   //   C  0  P5  P4  P3  P2  P1  P0
#define pointer_digit2    B00001010
#define pointer_digit3    B00000011
#define pointer_digit4    B00000001
#define pointer_col         B00001000

boolean unaSola = false;
void mod1();
void mod2();

void setup(){
 Wire.begin(); //conects I2C
 Serial.begin(9600);
 delay(100);
mod2();
  
}


void loop(){
 byte highByte;
 byte lowByte;
 
   delay(2000);
   if (unaSola=true) {
     unaSola=false;
     mod2();
   }
   else{
     unaSola=true;
     mod22();
   }
   
  
  Serial.println(); 
  Serial.println(highByte);
  Serial.println(lowByte);
  delay(100);
}

void mod2(){
   Wire.beginTransmission (ADDRESS) ;  
    Wire.write (MODE_SET) ;   
    //delay(10);
    Wire.write (DEVICE_SELECT) ;  
    Wire.write (B11111000) ;
    //Wire.write (B11110000) ;
    //delay(10);
    Wire.write (pointer_digit1) ;
    //delay(10);  
    Wire.write (1) ;
    //delay(10);
    Wire.endTransmission () ;
}

void mod22(){
   Wire.beginTransmission (ADDRESS) ;  
    Wire.write (MODE_SET) ;   
    //delay(10);
    Wire.write (DEVICE_SELECT) ;  
    Wire.write (B11111000) ;
    //Wire.write (B11110000) ;
    //delay(10);
    Wire.write (pointer_digit1) ;
    //delay(10);  
    Wire.write (8) ;
    //delay(10);
    Wire.endTransmission () ;
}

I have actually this problem: there is square wave in many out put pin of IC (period about 20ms), the display doesn’t show anything, I can’t see any number or digit form LCD.

What is wrong?
Maybe the LCD is broken? In this case what I can do to test it?

Thank’s

You have 3 elements that need to work independently, before you put them together to work as a system:

  • the PCF8576 I2C device (BTW: is this one of those boards designed specifically for LCD displays?)
  • the LCD; why 40 pins? what kind of controller does it have?
  • the Arduino sketch sending I2C commands.

Ok, thanks. I answer to some question. The PCB that I use in this experiment is specific designed for LCD display driven by PCF8576 (I have applied only two connection to SDA and SCL pin of the IC making welding, I verified if there's some noise or interference with oscilloscope in this line but all seems to be right).

I can't check the code of LCD device but I think is more then 4 digit.

PCF8576 devices has pin A0 A1 A2 and SA0 connected to gnd, is correct set adress to 70 (hex) ?

Have you also connected 5v and gnd?

Weedpharma

Well, the basic problem here is that you have the pieces there and we have no idea what they all are.

An old saying goes that "a picture is worth a thousand words" and in this case, it it pretty accurate.

So I see you have figured out how to post code here, you need to do the same with pictures of each of your pieces. Pictures must be perfectly focused photographs of your set-up with all connections clearly visible as they terminate on the modules and show that as a link in the text, not an attachment.

The best way to do this is to take it outside in full daylight but not direct sun and use a digital camera at least a metre away from directly above (or very slightly offset to ensure all the connections are able to be distinguished) using the (actual) zoom to just include all parts of the assembly.

If you have a web link to any of the parts, that is equally important to include.


Now you may be able to help me with a little common but annoying problem here. We know you do not speak English natively. You have used the term "welding" which in the English language refers to this process:


The process of connecting electronic components using a tin/ lead or alternative "lead free" alloys called "solder" is always called "soldering". It is clearly not in any way similar to "welding" in which the joining material is the same as the material being joined. I am aware that the process of welding is in many other languages called "solder" or something close. What I would like to know is how in your language you distinguish the two processes so that you know to which one you are referring and how you set the context?

Thank you for replay.

Sure I have used TIG-welding to connect SDA and SCL pin. But, joking aside...

In my language "solder" process and "welding" is called in the same manner, so I was confused and I have wrong, I'm sorry.
We distinguish them by the context. Obviously I'm referring to the second one (in other manner I couldn't connect the interested termination).

Returning to the main problem, I haven't show any photo because my set-up it's so simple and inaccurate.
But made other test I have found the mistake, in any way the code is correct. It was an hardware problem, the backligth resistance was disconnected (I have no idea what happen, maybe it was cut). Now it's working correctly.

Unfortunately, we can't help fix problems where something is not actually connected - which is why we always ask for the picture. If it has enough detail it is often possible to spot the break.

Thank you for your language clarification. It is rather spooky for an English speaker to find that other languages are unable to distinguish important details.