LCD03 doesn't work on a Arduino Mega 2560 and GY_86

Post Reply
dibelardino
Posts: 8
Joined: Thu Dec 11, 2014 9:48 am

LCD03 doesn't work on a Arduino Mega 2560 and GY_86

Post by dibelardino »

Good morning to everybody.
I am facing a problem with the LCD03 installed on an Arduino Mega 2560 with an IMU GY_86.
All the correct options are set up in the config file (eventually I will post a copy, but the problem isn't there)
When I connect the LCD (pin 20 and 21 of the Arduino) the LCD powers on and shows the start up text (the one that shows even if you don't connect I2C)
When theMultiWii software boots up nothing change in the LCD.
I did some debug and I'm sure that it goes correctly trough the InitLCD routine.
I see two problems:
1) the LCD03 datasheet asks for internal or external PULLUPS, but the MultiWii, when sets up MPU6050, disable the internal Pullups.
2) In the MPU6050 initialization the I2C is set to 400 Khz. Maybe it is too high for the LCD03 (in the LCD03 web page I don't find any specification about I2C maximum speed)
Does anybody out there already faced the problem?
Regards Marco Di Belardino
www.advancedaviation.it

dibelardino
Posts: 8
Joined: Thu Dec 11, 2014 9:48 am

Re: LCD03 doesn't work on a Arduino Mega 2560 and GY_86

Post by dibelardino »

UPDATE

Partially solved. Lowering the I2C speed to 100kHz the LCD works.
To do that I commented the following line in the Sensor.cpp file

#if defined(MPU6050)
void Gyro_init() {
//TWBR = ((F_CPU / 400000L) - 16) / 2; // change the I2C clock rate to 400kHz

Doing that works the I2C configuration in I2C_init

TWBR = ((F_CPU / I2C_SPEED) - 16) / 2; // change the I2C clock rate

I tried to set the I2C speed to 200kHz, but it doesn't work.
Does the lower speed will affect the flight performances?
Bye Marco

Post Reply