Page 1 of 1

I2C - device and register addressing

Posted: Thu Jan 06, 2005 6:47 pm
by rdolf
I'm using an Lk202-25 on an embedded platform which allows me only indirect access to the I2C bus via libary functions. The write api is something like:
int i2cWrite(byte deviceAddr, byte registerAddr, byte data);

When writing text to the lk202, the lk seems to interpret the register address as display text with the result that every time I call the write function, I actually get 2 bytes of text displayed.

I have found various descriptions of the I2C protocol that conform to the API provided on my platform (e.g. http://www.robot-electronics.co.uk/htm/ ... 2c_bus.htm).

Does anyone know how I can get the LK202 to display text with this I2C driver which wants to send an internal register address as well as the device address?

TIA,
Richard

Posted: Fri Jan 07, 2005 7:48 am
by Miles
Hello rdolf,

Thanks for the question. Since your I2C platform requires an "internal register address", would it be possible for you to send a null character that the display won't interpret as an ASCII string? :-?

Posted: Fri Jan 07, 2005 10:10 am
by rdolf
If there was a non-printing character that didn't print, I think your solution would work. Unfortunately, the LK202 behaves as described in the documentation; non-printing characters print as a space.

Richard

Posted: Fri Jan 07, 2005 1:51 pm
by Miles
Would you be able to send the write command then issue a "cursor left" command...? :-?

Posted: Mon Jan 10, 2005 10:11 am
by rdolf
Thanks for your help, I have a solution working now.

Richard

Posted: Mon Jan 10, 2005 10:23 am
by Miles
Good to hear! If you have any further questions or concerns, let us know!! :D