Arduino Micro and a SPLC780 controlled 20X4 LCD screen - not working.

I am using Arduino Micro replica and a SPLC780 controlled 20X4 LCD screen.
I2C is wired correctly. Other stuff were detached to isolate the problem.

Library LiquidCrystal_I2C.h came from here:

For some reason this code doesn’t work. (I changed screen size, ofcourse but that didn’t effect anything.)

Is pinout between SPLC780 different than what is in the code?

// lcd_I2C_test 
#include <Wire.h>
#include <LiquidCrystal_I2C.h>

#define I2C_ADDR    0x27
#define BACKLIGHT_PIN     3
#define En_pin  2
#define Rw_pin  1
#define Rs_pin  0
#define D4_pin  4
#define D5_pin  5
#define D6_pin  6
#define D7_pin  7
LiquidCrystal_I2C lcd(I2C_ADDR,En_pin,Rw_pin,Rs_pin,D4_pin,D5_pin,D6_pin,D7_pin,BACKLIGHT_PIN,POSITIVE);

int loopCount = 0;

void setup()
{
 // Switch on the backlight
 pinMode ( BACKLIGHT_PIN, OUTPUT );
 digitalWrite ( BACKLIGHT_PIN, HIGH );

 lcd.begin(20,4);               // initialize the lcd 

 lcd.home ();                   // go home
 lcd.print("Hello, ARDUINO ");  
 lcd.setCursor ( 0, 1 );        // go to the next line
 lcd.print ("     WORLD!  ");      
}

void loop()
{
 lcd.clear();                // clear LCD screen
 delay(200);
 lcd.print("Hello, ARDUINO "); 
 lcd.setCursor ( 0, 1 );        // go to the next line
 delay(200);
 lcd.print ("    WORLD!  ");      
 delay(500);
 lcd.setCursor ( 0, 1 );        // go to the next line
 lcd.print (loopCount++);
 blink2();
 delay(500);  
}

void blink2(){
 static byte lastState ;
 pinMode ( 13, OUTPUT );
 if (lastState != HIGH){
   digitalWrite ( 13, HIGH ); 
   lastState = HIGH;
 }
 else {
   digitalWrite ( 13, LOW ); 
   lastState = LOW;
 }
}

I2C requires some resistors to add more nodes to the network. Is there a device that can gauge the quality of I2C communication the way it is done in fiber optics?

I cannot measure the capacitance of the network easily and some more nodes may be added. So I would like to use some resistors that I can swap in and out and some way to test for what their value should be.

Is pinout between SPLC780 different than what is in the code?

The SPLC780 is the Sunplus equivalent of the Hitachi HD44780U LCD controller. It is functionally the same as all the other controllers and I suppose the pinout is the same as well. That pinout is of no concern as long as the LCD module on which it is mounted has the standard 14 or 16 pin layout.

It is the I2C adapter board and it’s configuration that you must be concerned about. Since you are apparently using the recommended fmalpartida library you must now make sure that the particular defines that you use are compatible with your specific adapter board.

The numbers in the defines are defining which of the I/O output port pins on the PCF8574 or PCF8574A chip (the chip on the I2C adapter) is used to drive each of the corresponding LCD module connections.

Did you look at the examples at the site recommended in your non-link above?

Non-link: http://arduino-info.wikispaces.com/LCD-Blue-I2C
Link: http://arduino-info.wikispaces.com/LCD-Blue-I2C

(created by using the ‘link’ button which surprisingly looks like a chain link)

I2C requires some resistors to add more nodes to the network.

It’s frequently just the opposite. The I2C system requires one set of pull-up resistors in order to function. Since a set of those required resistors are frequently found already mounted on I2C devices you may have to remove resistors from some boards when you are using more than one I2C device simultaneously

Don

So what happened when you used the guesser?

Paul__B:
So what happened when you used the guesser?

Are there three common combinations that I can try for a PCF8574t IC that converts parallel to I2C?

Are there resistors that I would need to add to the board if I use more than one I2C device?

How can "guesser" work if there is no convenient way to switch between guesses?

Run the guesser sketch. Report what it says.

You will get a solution within minutes. Or some sensible advice.

