LK204-25 Rev 2.0 w/Arduino Mega2560 I2C

LK/ELK/VK/PK/OK/MX/GLK/EGLK/GVK/GLT Series

Moderators: Henry, Mods

Post Reply
drkidd22
LCD?
Posts: 8
Joined: Fri Dec 05, 2008 10:02 am

LK204-25 Rev 2.0 w/Arduino Mega2560 I2C

Post by drkidd22 »

Hello,

I'm trying to figure out how to get this thing going over I2C. I can't even clear the screen. I've tried with TTL using the Arduino Mega2560 board and it works well that way. By default the LCD is Address is 0x50 and when shifted right for 7-bits I get 0x28. Below is the code I've tried sending the LCD to clear the splash screen. I've verified the jumpers are correct. Not sure if it a timing issue or what. Any Ideas?

Code: Select all

#include <Wire.h>
#include <stdlib.h>

void setup() {

  Wire.begin();
  Serial.begin(9600);
}


void loop() {
  Wire.beginTransmission(0x28);
  // These next two bytes send the command to clear the display.
  Wire.write(254);
  Wire.write(88);
  Wire.write("LCD Cleared");
  Wire.endTransmission();
  delay(500);
} 

Clark
Matrix Orbital
Matrix Orbital
Posts: 881
Joined: Fri Aug 17, 2007 10:58 am
Location: Matrix Orbital
Contact:

Re: LK204-25 Rev 2.0 w/Arduino Mega2560 I2C

Post by Clark »

Hello Dr Kidd,

It sounds like you have verified that the 2 I2C protocol pads on your LK204-25 Rev2.0 are connected while there are not shorts remaining on the RS232 pads, and that you have 5V pull-up resistors of 1K-10K on your SCL and SDA lines. I see your code is very similar to this example, but if your newer display is sending back a 'not acknowledged' response to your host on the ninth clock cycle by letting SDA float high, you might try using address 0x50.

Thanks,
Troy
Troy Clark
Design & Development
Matrix Orbital

drkidd22
LCD?
Posts: 8
Joined: Fri Dec 05, 2008 10:02 am

Re: LK204-25 Rev 2.0 w/Arduino Mega2560 I2C

Post by drkidd22 »

Yes, it is similar because that's were I took it from :). The Arduino Mega 2560 has 10K pull up resistors on SDA and SCL data lines.
I've tried sending 0x50 as well without any luck. :( not sure what's going on here.

Clark
Matrix Orbital
Matrix Orbital
Posts: 881
Joined: Fri Aug 17, 2007 10:58 am
Location: Matrix Orbital
Contact:

Re: LK204-25 Rev 2.0 w/Arduino Mega2560 I2C

Post by Clark »

I appreciate confirmation on the code and hardware; you could use stronger pull-ups (2.2K is common) but otherwise your set-up looks good.

You might try placing the display in override mode by powering down, connecting the middle two keypad header pins, and powering back up again. This will temporarily reset the unit to defaults, including the 0x50 I2C address.

Let me know how the override goes and keep me updated on any progress.

Thanks,
Troy
Troy Clark
Design & Development
Matrix Orbital

Post Reply