Go Down

Topic: Trouble initializing i2c display (Read 3891 times) previous topic - next topic

aarg

Maybe the reset circuit on your Arduino is defective.
  ... with a transistor and a large sum of money to spend ...
Please don't PM me with technical questions. Post them in the forum.

xl15

I don't think so. I've tried two different UNO boards.

aarg

#17
Mar 24, 2015, 10:23 am Last Edit: Mar 24, 2015, 10:28 am by aarg
Perhaps post your code in its entirety? It looks like you've omitted your loop(). Or a complete subset that reproduces the problem...
  ... with a transistor and a large sum of money to spend ...
Please don't PM me with technical questions. Post them in the forum.

xl15

The loop isn't much to see :)

Code: [Select]
#include <Wire.h>
#include <LiquidCrystal_I2C.h>

LiquidCrystal_I2C lcd(0x27 , 2, 1, 0, 4, 5, 6, 7, 3, POSITIVE);  // Set the LCD I2C address

void setup() 
{
  delay(1000);
  Serial.begin(9600); 
  delay(1000);
  Wire.begin();       
  delay(1000);
  lcd.begin(20,4);   
  lcd.noBacklight();
  delay(250);
  lcd.backlight();
  lcd.setCursor(0,0);
  lcd.print("Initializing...");
  delay(1000);
  lcd.clear();

}

void loop()   
{
  lcd.setCursor(0,0);
  lcd.print("Loop...");
  delay(1000);
}

aarg

Try moving lcd.clear() to immediately after lcd.begin().
I looked at some of my code (but it's a 16x2 display, not 20x4), and that's how I have it. I'm using the same LCD library.
  ... with a transistor and a large sum of money to spend ...
Please don't PM me with technical questions. Post them in the forum.

xl15

OK, I'll try that.

But I might be on to something else.
I ran an i2c scanner and found two adresses I didn't think about. 0x50 and 0x68.
I'd forgot about my i2c real time clock. It's soldered directly to my homemade shield so it's still connected when I thought I removed everything except the display on the i2c bus.

I guess the 0x68 is the rtc and 0x50 is the eeprom onboard the rtc.

aarg

#21
Mar 24, 2015, 11:30 am Last Edit: Mar 24, 2015, 11:32 am by aarg
OK, I'll try that.

But I might be on to something else.
I ran an i2c scanner and found two adresses I didn't think about. 0x50 and 0x68.
I'd forgot about my i2c real time clock. It's soldered directly to my homemade shield so it's still connected when I thought I removed everything except the display on the i2c bus.

I guess the 0x68 is the rtc and 0x50 is the eeprom onboard the rtc.
Perhaps, but I have had the same kind of RTC connected with the LCD on the same I2C bus in a digital clock experiment, and never had any conflicts. Are you sure everything is designed to run on the same voltage? 5V, I presume?
  ... with a transistor and a large sum of money to spend ...
Please don't PM me with technical questions. Post them in the forum.

xl15

No, I agree. It should work. I mean, that's what is2 is for.
I think the RTC has built in pull-up resistors for SDA and SCL.
And I have pull-ups on my breadboard.
Is it possible that several pull-up resistors is causing the issue?

sureview

you should only need one pull up on the bus, I have had odd results with the lcd lib and I2c bus myself, try adding a delay after every instruction to the lcd and see if that cures it , you can then remove the delays until it stops working again

hope this helps

xl15

Seems like the i2c to lcd adapter was faulty.
With a new one it works.
But i destroyed my large 30€ LCD in the process :(
So now I'm testing with a small (standard) LCD.

jeroenb42

I know it's an old topic but I have the exact same problem as the original poster, except that I am just connecting two Arduino's, I2C Master and I2C Slave. If I have my laptop connected, it works but when I disconnect the Slave and reconnect again, the Master does not see the Slave. If I press reset, nothing, if I use the reset pin, nothing, but as soon as I open the serial monitor.... It works. I have tried with 4 Arduino's (all Nano) and exact same result. I had already tried removing all Serial communication, no difference. It's driving me insane that I cannot get this to work.

sureview

I have had a similar problem , everything would work after i downloaded the  sketch , but then when stand alone - no display, in the end it was the rtc module which was on the same i2c bus

I am now moving on to a nextion display, which is looking really good

jeroenb42

After fiddling around some more, I found out that if the I2C slaves are not connected via USB but through USB power only, all worked. I wrote a post on it because I was so happy it worked:
https://piandmore.wordpress.com/2016/09/15/multiple-arduino-i2c-slaves/

Go Up