Posting a clear photo of your I2C adapter soldering on the LCD.
Post a photo of the Uno and the FOUR wires that connect to the LCD backpack

David.

Guesser doesn't work. It is not user friendly.
What do I enter into the serial monitor prompt?

Maybe I already burnt the hardware? There are cautions to this tool.

VT91:
Are there resistors that I would need to add to the board if I use more than one I2C device?

Floresta has already answered that.

VT91:
How can "guesser" work if there is no convenient way to switch between guesses?

Are you having trouble with the "guesser"? It is supposed to step through successive guesses as you hit Enter, but it has not worked for me in the past (using Linux, BTW), so I modified it to step every couple of seconds instead. I have since (manually, no-one is managing the repos) updated the IDE and will try it again since you mention it.


Just in - another reply!

Yes, you need to post that photo - a perfectly focused photograph of your set-up with all wires and parts 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.

david_prentice:
Run the guesser sketch. Report what it says.

You will get a solution within minutes. Or some sensible advice.

Posting a clear photo of your I2C adapter soldering on the LCD.
Post a photo of the Uno and the FOUR wires that connect to the LCD backpack

David.

I will get a solution? It works like a brute force hacking program or just as a more convenient way to sit and try all combinations?
Quick glance of the code told me that it does the latter.

i2cLCDguesser v1.4.1
 - Guess constructor for i2c LCD backpack
----------------------------------------------------------------
NOTE/WARNING: Guessing the i2c constructor is not really a
good thing since it could damage the hardware. Use with caution!
Do not leave things with an incorrect guess for too long.
i.e. advance to the next guess as soon as possible
when the guess in incorrect.
If the guess is correct, the constructor will show up
on the LCD.
----------------------------------------------------------------

<Press <ENTER> or click [Send] to Continue>
Scanning i2c bus for devices..
i2c device found at address 0x27
Device found: PCF8574
<Press <ENTER> or click [Send] to start guessing>

Send/Enter command doesn’t work when there is no text typed. So what am I supposed to do with this program?

VT91:
Guesser doesn't work. It is not user friendly. What do I enter into the serial monitor prompt?

Just "Enter" key. Will go (another machine) and try it out.

VT91:
Maybe I already burnt the hardware? There are cautions to this tool.

Oh, don't fuss, he is just being over-cautious. You are extremely unlikely to do damage.


Yet more!

VT91:
Quick glance of the code told me that it does the latter.

Yep.

VT91:
Send/Enter command doesn't work when there is no text typed. So what am I supposed to do with this program?

Serial monitor must be set to send CR/LF. On the bottom bar.

This helped but this program is still unusable because there are probably several hundreds of thousands of possible combinations.

Here is a datasheet:

http://www.aliexpress.com/item/Free-shipping-LCD-module-Blue-screen-IIC-I2C-2004-5V-20X4-LCD-board-provides-library-files/32249596329.html

but I cannot interpret how this information applies to the program code that I am writing.

VT91:
This helped but this program is still unusable because there are probably several hundreds of thousands of possible combinations.

Potentially, yes, but in practice no. There are a limited number of wirings in actual use and the "guesser" knows them.

VT91:
Here is a datasheet:
http://www.aliexpress.com/item/Free-shipping-LCD-module-Blue-screen-IIC-I2C-2004-5V-20X4-LCD-board-provides-library-files/32249596329.html

Now we're talking. Actual information! So, that "FC-113" is one of the common I2C "backpacks" and is guaranteed to be found and enumerated by the "guesser".

VT91:


but I cannot interpret how this information applies to the program code that I am writing.

It's irrelevant. You are using a library to figure it all out.

It now occurs to me that you do not actually know how to set up these displays and your original "For some reason this code doesn't work" fooled us.

Start by connecting only 5V and ground to the I2C module. If the backlight does not go on as you power up, use a bright light or torch to see the display. Adjust the contrast control (the blue potentiometer) until you see a row of "blocks" - white if the display is lit, black if you are shining a light on it - on the first line only.

When you have that correctly set, then connect the I2C lines and run the "guesser".

And always tell us what you see, not "this code doesn't work". :roll_eyes:

