Help with VK204-25 I2C communication

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

Moderators: Henry, Mods

Post Reply
leonardo_bolzonella
LCD?
Posts: 5
Joined: Mon May 27, 2019 1:42 pm

Help with VK204-25 I2C communication

Post by leonardo_bolzonella »

Hi everyone!
I recently found an old vk204-25 rev 1.22 and I started playing around with it. I plugged it to an arduino, but I failed to archive communication. I think the problem is that it is not set to i2c mode, since I know for sure that it was used through RS-232. I tried checking in the manual but I failed to find where the setting actually is. What should I do to set the LCD to i2c mode?
Thanks in advance for the help!

Here is a pic of the lcd:
Image

Daniel Divino
Matrix Orbital
Matrix Orbital
Posts: 247
Joined: Thu Sep 24, 2015 9:38 am

Re: Help with VK204-25 I2C communication

Post by Daniel Divino »

Hi Leonardo,

It's good to see some of our older display models are still kicking around!

The baud rate and I2C address on your Rev 1.22 VK204-25 can be configured by populating jumpers on the J0-J3 pins. According to section 2.1.3 in the VK204-25 Rev 1.23 classic manual, it looks like your display is configured to communicate at a baud rate of 1200 (RS232 mode), and has an I2C Slave address of 0x50H.

For your testing, you'll have to take into account that Arduino uses 7 bit I2C addressing throughout, while the VK204-25 lists 8bit addresses. You can convert the VK204-25 I2C address to 7 bits by dropping the LSB and shifting the value 1 bit to the right.

So, if your VK204-25 is currently configured to have an I2C address of 0x50H (0101 0000), you will have to convert the I2C address as follows:

0x50H = 0101 0000
Convert to 7 bits (drop LSB) = 0101 000
Shift 1 bit to the right = 0010 1000
Arduino 7 bit I2C address : 0x28H (0010 1000)

If you configure your display to communicate at a different baud/I2C address, your converted address will look different. Once converted to 7 bits, specify the new slave address in Arduino and try to communicate with the display once more.

Cheers,
Dan
Daniel Divino
Technical Support
Matrix Orbital

leonardo_bolzonella
LCD?
Posts: 5
Joined: Mon May 27, 2019 1:42 pm

Re: Help with VK204-25 I2C communication

Post by leonardo_bolzonella »

Hi Dan,
thank you for your reply! First of all, the IDE sent me an error message for the address 0x28H, so I used a binary to hexadecimal converter and it seems that the new address is actually 0x28. I updated the code, but I still get no results on the lcd, just the bottom-right corner blinking. I proceed doing an address scan, but the scan freezes as soon as it starts; disconnecting the SDA and SCL pins will unfreeze everything,with a result of "no devices detected". I also tried the whole process with pull-ups resistors for SDA and STL, with no results as well.

Thank you,
Leo

Daniel Divino
Matrix Orbital
Matrix Orbital
Posts: 247
Joined: Thu Sep 24, 2015 9:38 am

Re: Help with VK204-25 I2C communication

Post by Daniel Divino »

Hi Leonardo,

My bad. The 'H's were meant to denote that the values were in hex.

Are any jumpers present on the J0-J3 pins? Also, what commands/data are you sending to the display?

Cheers,
Daniel
Daniel Divino
Technical Support
Matrix Orbital

leonardo_bolzonella
LCD?
Posts: 5
Joined: Mon May 27, 2019 1:42 pm

Re: Help with VK204-25 I2C communication

Post by leonardo_bolzonella »

Hi Dan,
yeah of course, silly me I should've imagined the H was there for that reason.
Regarding the jumpers, it's easier for me to post a pic since I'm probably short of terms/knowledge to answer correctly, I'm sorry but I'm just starting out...
Image

My code is a simple hello world:
#include <Wire.h>
#define I2C_Address 0x28

void setup() {
Wire.begin();
}

void loop() {
Wire.beginTransmission(I2C_Address);
Wire.write("Hello world");
Wire.endTransmission();
}

Daniel Divino
Matrix Orbital
Matrix Orbital
Posts: 247
Joined: Thu Sep 24, 2015 9:38 am

Re: Help with VK204-25 I2C communication

Post by Daniel Divino »

Hi Leonardo,

What pins are you connected to on the Arduino? Have you tried swapping the I2C RX and TX lines?

Cheers,
Daniel
Daniel Divino
Technical Support
Matrix Orbital

Raquel
Matrix Orbital
Matrix Orbital
Posts: 796
Joined: Thu Aug 19, 2004 3:37 pm
Location: MO Office

Re: Help with VK204-25 I2C communication

Post by Raquel »

Hi Leonardo,

As you have an older display, I wonder if you please try it out over serial communication and see if the display is still functioning as intended?
Also, I wonder if you can place an oscilloscope to confirm the data you are sending on SCL and SDA lines?
Daniel has a good point, confirm that you have the SCL and SDA lines connected to the right pins. You will need external pull ups on these pins.

Best Regards,
Raquel
Raquel Malinis
Design and Development
Matrix Orbital

leonardo_bolzonella
LCD?
Posts: 5
Joined: Mon May 27, 2019 1:42 pm

Re: Help with VK204-25 I2C communication

Post by leonardo_bolzonella »

Hi,
I tried changing the pins already. I also tried both on Arduino Diecimila's A4 and A5 pins and on Arduino Mega's SDA and SCL dedicated pins.

Regarding the Oscilloscope and serial communication, sadly I'm about to move to another country and most of my staff is already there, so I don't have an Oscilloscope at the moment... I'll see if I can find the proper cable though. I'lllet you know when I do.
Thanks!

leonardo_bolzonella
LCD?
Posts: 5
Joined: Mon May 27, 2019 1:42 pm

Re: Help with VK204-25 I2C communication

Post by leonardo_bolzonella »

Hi,
I tried changing the pins already. I also tried both on Arduino Diecimila's A4 and A5 pins and on Arduino Mega's SDA and SCL dedicated pins.

Regarding the Oscilloscope and serial communication, sadly I'm about to move to another country and most of my staff is already there, so I don't have an Oscilloscope at the moment... I'll see if I can find the proper cable though. I'll let you know when I do.
Thanks!

Daniel Divino
Matrix Orbital
Matrix Orbital
Posts: 247
Joined: Thu Sep 24, 2015 9:38 am

Re: Help with VK204-25 I2C communication

Post by Daniel Divino »

Hey Leonardo,

Any luck establishing communication with the VK204-25?

Cheers,
Daniel
Daniel Divino
Technical Support
Matrix Orbital

Post Reply