Page 1 of 1

LK204-25 and Arduino Mega

Posted: Mon Mar 08, 2010 1:55 am
by Jacqmaster
I just bought the LK204-25 and its default setting is RS232 mode.
I connected the LK204-Rx pin to Arduino Mega Tx1 (Serial1) and get 5V power from Arduino as well.
When power up the module, I can see the default startup screen.
But when I run the below tiny program, the result totally awkward.


void setup() {
Serial.begin(9600);
Serial1.begin(19200);
Serial1.flush();
}

void loop() {
if (Serial.available()) {
Serial1.print(Serial.read(), BYTE);
Serial.flush();
}
}

If I enter "a" from Arduino serial monitor, the LK204 LCD will display "0" on it.
Can someone help me out? :o

Posted: Mon Mar 08, 2010 5:33 am
by Ray
I suspect the Arduino is operating on TTL levels

Posted: Mon Mar 08, 2010 1:16 pm
by Jacqmaster
Ray wrote:I suspect the Arduino is operating on TTL levels
Thus, I just need to add MAX232 driver between Arduino and LK204 to converting the voltage level, am I right?

THanks,

Posted: Mon Mar 08, 2010 1:20 pm
by Ray
If you have a steady hand you can also move the zero ohm resistors on the back of the module from rs232 to ttl.

Posted: Sat Mar 20, 2010 1:52 am
by Jacqmaster
Ray wrote:If you have a steady hand you can also move the zero ohm resistors on the back of the module from rs232 to ttl.
Finally, I added one MAX202 circuit and it works greats. But I got another while connecting to a 4x4 keypad. When I short R1-C1, the LCD will display 246, R1-C2 =>61.
How can get read the keypad map such as R1-C1=>A, R1-C2=>B

Posted: Tue Mar 23, 2010 9:43 am
by Raquel
Hi Jacqmaster,

It sounds like somehow the EEPROM in your display module has been corrupt. By default, the keys should be transmitting those that are depicted in the tables on page 40 of the manual.

By using Assign Keypad Code command (254 / 213) you should be able to assign any values that you want the display to transmit when certain key combinations are shorted (depressed). See section 9.9 of the manual.

I hope this helps,

Posted: Tue Mar 23, 2010 3:59 pm
by Jacqmaster
Raquel wrote:Hi Jacqmaster,

It sounds like somehow the EEPROM in your display module has been corrupt. By default, the keys should be transmitting those that are depicted in the tables on page 40 of the manual.

By using Assign Keypad Code command (254 / 213) you should be able to assign any values that you want the display to transmit when certain key combinations are shorted (depressed). See section 9.9 of the manual.

I hope this helps,
May I ask one newbie question. In Arduino, I have to send separate commands in order to achieve the execution. for example,

Serial.print(254, BYTE);
Serial.print(213, BYTE);

but now I am not sure to issue command correctly.

Serial.print("ABCDEFGHIJKLMNOPQRSTUVWXY");

or some other formats.

Thanks,

Posted: Wed Mar 24, 2010 11:59 am
by Clark
Hi Jacqmaster,

Text will be sent out to the serial port in the same way as commands. I'm not familiar with the Arduino language but you might try sending ('A', BYTE). If that fails you may be down to looking up values, such as (65, BYTE), I find ascii-table.com can help there.

To make things a little easier, you may be able to go with an array, something like BYTE mydata [2] = {254, 213}; and throw the serial.print into a for loop to spit out the bytes one by one.

Anyway, you may want to sift through our app notes on the matrixorbital.ca site for a little inspiration, and feel free to throw up another post if you get hung up again.

Thanks,
~Troy