Well, the "guesser" sketch works fine for me except for the way I put FM's library in the original LiquidCrystal folder.

And I note a page for your FC-113 display which gives you the descriptor.

LiquidCrystal_I2C  lcd(0x27,2,1,0,4,5,6,7); // 0x27 is the I2C bus address for an unmodified module

This line of code has a combination of numbers, separated by comma.
What do they mean?

If I look at “pin connections”, what does that tell me?

I am also using that “improved”<LiquidCrystal_I2C.h> library.

IN a “guesser” should “POSITIVE” and “NEGATIVE” correspond to LCD being lit at the end of a combination attempt? In my case “POSITIVE” and “NEGATIVE” are not related to back light state.

What do other numbers mean? Why are they decimal or hex?

I get a backlit screen only about 1 out of every 8 times I press “enter”. Something is wrong with the guesser algorithm.

See reply #12.

This line of code has a combination of numbers, separated by comma.
What do they mean?

The 0x27 is the I2C address of the adapter board. It is in hex because that is the radix that the manufacturer uses. Finding it on the data sheet is another issue entirely.

The other numbers, as I previously explained, represent the connections between the chip on the I2C adapter and the pins going to the LCD module. They are in decimal because that is the way they are typically defined on the datasheet for the chip.

If I look at “pin connections”, what does that tell me?

It gives you information on how to connect the LCD module directly to the Arduino (or other microcontroller) if you decide not to use an I2C adapter.

In my case “POSITIVE” and “NEGATIVE” are not related to back light state.

Why would they be different in your case compared to everyone else?

Now that I have answered some of your questions it would be really nice if you were to go back and see if you could answer some of the questions that you were asked.

Don

0x27,2,1,0,4,5,6,7,3 was the code for
http://www.aliexpress.com/item/Free-shipping-LCD-module-Blue-screen-IIC-I2C-2004-5V-20X4-LCD-board-provides-library-files/32249596329.html

I didn't notice the potentiometer that adjusts brightness.

This is why my screen was not showing anything.

Addresses of devices are set by the manufacturer?
So if I hook up two sensors of identical model and manufacturer, they will be treated as the same sensor, producing errors?

What would be an official technique to see / change the I2C addresses?

Here they discuss changing addresses in runtime.

Here they suggest to scratch off some conductors on the circuit board.

Thank you for help.

Do I scratch off traces near those resistors? Which ones are resistors?

Addresses of devices are set by the manufacturer?
So if I hook up two sensors of identical model and manufacturer, they will be treated as the same sensor, producing errors?

What would be an official technique to see / change the I2C addresses?

The basic address range is determined when the I2C IC is manufactured. Many I2C devices have address pins that can be used to alter the basic address. If that is the case you typically change the address by adding or removing jumpers or resistors depending on the particular pc board implementation.

In your case there are three jumpers next to your blue potentiometer. These give you the capability of selecting eight different addresses for each chip variant that may be on your board.

The available PCF8574T addresses will be in the range of 0x20 to 0x27

The available PCF8574AT addresses will be in the range 0x38 to 0x3F

Don

VT91:
0x27,2,1,0,4,5,6,7,3 was the code for LCD module

It probably was, but if you now have the contrast control correctly set, the "guesser" will give you the exact descriptor to use in your code.

VT91:
I didn't notice the potentiometer that adjusts brightness.

This is why my screen was not showing anything.

Yes, I finally twigged to that problem. :slightly_frowning_face:

VT91:
Addresses of devices are set by the manufacturer?
So if I hook up two sensors of identical model and manufacturer, they will be treated as the same sensor, producing errors?

Well, they may generate errors, but in general, the two displays should show identical information.

VT91:
What would be an official technique to see / change the I2C addresses?

Bridge one or more of the address jumpers on your module.

On that photo, they are to the right of the potentiometer.

VT91:
Here they discuss changing addresses in runtime.

Totally irrelevant.

VT91:
Here they suggest to scratch off some conductors on the circuit board.

But you do not have one of those Adafruit modules, do you?

VT91:

Do I scratch off traces near those resistors? Which ones are resistors?

Why would you want to? What is that thing anyway? What does it have to do with your 20X4 LCD screen?